A few technical items on UFS2 and snapshots...

Oliver Fromme olli at lurza.secnetix.de
Wed Jun 23 07:32:26 PDT 2004


Joe Schmoe <non_secure at yahoo.com> wrote:
 > Hi - a few questions about UFS2 and snapshots:

I'm not a kernel guru, but just a user like you, so take my
answers with a pinch of salt ...

 > 1. Is it dangerous to mount all 20 possible filesystem snapshots and
 > _leave them mounted_ to use at any time ?

I don't think there is any danger, except that you will run
out of disk space sooner or later.

 > What about
 > automatically mounting all 20 snapshots at boot time ?

Sorry, I fail to see what exactly you're trying to achieve.
Why would you want to do that?

 > 2. Related to the first question, it seems like I am getting space
 > out of nowher e ... that is, if I fill up a drive, then make a
 > snapshot, then erase the drive and fill it again,

You cannot fill it up again, because the snapshot still
takes up all the space.  When you fill the drive and make
a snapshot, erasing the drive will not free any space.

 > 3. When I mount a snapshot, as described in the man page, but then
 > later mount - uw the snapshot ( to make that a writeable mount) and,
 > say, touch a file or create a file in the mounted snapshot ... what
 > exactly am I doing ?

You're getting EPERM ("operation not permitted"), because
snapshots are always read-only.

 > write file A
 > write file B
 > crash
 > file A exists, but B does not
 > write file B
 > crash
 > BOTH file A and B _no longer exist_

I think that can only happen if you modified file A in some
way before the crash.  Loading it into an editor and writing
it back without changes might be sufficient.  if the editor
doesn't overwrite the original inode, but creates a new one,
then the file will be lost if the change hasn't been synced
before the crash.

(BTW, that's a softupdates-related question, and it's not
UFS2-specific.)

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

(On the statement print "42 monkeys" + "1 snake":)  By the way,
both perl and Python get this wrong.  Perl gives 43 and Python
gives "42 monkeys1 snake", when the answer is clearly "41 monkeys
and 1 fat snake".        -- Jim Fulton


More information about the freebsd-hackers mailing list