Skip to content

Rage Against the Shell

Linux tips and other things…

  • Home
  • Contact
  • Privacy Policy

Category: Raspberrypi

Boot on LVM root partition in Raspbian

Posted on March 8, 2017 - March 21, 2018 by Mr. Reboot

Tested in Raspberrypi 2 Model B / Raspbian Jessie

It’s possible booting on a LVM root partition using a external USB disk instead a SD card in Raspberrypi. Steps are the next (create lvm partitions is out of this post):

Check if your raspberrypi supports booting from initrd, is necessary for activate LVM on system boot:

~ $ zcat /proc/config.gz | grep INITRD
CONFIG_BLK_DEV_INITRD=y

If don’t exist /proc/config.gz load configs before:

~ $ modprobe configs

If result is “y” (usually) then create initrd file:

~ $ mkinitramfs -o /boot/initramfs.gz

In /boot/cmdline.txt file change the root partition replacing:

~ $ root=/dev/mmcblk0p2

with lvm disk using mapper designation, supposing vg0 as lvm group and lv01 as lvm volume:

~ $ root=/dev/mapper/vg0-lv01

You can add rootdelay=5 because interfaces can take a while to appear. At last add:

~ $ initramfs initramfs.gz

at the end of file /boot/config.txt. Finally reboot, with a little luck your rapsberrypi should boot on the new lvm root partition.

Posted in RaspberrypiLeave a comment

Search

Calendar

February 2023
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728  
« Jan    

Categories

  • Apache
  • Cisco
  • Command line
  • Distros
  • Dovecot
  • File systems
  • Gadgets
  • GlusterFS
  • MySQL
  • Nginx
  • NTP
  • Opendkim
  • Pacemaker + Corosync
  • Postfix
  • Raspberrypi
  • SSH
  • SSL
  • Varnish

RSS RSS

  • Using qrencode January 16, 2022
  • Compile varnish module vmod_vsthrottle April 22, 2020
  • SSH vpn with sshuttle April 9, 2020
  • Disable swap in systemd December 16, 2019
  • Getting the parent process pid October 12, 2018
Proudly powered by WordPress | Theme: micro, developed by DevriX.