ZFS send/recv and overwriting of existing mounts

Thomas Backman serenity at exscape.org
Fri Jun 5 13:09:42 UTC 2009


Hey all,
I was wondering if there could (should?) be some kind of protection of  
over-mounting/shadowing (whatever the term is; overriding an existing  
mount) in ZFS.

Take this as an example (from my memory, as the shell history is gone  
due to the forceful shutdown):
zfs create tank/test
zfs snapshot tank/root at now
zfs send -R tank/root at now | zfs recv -vf tank/test
... bam, you now have two filesystems mounted on /, an empty /dev  
directory unless you double-mount devfs as well, etc.
Reboot, and the same thing happens - it mounts root from /boot/ 
loader.conf, then rc.conf executes and mounts the tank/test root copy  
over /, again hiding /dev and making your system non-bootable.
The only solution I've found so far is to reboot to livefs and destroy  
the copy... Ugh. I was just gonna test to see if send -R worked on  
vanilla sources now (I've had to use a patch previously), which it  
did, but I didn't expect it to override my root!
(Single-user might have worked, now that I think about it; still, that  
too requires downtime to fix something that shouldn't really happen.)

I guess you COULD file this under the "feature, not a bug" section,  
but in cases like this, I'd say "bug".

Regards,
Thomas


More information about the freebsd-current mailing list