Page 1 of 1

Booting with lvm root partition

Posted: Mon Apr 22, 2013 8:08 pm
by johnlane
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.)

Re: Booting with lvm root partition

Posted: Sun Apr 28, 2013 8:39 am
by sdjf
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.

Re: Booting with lvm root partition

Posted: Sun Apr 28, 2013 10:06 am
by pepedog
pezz is using an initrd for a different purpose here (on a pi)
http://archlinuxarm.org/forum/viewtopic ... =10#p30166

Re: Booting with lvm root partition

Posted: Tue Apr 30, 2013 11:51 am
by johnlane
I have this working. It is quite straightforward (and thanks to the work by pezz).

I have written up some notes here.

Re: Booting with lvm root partition

Posted: Tue Apr 30, 2013 3:16 pm
by pepedog
Nice

Re: Booting with lvm root partition

Posted: Sat Sep 07, 2013 2:50 pm
by DiegoAscanio
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

Re: Booting with lvm root partition

Posted: Mon Sep 01, 2014 7:58 am
by satishcarya
just wanted to understand is there a way to use LVM for the extended partition on pidora..