Re: bin/60383: fssconfig(8): distinguish between taking and loading a snapshot

Taylor R Campbell <[email protected]> Sat, 25 Jul 2026 19:28:30 +0000
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
Another thing that would be nice: mount a snapshot -- or any file
system, really -- just for the duration of a command, so that you
could, e.g., easily write a cron job that rsyncs a snapshot without
having to teach rsync(1) (or tar(1) or tarsnap(1) or borg(1) or
whatever) how to create snapshots on NetBSD:

	withsnapmount /fs /fs/.snap/snapname /mnt \
	rsync -aH /mnt/. backuphost:/backups/$(hostname)/.

(How to distinguish taking a new snapshot from loading an existing
snapshot in this operation is left as an exercise for the reader's
imagination.)



Also, for comparison, here's the interface on FreeBSD:

1. Create a snapshot /fs/.snap/snapname of the file system /fs
   (assuming that is, in fact, the mount point) using the
   mksnap_ffs(8) command:

	# mksnap_ffs /fs/.snap/snapname

2. Create a snapshot /fs/.snap/snapname of the file system /fs, using
   the mount(8) command -- but this doesn't actually mount it,
   apparently:

	# mount -u -o snapshot /fs/.snap/snapname /fs

3. Given a snapshot that was previously created, mount it at /mnt:

	# mdconfig -a -t vnode -o readonly -f /fs/.snap/snapname -u 4
	# mount -r /dev/md4 /mnt

Except for mksnap_ffs(8), this strikes me as very confusing!  I'm not
sure we want to copy it.

https://web.archive.org/web/20260722195637/https://docs.freebsd.org/en/books/handbook/disks/#snapshots
https://web.archive.org/web/20251118192326/https://man.freebsd.org/cgi/man.cgi?query=mksnap_ffs&sektion=8&format=html
https://web.archive.org/web/20260220073336/https://man.freebsd.org/cgi/man.cgi?format=html&query=mount&sektion=8