mlel...@serpens.de (Michael van Elst) writes: > moocan2...@yahoo.fr (moo can) writes: > >>Hello, >>I'm trying to install NetBSD 8 using/inside a LVM partition.I would like to= >> be able to resize partition if needed.I come from Linux and always use an = >>LVM for /boot, /, swap, /home, /var > > Simple answer, you cannot. > > LVM is mostly a userland thing and requires a running system to start. This > forbids at least using LVM for the root but also the standard swap/dump > partitions. > > There could be a solution as used for full disk encryption, but I haven't > seen anyone doing this. You can find details (for cgd) at > https://wiki.netbsd.org/security/cgdroot/.
This is getting a little off topic, but I have done that... I booted a laptop with a thumb drive which had a custom /etc/rc.d set up that prompted for the cgd password to decrypt the hard drive that was in the laptop. I then used the init.root sysctl to pivot the root file system over to the laptop hard drive. The new root was a simple cgd partition, and the rest of the filesystems were carved out using LVM. That is a small cgd0a for the new root, a cgd0b for swap, and the rest of the disk LVM with /usr, /var, etc... The laptop was also a Xen DOM0, so the LVM was carved up into DOMU space too... All encrypted except for the thumb drive. I was not able to get the new root filesystem, the cgd one, to use LVM as thumb drive utilized /rescue for its programs and /rescue does not contain any LVM utilities. It might have been possible if I would have put the LVM utilities on manually, but that would have made the creation and updating of the boot drive harder. > Everything else could be logical volumes, but on a single disk system you > would need to create some hybrid partitioning scheme which is hardly worth > the effort. Using LVM for data disks (including things like /home) works > fine. > > Please also note that our LVM only implements a subset. We still lack > a mirror target, so LVM raid or even just moving LVs online is not yet > supported. > > -- -- Brad Spencer - b...@anduin.eldar.org - KC8VKS - http://anduin.eldar.org