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!
