johnlane
Posts: 63
Joined: Fri Jul 20, 2012 8:26 pm

Booting with lvm root partition

Mon Apr 22, 2013 8:08 pm

I'm just looking into orgainsing a Pi with a big disk and plan to use LVM. I expect to find that the root partition needs to be outside any LVM scheme - I thought I'd just ask on here to confirm my thoughts.

The way I boot x86 using root-on-LVM is via an initrd that includes the necessary "lvm2" hook - the way you make an initrd is to use the "mkinitcpio" tool.

What I've discovered via Google and experimentation: The "linux" package is what brings in "mkinitcpio" on x86. On the Rpi, the "linux" package is "linux-raspberrypi" and this does not have mkinitcpio as a dependency (it was actually explicitly removed https://github.com/archlinuxarm/PKGBUILDs/pull/218). I've also read plenty about people on various distros struggling to use an initrd on the Pi so perhaps it doesn't work anyway and that's the reason for mknintcpio not being used.

So, would anyone more knowledgeable care to share their experience with me? Is it possible to boot the Pi with a root partition that is on an LVM volume ?

(I am talking about the root partition here, I am not including the boot partition in this - that's on the sd card and I know that's where it has to be. I put everything else on another hard-drive connected to the usb.)
Raspberry Pi Utilities: https://github.com/johnlane/rpi-utils
For Raspberry Pi and Arch Linux

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Booting with lvm root partition

Sun Apr 28, 2013 8:39 am

I have no idea what an LVM machine is but want to comment that mkinitcpio is still in the archlinuxarm repository as far as I can tell. Maybe it is supposed to be removed, but it is still there.

a lot of packages depend on it, cannot visit that github page in this browser, so not really sure what it being removed as a dependency means. It still is available to install if you need it.

EDIT: went to github in different browser, it looks to me like someone said that raspberrypilinux core does not use mkinitcpio as a dependency and it should not be listed as a dependency as such for raspberrypi, but that is not the same thing as removing the package completely from the repository, which would cause serious problems for the other packages that depend on it.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: Booting with lvm root partition

Sun Apr 28, 2013 10:06 am

pezz is using an initrd for a different purpose here (on a pi)
http://archlinuxarm.org/forum/viewtopic ... =10#p30166

johnlane
Posts: 63
Joined: Fri Jul 20, 2012 8:26 pm

Re: Booting with lvm root partition

Tue Apr 30, 2013 11:51 am

I have this working. It is quite straightforward (and thanks to the work by pezz).

I have written up some notes here.
Raspberry Pi Utilities: https://github.com/johnlane/rpi-utils
For Raspberry Pi and Arch Linux

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: Booting with lvm root partition

Tue Apr 30, 2013 3:16 pm

Nice

DiegoAscanio
Posts: 3
Joined: Sat Sep 07, 2013 2:41 pm

Re: Booting with lvm root partition

Sat Sep 07, 2013 2:50 pm

I made a simillar experiment based on johnlane work.

Thanks johnlane, now i'm able to have multiple archlinux arm instalations in an external usb hardrive, using lvm.

I made a basic arch system image which serves as base for all my other images... Now I have two working linux images, 1 with the basic arch installation and other with an xbmc archlinux installation. For the future, I pretend to build an arch emulationstation image.

Sorry for the poor english and once again, thank you for the good article johnlane

satishcarya
Posts: 8
Joined: Sat Aug 30, 2014 6:35 pm
Location: Bangalore

Re: Booting with lvm root partition

Mon Sep 01, 2014 7:58 am

just wanted to understand is there a way to use LVM for the extended partition on pidora..

Return to “Arch”