?

Log in

No account? Create an account
Eyes

UFS Snapshot As an Anti-Footshooting Measure

Background: ~/Doc/Ref is a 600MiB collection of various reference documents, built by bits and pieces over more than 3 years by now.  I was about to replace one of its subdirectories, ~/Doc/Ref/IETF, with ~/IETF…:

seerajeane ~ $ 34 ls IETF
internet-drafts
seerajeane ~ $ 35 rm -rf ~/Doc/Ref
← meant ~/Doc/Ref/IETF, of course…
seerajeane ~ $ 36
← … Fuck! -_-; Okay, don't panic, don't panic….
seerajeane ~ $ 36 ls -l /home/.snap
total 565728
-r--r-----  1 root  operator  291476483960 Sep 19 04:32 ufs_snapshot
YES!
seerajeane ~ $ 37 sudo su -
seerajeane ~ # 1 mdconfig -a -t vnode -f /home/.snap/ufs_snapshot -o readonly
md0
seerajeane ~ # 2 mount -r /dev/md0 /mnt
seerajeane ~ # 3 cd /mnt/ab/Doc/Ref
seerajeane Ref # 4 find -d . -print0 | cpio -pdm0v ~ab/Doc/Ref
seerajeane Ref # 5 cd /
seerajeane / # 6 umount /mnt
seerajeane / # 7 mdconfig -d -u 0
seerajeane / # 8 exit
seerajeane ~ $ 38 rm -rf ~/Doc/Ref/IETF
seerajeane ~ $ 39 mv IETF ~/Doc/Ref/
seerajeane ~ $ 40

/home/.snap/ufs_snapshot is a UFS snapshot that I create every morning, as a sort of backup.  Thus saved was another day, by an obscure BSD-specific gimmick.  ♥♥♥♥♥♥♥♥

Tags: ,

Comments

Snapshots exist for plenty of filesystems, but apparently, not the ones in the most widespread use. I admit this is one of the reasons I'm crazy about ZFS, crazy enough to even brave learning Solaris. :)