DragonFly BSD
DragonFly users List (threaded) for 2010-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Snapshots ordering on slave and pfs according to freequency for snapshot management

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 24 Apr 2010 10:46:02 -0700 (PDT)

    I've been thinking about the issue of mounting snapshots and I
    have an idea.

    In order for a slave snapshot link to work it must reference the 
    @@<transactionid>:<pfsid> portion of the softlink relative to the
    base HAMMER filesystem the PFS was created in.

    You can do this by creating a dummy subdirectory in the base HAMMER
    filesystem and then using a nullfs mount to mount that underneath
    your samba export hierarchy.

    Then you can have snapshot softlinks that push in through there.
    You do not have to rename or move the PFS itself.

    So, here's an example.  Lets say you have:

	/samba_export		Your samba export hierarchy
	/hammer			Your hammer filesystem
	/hammer/pfs/blah	Some PFS in the hammer filesystem

    And now lets asy you want to make snapshots from PFS(s) in the hammer
    filesystem available to the export.  This would work:

	mkdir /samba_export/fubar
	mount_null /hammer/pfs /samba_export/fubar

    Similarly you can adjust or create snapshot softlinks that are relative
    to the samba_export path's null mount and store them somewhere in
    /samba_export.  In this case you might want to use a different

	mkdir /samba_export/fubar
	mkdir /hammer/samba_pfs
	mount_null /hammer/samba_pfs /samba_export/fubar

    And then create the specially formatted hammer PFS softlinks in

	cd /hammer/samba_pfs
	ln -s "@@PFS00001" blah

	(where the PFS number is formatted as "@@PFS%05d").

    There is absolutely nothing preventing you from creating as many
    @@PFS%05d softlinks as you want, all pointing to the same PFS.  The
    only requirement is that they be created inside the HAMMER filesystem
    the PFSs were created in.

    You may have other issues... tracking the snapshots could present
    a problem since hammer cleanup only allows one snapshot directory
    to be specified.  So you might have to come up with a little script
    to maintain a second set of snapsoft softlinks with the proper samba
    path which mirrors the master set which hammer cleanup maintains.
    Otherwise you will wind up with a lot of stale snapshot softlinks.


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]