Bug 102745

Summary: "mount -o snapshot" removes any existing "-o" option from the mount
Product: Base System Reporter: Lapo Luchini <lapo>
Component: binAssignee: Craig Rodrigues <rodrigc>
Status: Closed FIXED    
Severity: Affects Only Me CC: lapo
Priority: Normal    
Version: 6.1-STABLE   
Hardware: Any   
OS: Any   

Description Lapo Luchini 2006-09-01 11:10:22 UTC
(edited for shortness, showing only relevant lines)

% mount                           
/dev/ad0s1f on /usr (ufs, local, soft-updates, acls)
% mount -u -o snapshot /usr/snap /usr
% mount                           
/dev/ad0s1f on /usr (ufs, local, soft-updates)
# now most services don't work anymore as ACLs are missing!
# not very nice to silently discard options
% mount -u -o acls /usr
% mount                           
/dev/ad0s1f on /usr (ufs, local, soft-updates, acls)
% mount -u -o acls,snapshot /usr/snap2 /usr
% mount
/dev/ad0s1f on /usr (ufs, local, soft-updates, acls)
# ok, but not very easy to be used from a script
% mount -u -o current,snapshot /usr/snap3 /usr
mount: -o current: option not supported
% mount -u -o fstab,snapshot /usr/snap3 /usr
mount: -o fstab: option not supported

IMvHO a snapshot should mount the file system exactly as it was before
the snapshot or, at least, accept to be paired with "current" or "fstab"
in order to automatically select the "same" options that were used.

PS: I know I could solve the problems with ACLs using "tunefs -a /usr"
and not needing a mount option anymore, but the problem is a bit more
general than that (and I only have remote access to that server, so I
can't possibly umount /usr in order to tunefs...).
Comment 1 Craig Rodrigues freebsd_committer freebsd_triage 2007-01-25 06:12:21 UTC
State Changed
From-To: open->patched

In CURRENT, "mount -u -o snapshot" does not remove the "acls" 
mount option on an existing mount.  However, the behavior 
described in this PR still exists in RELENG_6. 
There has been a lot of refactoring of the mount code in 
CURRENT, and not all of these fixes have made it to RELENG_6. 


Comment 2 Craig Rodrigues freebsd_committer freebsd_triage 2007-01-25 06:12:21 UTC
Responsible Changed
From-To: freebsd-bugs->rodrigc

In CURRENT, "mount -u -o snapshot" does not remove the "acls" 
mount option on an existing mount.  However, the behavior 
described in this PR still exists in RELENG_6. 
There has been a lot of refactoring of the mount code in 
CURRENT, and not all of these fixes have made it to RELENG_6.
Comment 3 Craig Rodrigues freebsd_committer freebsd_triage 2008-03-05 07:41:50 UTC
State Changed
From-To: patched->closed

This fix is in 7.0-RELEASE, but won't be backported 
to RELENG_6 due to a lot of refactoring of the mount code.