Slack current with btrfs root (seperate /boot) has mkinitrd issue
Harddrive setup is:
/dev/sda1 /boot /dev/sda2 swap /dev/sda3 LUKS encrypted Then on the encrypted partition, I used btrfs, but my Slackware root is really a subvolume named system and not the root of btrfs. I do a similar setup of having the OS's root in it's own filesystem on FreeBSD+ZFS. Anyways, my problem lies in mkinitrd. There's no way to enter extra boot options, as I require subvol=system to be added to mount -o ro -t $ROOTFS $ROOTDEV /mnt in the init script of /boot/initrd.gz. I don't reboot often and it's easy to manually remount /mnt with the correct options, however, is there another way of passing boot options to mkinitrd? I see Patrick is the author of mkinitrd, so maybe this kind of option could, or maybe should, be added? I'm sure most people wouldn't make a subvolume for the OS's root, but I've been use to it with ZFS and prefer it for some reason. |
Hey - your post get me interested in btrfs file systems, (of which I have no experience), so I created a new Slackware VM in VirtualBox following Alien Bob's instructions for installing LUKS and LVM,( something I have done before), and utilizing a btrfs root file system, (something I have not done before), and everything worked OK.
Now admittedly I am not using subvolumes here so obviously your setup is more sophisticated than my test rig however would it not be possible to just edit /boot/initrd-tree/init and add your subvol=system bits manually to the "mount -o ro -t $ROOTFS $ROOTDEV /mnt" parts of the script and then create the initrd without adding the "-c" to clear initrd-tree? Mkinitrd is an amazing script and i'm sure it can easily create the new initrd from existing contents ot the /boot/initrd-tree. As said, this should create the initrd from the existing contents of /boot/initrd-tree including your edited mount parts. I hope so but I've not tried it - in any case thanks for your interesting post - I love new areas of Linux to experiment with, ( yes, I'm a total geek), and the combination of LUKS/LVM and btrfs got my interest! I think I'll be looking into brtfs a lot as I have a fascination with different filesystems and their benefits. The Hammer filesystem, part of DragonFly BSD is personal a favourite. |
I could be wrong, but isn't LVM2 unnecessary with btrfs? I thought it had most of LVM2's features built-in.
|
Quote:
Quote:
|
Perhaps the addition of a $ROOTOPTS variable to the initrd script would do it. Shouldn't be too hard.
I've not played with btrfs yet, but can you make use of Quote:
|
Quote:
Quote:
Quote:
|
Quote:
Tip: create yourself a initrd_build.sh and put all the commands necessary to build your custom initrd in there. If you do it manually then sooner or later when it's time for a new kernel, you'll end up forgetting to do it. And, I've done that before too. ;) Was the btrfs subvolume set-default suggestion no good for you? |
Quote:
Example: OS #1: / - subvol=system; /usr - subvol=usr; /var - subvol=var; /home - subvol=home OS #2: / - subvol=system2; /usr - subvol=usr2; /var - subvol=var2; /home - subvol=home And so on, until I run out of storage space. And easy to delete an OS I no longer want to boot. All without ever needing to redo MBR/GPT partitions. So in my case, I think it would be easier to make a second initrd.gz which has mount -o subvol=system2, and tell lilo in another entry to use that second initrd.gz. Your suggestion, I would have to issue the set-default command at each reboot that I wanted to switch OSes? I could be wrong though. Quote:
|
All times are GMT -5. The time now is 10:54 PM. |