The Tridecadal Korean (astralblue) wrote,
The Tridecadal Korean
astralblue

  • Mood:

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: bsd, geek
Subscribe

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment