Restore UFS snapshot

Roland Smith rsmith at xs4all.nl
Sat May 26 21:12:16 UTC 2007


On Sat, May 26, 2007 at 10:30:13PM +0200, Svein Halvor Halvorsen wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Roland Smith wrote:
> >>> You can mount the snapshot, and then copy the files back to the original fs.
> >>> Note that cp can preserve flags, but not ACLs AFAIK.
> >> Yes, I know that this is possible. However, it's a lot of work.
> > 
> > Huh? 
> > 
> > Suppose you did 'mksnap_ffs /usr /usr/.snap/20070526'
> > 
> > Then all you have to is something like:
> > 
> > # mdconfig -a -t vnode -f /usr/.snap/20070526 -u 0
> > # mount /dev/md0 /mnt/snapshot
> > # cd /usr
> > # tar cf - /mnt/snapshot/* |tar xpf -
> > # umount /mnt/snapshot
> > # mdconfig -d -u 0
> > 
> > How much easier could it be? You could easily create a script for this
> > as well.
> 
> Let me clarify: It is a lot of work for the computer, for the hdd.

You could use rsync instead of tar. That would save time.

> (b) Undo all the bit flipping I have done, since I made the snapshot.

This is what the procedure above does if you replace the tar commands
with rsync.

Roland
-- 
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20070526/e9f163a8/attachment.pgp


More information about the freebsd-questions mailing list