[arch-dev-public] [mkinitcpio] support for /usr on a separate partition

Dave Reisner d at falconindy.com
Fri Jan 13 21:48:23 EST 2012

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!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/arch-dev-public/attachments/20120113/8e94eec0/attachment.asc>

More information about the arch-dev-public mailing list