手工备份Xen HVM VPS
ssh登录服务器
运行 lvscan 扫描LV存储
1 2 3 4 5 6 7 8 9 |
[root@vs09 /]# lvscan ACTIVE '/dev/vol/vm324_img' [20.00 GB] inherit ACTIVE '/dev/vol/vm326_img' [25.00 GB] inherit ACTIVE '/dev/vol/vm328_img' [20.00 GB] inherit ACTIVE '/dev/vol/vm329_img' [20.00 GB] inherit ACTIVE '/dev/vol/vm332_img' [20.00 GB] inherit ACTIVE '/dev/vol/vm333_img' [20.00 GB] inherit ACTIVE '/dev/vol/vm336_img' [20.00 GB] inherit ACTIVE '/dev/vol/vm337_img' [20.00 GB] inherit |
建立Snapshot/快照
1 2 3 |
[root@vs09 /]# lvcreate -s -L 10G -n vm324_img-snap /dev/vol/vm324_img Logical volume "vm324_img-snap" created |
参数意思
-s = 快照模式
-L *G/M = 快照大小
-n xxx = 快照名称
/dev/vol/vm324_img 原镜像
重建分区表 (如果不需要挂载检查数据 不需要重建)
1 2 |
kpartx -av /dev/vol/vm324_img-snap add map vm324_img-snap1 : 0 62910477 linear /dev/vol/vm324_img-snap 63 |
挂载NTFS文件系统 获得硬盘数据
1 2 3 4 |
mount -t ntfs /dev/mapper/vm324_img-snap1 /mnt -o force The disk contains an unclean file system (0, 0). The file system wasn't safely closed on Windows. Fixing. |
可以查看数据
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[root@vs09 /]# ll /mnt total 2096889 -rwxrwxrwx 1 root root 0 Sep 6 17:41 AUTOEXEC.BAT -rwxrwxrwx 1 root root 208 Sep 6 18:18 boot.ini -rwxrwxrwx 1 root root 0 Sep 6 17:41 CONFIG.SYS drwxrwxrwx 1 root root 4096 Sep 6 19:26 Documents and Settings drwxrwxrwx 1 root root 1294336 Sep 6 21:57 I386 -rwxrwxrwx 1 root root 0 Sep 6 17:41 IO.SYS -rwxrwxrwx 1 root root 0 Sep 6 17:41 MSDOS.SYS -rwxrwxrwx 1 root root 94720 Feb 17 2007 msizap.exe -rwxrwxrwx 1 root root 47772 Mar 22 2006 NTDETECT.COM -rwxrwxrwx 1 root root 297072 Sep 6 21:02 ntldr -rwxrwxrwx 1 root root 2145386496 Oct 5 16:29 pagefile.sys drwxrwxrwx 1 root root 4096 Sep 7 00:55 Program Files drwxrwxrwx 1 root root 0 Sep 6 19:25 System Volume Information drwxrwxrwx 1 root root 77824 Sep 6 17:08 WINDOWS drwxrwxrwx 1 root root 0 Sep 6 17:44 wmpub |
卸载挂载的设备
1 2 3 4 5 6 |
umount /mnt partx -d /dev/vol/vm324_img-snap lvremove /dev/vol/vm324_img-snap Do you really want to remove active logical volume vm324_img-snap? [y/n]: y 输入y Logical volume "vm324_img-snap" successfully removed |
即可完成
相关:
- quicklyly7