[arch-general] [mkinitcpio] support for /usr on a separate partition
Hi all, With the release of mkinitcpio 0.8.2, we've added support for mounting /usr from early userspace when it exists as a separate partition. This has been something people have been asking about for a little while, so I figured I'd make a call out for the feature. There's two requirements to make sure this works: 1) Include the shutdown hook in /etc/mkinitcpio.conf. This copies the contents of the initramfs to /run/initramfs during bootstrap and additionally adds a small script (cleverly called shutdown). On shutdown, initscripts will bind mount the API filesystems into /run/initramfs, pivot into this new root, and then unmount the real filesystems from top to bottom. For the time being, this is a fairly dumb process. We don't break down stacked filesystems like LVM or close crypt mappings. I may aim to do for the next release. 2) Include the fsck hook in /etc/mkinitcpio.conf. This needs to go _before_ autodetect if your /usr is a different FS from your root. Neglecting to add the fsck hook will result in bad things. I expect this to change next release and the fsck hook will be smart enough to grab binaries for only root and usr. The fsck hook is highly recommended for everyone, not just those with a separate /usr. Running fsck in early userspace means the device can be checked before it's even mounting -- any and all repairs can be performed without the need for a reboot. With systemd, this pretty much all works the same. The shutdown script is honored, and your root will not be re-fsck'd due to a tell-tale file dropped in /run/initramfs. Happy testing! dave
On 01/13/2012 09:48 PM, Dave Reisner wrote:
The fsck hook is highly recommended for everyone, not just those with a separate /usr. Running fsck in early userspace means the device can be checked before it's even mounting -- any and all repairs can be performed without the need for a reboot.
Currently my mkinitcpio.conf contains BINARIES="fsck fsck.ext4". I forget whether I put it there (probably did). Can/must I remove those from the BINARIES line to add this new fsck hook? Thanks -Isaac
On 01/13/2012 07:30 PM, Isaac Dupree wrote:
On 01/13/2012 09:48 PM, Dave Reisner wrote:
The fsck hook is highly recommended for everyone, not just those with a separate /usr. Running fsck in early userspace means the device can be Should it be moved to hooks now?
checked before it's even mounting -- any and all repairs can be performed without the need for a reboot.
Currently my mkinitcpio.conf contains BINARIES="fsck fsck.ext4". I forget whether I put it there (probably did). Can/must I remove those from the BINARIES line to add this new fsck hook?
That is how it is in the wiki is with those in the binaries part.
Thanks -Isaac
Should it be moved to hooks now? Thanks
On Fri, Jan 13, 2012 at 20:48, Dave Reisner <d@falconindy.com> wrote:
Hi all,
With the release of mkinitcpio 0.8.2, we've added support for mounting /usr from early userspace when it exists as a separate partition. This has been something people have been asking about for a little while, so I figured I'd make a call out for the feature.
There's two requirements to make sure this works:
1) Include the shutdown hook in /etc/mkinitcpio.conf. This copies the contents of the initramfs to /run/initramfs during bootstrap and additionally adds a small script (cleverly called shutdown). On shutdown, initscripts will bind mount the API filesystems into /run/initramfs, pivot into this new root, and then unmount the real filesystems from top to bottom.
For the time being, this is a fairly dumb process. We don't break down stacked filesystems like LVM or close crypt mappings. I may aim to do for the next release.
2) Include the fsck hook in /etc/mkinitcpio.conf. This needs to go _before_ autodetect if your /usr is a different FS from your root. Neglecting to add the fsck hook will result in bad things. I expect this to change next release and the fsck hook will be smart enough to grab binaries for only root and usr.
The fsck hook is highly recommended for everyone, not just those with a separate /usr. Running fsck in early userspace means the device can be checked before it's even mounting -- any and all repairs can be performed without the need for a reboot.
With systemd, this pretty much all works the same. The shutdown script is honored, and your root will not be re-fsck'd due to a tell-tale file dropped in /run/initramfs.
Happy testing!
dave
Forgot to read my email before upgrading. Dave is right about bad things happening if you don't put fsck hook in mkinitcpio. Really bad things. Myra PS. Lots of downgrading got it back up. -- Life's fun when your sick and psychotic!
On Fri 13 January 2012 at 21:48 -0500, Dave Reisner wrote:
Hi all,
With the release of mkinitcpio 0.8.2, we've added support for mounting /usr from early userspace when it exists as a separate partition. This has been something people have been asking about for a little while, so I figured I'd make a call out for the feature.
Thanks a lot! I added the two hooks and could upgrade without breakage due to my separate /usr partition on LVM. -- Rémy.
participants (5)
-
Dave Reisner
-
Don Juan
-
Isaac Dupree
-
Myra Nelson
-
Rémy Oudompheng