Home | Mirror | Search

6. snapshot backup

dump + restore

1.掛載備份源www
mount /dev/vg1/www /www

2.創建快照
lvcreate -L 16m -p r -s -n www-backup /dev/vg1/www

3.掛載快照
mkdir /mnt/www-backup
mount -o ro /dev/vg1/www-backup /mnt/www-backup

4.備份快照
dump -0u -f /tmp/www-backup.dump /mnt/www-backup

5.刪除快照
umount /mnt/www-backup
lvremove /dev/vg1/www-backup

6.重做www
umount /www
mkfs.ext4 /dev/vg1/www
mount /dev/vg1/www /www

7.恢復快照
cd /www
restore -rf /tmp/www-backup.dump
		

dd

# mount -o remount,ro /dev/VolGroup00/LogVol01
# lvcreate -L500M -s -n backup /dev/VolGroup00/LogVol01
# dd if=/dev/VolGroup00/backup of=/mnt/VolGroup01/LogVol01/
# mount -o remount,rw /dev/VolGroup00/LogVol01
# umount /mnt/VolGroup01/LogVol01
# lvremove /dev/VolGroup00/backup
		
comments powered by Disqus