How to create filesystem snapshots using Cowloop?
Cowloop can be used to create filesystem snapshots. Cowloop can even be used to create a snapshot of a snapshot, which results in the possibility to rollback filesystems. This example demonstrates how to create a snapshot of a filesystem, a snapshot of a snapshot, and how to rollback.
[atdemo@atdemo ~]$ su -
Password:
Create some mount points
# mkdir /snap /cowfiles
Create a snapshot of LVexample and mount it on /snap. Create file1 and unmount it.
# cowdev -a /dev/VolGroup00/LVexample /cowfiles/cowfile1
/dev/cow/1
# mount /dev/cow/1 /snap
# touch /snap/file1
# umount /snap
Create a snapshot of snapshot (/dev/cow/1). Create file2 and unmount it.
# cowdev -a /dev/cow/1 /cowfiles/cowfile2
/dev/cow/2
# mount /dev/cow/2 /snap
# touch /snap/file2
# umount /snap
Create a snapshot of snapshot (/dev/cow/2). Create file3 and unmount it.
# cowdev -a /dev/cow/2 /cowfiles/cowfile3
/dev/cow/3
# mount /dev/cow/3 /snap
# touch /snap/file3
In this snapshot we have 3 files...
# ls /snap
file1 file2 file3
# umount /snap
Rollback 1 instance...
# mount /dev/cow/2 /snap
# ls /snap
file1 file2
# umount /snap
Rollback another instance...
# mount /dev/cow/1 /snap
# ls /snap
file1
# umount /snap
Delete temporary cowdevs and cowfiles.
# cowdev -d /dev/cow/3
# cowdev -d /dev/cow/2
# cowdev -d /dev/cow/1
# rm /cowfiles/cowfile[1-3]
For more information: visit the Cowloop homepage or see the Cowloop man pages.
|