"All writes are directed to the topmost mounted filesystem..."
This seems really obscure to me. So, if you union-mount everything onto the / mountpoint, then if you 'mkdir /blah' it gets created on the first (true root) partition, and you have no way to change that -- ever after bootup? Or am I confused?
If the choice of which device gets the writes is determined by the mount-order, won't that lead to some really strange work flows? I'm thinking, suppose we have:
# at bootup, from fstab processing
mount /dev/sda1 /
mount --union /dev/sda2 / (contains /opt)
mount --union /dev/sda3 / (contains /opt/whatever)
If you need to perform an fsck on /dev/sda2 for some reason, because of hardware issues or something, then you would want to unmount /opt then do an fsck on /dev/sda2, then remount it...
BUT! If you did that, you would inadvertently change the behavior of "mkdir /opt/foo" so that it gets created on /dev/sda3 AFTER the fsck and remount, versus being created on /dev/sda2 BEFORE the fsck and remount... Or am I misunderstanding this...?
It seems to me that implicit behavior is far more risky than explicit behavior. I'd ammend the idea of union mounts with an explicit numeric ordering that you specify with the --union option, like:
mount --union=1 /dev/sda2 / (contains /opt)
mount --union=2 /dev/sda3 / (contains /opt/whatever)
Then when you unmount /dev/sda2, and then remount it, you could specify the --union=1 option to restore /dev/sda2 to its ranking(ordering) with respect to the other devices mounted on the same mountpoint... And if you specify an ordering value that is already "in-use", then the 'mount' command could exit and abort with an error message.
It just seems like a huge risk to incur to have regular maintenance (umount,fsck,mount) lead to unexpected changes in the behavior of basic filesystem operations like mkdir. Especially if it's easily solved with an explicit numeric ordering provided by the admin.
Boy, I hope I'm just really ignorant here and missing something obvious... Anyone able to correct me here and allay my concern?
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds