From obrien@NUXI.com  Mon Aug 27 13:39:11 2001
Return-Path: <obrien@NUXI.com>
Received: from dragon.nuxi.com (dsl092-013-169.sfo1.dsl.speakeasy.net [66.92.13.169])
	by hub.freebsd.org (Postfix) with ESMTP id CA48D37B40B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Aug 2001 13:39:07 -0700 (PDT)
	(envelope-from obrien@NUXI.com)
Received: (from obrien@localhost)
	by dragon.nuxi.com (8.11.5/8.11.1) id f7RKd3f02021;
	Mon, 27 Aug 2001 13:39:03 -0700 (PDT)
	(envelope-from obrien)
Message-Id: <200108272039.f7RKd3f02021@dragon.nuxi.com>
Date: Mon, 27 Aug 2001 13:39:03 -0700 (PDT)
From: "David O'Brien" <obrien@NUXI.com>
Reply-To: "David O'Brien" <obrien@NUXI.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: snapshots mount option not documented in mount(8)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         30139
>Category:       bin
>Synopsis:       snapshots mount option not documented in mount(8)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    trhodes
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 27 13:40:00 PDT 2001
>Closed-Date:    Mon Jul 15 08:31:27 PDT 2002
>Last-Modified:  Mon Jul 15 08:31:27 PDT 2002
>Originator:     David O'Brien
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD dragon.nuxi.com 5.0-CURRENT FreeBSD 5.0-CURRENT #195: Mon Aug 27 12:24:38 PDT 2001 rootk@dragon.nuxi.com:/FBSD/src/sys/i386/compile/DRAGON.5-current i386


	
>Description:
	The snapshot option was added to src/sbin/mount/mount_ufs.c rev 1.17.
	But it is not documented any where that I can find.

>How-To-Repeat:
	man 8 mount
>Fix:

	


>Release-Note:
>Audit-Trail:

From: "Chris Knight" <chris@aims.com.au>
To: <freebsd-gnats-submit@FreeBSD.org>, <obrien@FreeBSD.org>
Cc:  
Subject: Re: bin/30139: snapshots mount option not documented in mount(8)
Date: Wed, 19 Jun 2002 21:33:11 +1000

 Howdy,
 
 Here's a diff to the mount man page including the snapshot support.
 I shamelessly cut'n'pasted from Kirk's README.snapshot file and made
 some minor edits.
 Apologies if I've got some of the manpage formatting wrong - it was a
 5 minute crash course on mdoc to do this.
 
 Regards,
 Chris Knight
 
 --- src/sbin/mount/mount.8.old	Tue May 21 10:50:17 2002
 +++ src/sbin/mount/mount.8	Wed Jun 19 21:19:34 2002
 @@ -181,6 +181,62 @@
  All
  .Tn I/O
  to the filesystem should be done synchronously.
 +.It Cm snapshot
 +This option allows a snapshot of the specified filesystem to be taken. The
 +.Fl u
 +flag is required with this option. Note that snapshot files must be created in
 +the filesystem that is being snapshotted. You may create up to 20 snapshots per
 +filesystem. Active snapshots are recorded in the superblock, so they persist
 +across unmount and remount operations and across system reboots. When you are
 +done with a snapshot, it can be removed with the
 +.Xr rm
 +command. Snapshots may be removed in any order, however you may not get back all
 +the space contained in the snapshot as another snapshot may claim some of the
 +blocks that it is releasing. Note that the schg flag is set on snapshots to
 +ensure that not even the root user can write to them. The unlink command makes
 +an exception for snapshot files in that it allows them to be removed even though
 +they have the schg flag set, so it is not necessary to clear the schg flag
 +before removing a snapshot file.
 +.Pp
 +Once you have taken a snapshot, there are three interesting things that you can 
 +do with it:
 +.Pp
 +.Bl -enum -compact
 +.It
 +Run fsck on the snapshot file. Assuming that the filesystem was clean when it
 +was mounted, you should always get a clean (and unchanging) result from running 
 +fsck on the snapshot. This is essentially what the background fsck process does.
 +.Pp
 +.It
 +Run dump on the snapshot. You will get a dump that is consistent with the
 +filesystem as of the timestamp of the snapshot. Note that
 +.Xr dump
 +has not yet been changed to set the dumpdates file correctly, so do not use this
 +feature in production until that fix is made.
 +.Pp
 +.It
 +Mount the snapshot as a frozen image of the filesystem. To mount the snapshot
 +.Pa /var/snapshot/snap1 :
 +.Bd -literal
 +mdconfig -a -t vnode -f /var/snapshot/snap1 -u 4
 +mount -r /dev/md4 /mnt
 +.Ed
 +.Pp
 +You can now cruise around your frozen
 +.Pa /var
 +filesystem at
 +.Pa /mnt .
 +Everything will be in the same state that it was at the time the snapshot was
 +taken. The one exception is that any earlier snapshots will appear as zero
 +length files. When you are done with the mounted snapshot:
 +.Bd -literal
 +umount /mnt
 +mdconfig -d -u 4
 +.Ed
 +.Pp
 +Further details can be found in the file at
 +.Pa /usr/src/sys/ufs/ffs/README.snapshot .
 +.El
  .It Cm suiddir
  A directory on the mounted filesystem will respond to the SUID bit
  being set, by setting the owner of any new files to be the same
 
 

From: "David O'Brien" <obrien@FreeBSD.org>
To: chris@ait0fd01.aims.private
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/30139: snapshots mount option not documented in mount(8)
Date: Wed, 19 Jun 2002 10:01:23 -0700

 On Wed, Jun 19, 2002 at 09:33:11PM +1000, Chris Knight wrote:
 > Here's a diff to the mount man page including the snapshot support.
 > I shamelessly cut'n'pasted from Kirk's README.snapshot file and made
 > some minor edits.
 
 This is a good patch and having snapshots better documented is a big help
 to all.
 
 Could you make one more pass over your patch and change one thing.
 All sentances should end at the end of a line.
 Maybe comma's too,
 I don't remember too much about them.
 
 What I wrote above is an example of what I mean.  There are no sentances
 like the previous one to this that don't end at the end of a line.
 
 
 +.It Cm snapshot
 +This option allows a snapshot of the specified filesystem to be taken.
 +The
 +.Fl u
 +flag is required with this option.
 +Note that snapshot files must be created in the filesystem that is being
 +snapshotted.
 +You may create up to 20 snapshots per filesystem.
 +Active snapshots are recorded in the superblock,
 +so they persist across unmount and remount operations and across system
 +reboots.

From: chris@aims.com.au
To: <freebsd-gnats-submit@FreeBSD.org>, <obrien@NUXI.com>
Cc: <chris@aims.com.au>
Subject: Re: bin/30139: snapshots mount option not documented in mount(8)
Date: Sun, 23 Jun 2002 17:09:25 +1000

 Howdy,
 
 OK, here's an updated patch. The rest of the mount manpage suggests that line
 breaks after commas is not necessary. Thanks for the feedback.
 Sorry about the e-mail address. I must remember to regen my sendmail.cf file
 after upgrading.
 
 Regards,
 Chris Knight
 
 --- mount.8.orig	Tue May 21 10:50:17 2002
 +++ mount.8	Sun Jun 23 16:58:22 2002
 @@ -181,6 +181,73 @@
  All
  .Tn I/O
  to the filesystem should be done synchronously.
 +.It Cm snapshot
 +This option allows a snapshot of the specified filesystem to be taken.
 +The
 +.Fl u
 +flag is required with this option.
 +Note that snapshot files must be created in the filesystem that is being
 +snapshotted.
 +You may create up to 20 snapshots per filesystem.
 +Active snapshots are recorded in the superblock, so they persist across unmount
 +and remount operations and across system reboots.
 +When you are done with a snapshot, it can be removed with the
 +.Xr rm
 +command.
 +Snapshots may be removed in any order, however you may not get back all the
 +space contained in the snapshot as another snapshot may claim some of the blocks
 +that it is releasing.
 +Note that the schg flag is set on snapshots to ensure that not even the root
 +user can write to them.
 +The unlink command makes an exception for snapshot files in that it allows them
 +to be removed even though they have the schg flag set, so it is not necessary to
 +clear the schg flag before removing a snapshot file.
 +.Pp
 +Once you have taken a snapshot, there are three interesting things that you can 
 +do with it:
 +.Pp
 +.Bl -enum -compact
 +.It
 +Run fsck on the snapshot file.
 +Assuming that the filesystem was clean when it was mounted, you should always
 +get a clean (and unchanging) result from running fsck on the snapshot.
 +This is essentially what the background fsck process does.
 +.Pp
 +.It
 +Run dump on the snapshot.
 +You will get a dump that is consistent with the filesystem as of the timestamp
 +of the snapshot.
 +Note that
 +.Xr dump
 +has not yet been changed to set the dumpdates file correctly, so do not use this
 +feature in production until that fix is made.
 +.Pp
 +.It
 +Mount the snapshot as a frozen image of the filesystem.
 +To mount the snapshot
 +.Pa /var/snapshot/snap1 :
 +.Bd -literal
 +mdconfig -a -t vnode -f /var/snapshot/snap1 -u 4
 +mount -r /dev/md4 /mnt
 +.Ed
 +.Pp
 +You can now cruise around your frozen
 +.Pa /var
 +filesystem at
 +.Pa /mnt .
 +Everything will be in the same state that it was at the time the snapshot was
 +taken.
 +The one exception is that any earlier snapshots will appear as zero length
 +files.
 +When you are done with the mounted snapshot:
 +.Bd -literal
 +umount /mnt
 +mdconfig -d -u 4
 +.Ed
 +.Pp
 +Further details can be found in the file at
 +.Pa /usr/src/sys/ufs/ffs/README.snapshot .
 +.El
  .It Cm suiddir
  A directory on the mounted filesystem will respond to the SUID bit
  being set, by setting the owner of any new files to be the same
 
 
State-Changed-From-To: open->patched 
State-Changed-By: trhodes 
State-Changed-When: Thu Jul 11 14:13:02 PDT 2002 
State-Changed-Why:  
I have applied this change and will see to the MFC.  Thanks for the submission! 


Responsible-Changed-From-To: freebsd-bugs->trhodes 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Thu Jul 11 14:13:02 PDT 2002 
Responsible-Changed-Why:  
I have applied this change and will see to the MFC.  Thanks for the submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30139 
State-Changed-From-To: patched->closed 
State-Changed-By: trhodes 
State-Changed-When: Mon Jul 15 08:30:46 PDT 2002 
State-Changed-Why:  
Patched and closed.  This was not MFC'ed as snapshots are not supported in 
-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30139 
>Unformatted:
