1 2 | #create a Snapshot LV called 'snap' from origin LV 'test' lvcreate -s -L 2G -n snap/dev/test-volume/test |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | lvdisplay /dev/vg00/snap --- Logical volume --- LV Name /dev/vg00/snap VG Name vg00 LV UUID QHVJYh-PR3s-A4SG-s4Aa-MyWN-Ra7a-HL47KL LV Write Access read/write LV snapshot status active destination for /dev/vg00/test LV Status available # open 0 LV Size 4.00 GB Current LE 1024 COW-table size 2.00 GB COW-table LE 512 Allocated to snapshot 54.16% Snapshot chunk size 8.00 KB Segments 1 Allocation inherit Read ahead sectors 0 Block device 254:5 |
1 2 | #mount snapshot volume mount -o ro /dev/test-volume/test /mnt/snap |
1 2 | #remove snapshot lvremove /dev/test-volume/snap |
1 2 3 4 | SQL> flush tables read lock {create Snapshot} SQL> release read lock {start copy process from the snapshot LV} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #!/bin/sh # we need the dm-snapshot module modprobe dm-snapshot if [ -e /dev/vg00/home-snap ] then # remove left-overs, if any umount -f /mnt/home-snap && true lvremove -f /dev/vg00/home-snap fi # create snapshot, 1GB CoW space # that should be sufficient for accommodating changes during copy lvcreate -vs -p r -n home-snap -L 1G /dev/vg00/home mkdir -p /mnt/home-snap # mount recently-created snapshot as read-only mount -o ro /dev/vg00/home-snap /mnt/home-snap # magical rsync command__rsync -avhzPCi --delete -e "ssh -i /home/klausk/.ssh/id_rsa" \ --filter '- .Trash/' --filter '- *~' \ --filter '- .local/share/Trash/' \ --filter '- *.mp3' --filter '- *Cache*' --filter '- *cache*' \ /mnt/home-snap/klausk klausk2@pokgsa.ibm.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it :bkp/ # unmount and scrap snapshot LV umount /mnt/home-snap lvremove -f /dev/vg00/home-snap |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |