Root Remount (reroot) ze ZFS na jine ZFS

Marián Černý majo-users-l at cerny.sk
Wed May 29 11:06:52 CEST 2019


Zdravim,

od FreeBSD 11.0 je mozne remountnut root (reboot -r) (http://www.freebsd.cz/news/status/report-2015-10-2015-12.html#Root-Remount).

Trochu jsem se s tim hral
- da se rerootovat na NFS root - vhodne napriklad kdyz nefunguje PXE boot
- da se rerootovat na temporary memory filesystem, predelat rootfs napriklad z UFS na ZFS a rerootovat zpet (https://people.freebsd.org/~lidl/blog/re-root.html)
- da se rerootovat na sifrovany filesystem, predem odemceny pres geli attach

Ted zkousim ten posledny pripad. Mam nesifrovany ZFS pool (base), do ktereho nabootuju, tam pripojim sifrovany ZFS pool (private) a pak do nej rerootuju.

Ale nastava problem, ze pred rerootem se ten base pool neodmontuje cely (jenom root) a nove filesystemy jsou namontovane pres ty stare:

private/ROOT/default on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
base/home on /home (zfs, local, noatime, nfsv4acls)
private/home on /home (zfs, local, noatime, nfsv4acls)
private/tmp on /tmp (zfs, local, noatime, nfsv4acls)
base/tmp on /tmp (zfs, local, noatime, nfsv4acls)
base/var/crash on /var/crash (zfs, local, noatime, nfsv4acls)
private/var/crash on /var/crash (zfs, local, noatime, nfsv4acls)
base/var/log on /var/log (zfs, local, noatime, nfsv4acls)
private/var/log on /var/log (zfs, local, noatime, nfsv4acls)
base/var/mail on /var/mail (zfs, local, noatime, nfsv4acls)
private/var/mail on /var/mail (zfs, local, noatime, nfsv4acls)
private/var/tmp on /var/tmp (zfs, local, noatime, nfsv4acls)
base/var/tmp on /var/tmp (zfs, local, noatime, nfsv4acls)

Nevite, jak lze zabezpecit, aby se to kompletne odmontovalo?

U rerootu z UFS na ZFS se UFS odmontuje cele.

IMHO to vypada na bug. Z manualove stranky reboot(8):

     -r	     The system kills all processes, unmounts all filesystems, mounts
	     the new root filesystem, and begins the usual startup sequence.
	     After changing vfs.root.mountfrom with kenv(1), reboot -r can be
	     used to change the root filesystem while preserving kernel state.
	     This requires the tmpfs(5)	kernel module to be loaded because
	     init(8) needs a place to store itself after the old root is
	     unmounted, but before the new root is in place.

Je tam uvedeno "unmounts all filesystems".

Marian


More information about the Users-l mailing list