Archive for the 'ufs' Category

20
Nov
08

FreeBSD UFS Snapshot


Creating a simple file to show how it works:

~# echo “test 1″ > /tmp/test.txt


Setting a directory where will be save the snapshot:

~# mkdir /tmp/.snap


Creating the snapshot:

~# mount -u -o snapshot /tmp/.snap/snap_1 /tmp
~# ls -l /tmp/.snap/snap_1


Changing the content of file:

~# echo “test 2″ > /tmp/test.txt
~# ls -l /tmp/test.txt


Mounting the Snapshot:

~# mdconfig -a -t vnode -u 1
~# mount -o ro /dev/md1 /mnt/
~# ls -l /mnt/test.txt /tmp/test.txt


Showing the content of files:

~# cat /mnt/test.txt /tmp/test.txt
test 1
test 2


Finalizing:

~# umount /mnt
~# mdconfig -d -u 1
~# rm /tmp/.snap/snap_1


Yes, It really works!




Calendar:

May 2012
S M T W T F S
« Dec    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories


Follow

Get every new post delivered to your Inbox.

Join 416 other followers