Remount root RO after the root dentry drops from the namespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

OLPC ships a slightly strange filesystem layout. We keep everything
under /versions/run/<hash>. For example, libc is
at /versions/run/<hash>/lib/libc.so.6

The background behind this is that we can then create a mass of
hardlinks to that original OS, and do a safe OS update by downloading
files that have changed into that 2nd tree, breaking the hardlinks as we
go. At the end we can atomically update the symlink that points to
the /versions/run/<hash> which determines which OS is booted into on
reboot. Therefore we have atomic OS updates which can be interrupted
without consequences.

Once the system is booted, this weird layout is barely visible, because
the initramfs performs a series of chroot and mount --move steps in
order to make things function as normal. Assuming that the initramfs
mounts the root partition at /sysroot in its namespace and the hash
we're booting into is just "1", then this is what happens:

1. cd /sysroot
2. mount --move . /
3. chroot .
4. cd /
5. chdir /versions/run/1
6. chroot .
7. cd /
8. exec /sbin/init

This works well and the system functions as normal. However, I've
noticed that during shutdown, the root filesystem is never unmounted
cleanly.

"mount -o remount,ro /" always fails due to this check in do_remount():
	if (path->dentry != path->mnt->mnt_root) {
		return -EINVAL;

Obviously the dentry for the / path that we are trying to unmount is not
the actual root of the mount. However the root of the mount is long
gone, so I'm not sure what we can do. And shutting down cleanly is
obviously important!

Any thoughts?

Thanks!
Daniel


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux