[root@localhost ~]# fdisk -l Disk /dev/sda: 2000.3 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 522 4192933+ 83 Linux /dev/sda2 523 783 2096482+ 83 Linux /dev/sda3 784 243201 1947222585 8e Linux LVM WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. WARNING: The size of this disk is 2.6 TB (2576980377600 bytes). DOS partition table format can not be used on drives for volumes larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID partition table format (GPT). Disk /dev/sdb: 2576.9 GB, 2576980377600 bytes 255 heads, 63 sectors/track, 313300 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 267350 2147483647+ ee EFI GPT WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted. WARNING: The size of this disk is 2.6 TB (2576980377600 bytes). DOS partition table format can not be used on drives for volumes larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID partition table format (GPT). Disk /dev/sdc: 2576.9 GB, 2576980377600 bytes 255 heads, 63 sectors/track, 313300 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 267350 2147483647+ ee EFI GPT |
[root@localhost ~]# pvscan PV /dev/sda3 VG VG_XenStorage-04c0df5f-b878-9d62-5157-649b0ebc8980 lvm2 [1.81 TB / 1.81 TB free] Total: 1 [1.81 TB] / in use: 1 [1.81 TB] / in no VG: 0 [0 ] |
[root@localhost ~]# xe sr-list uuid ( RO) : ee931812-2d09-fd43-8b42-73fd4f512512 name-label ( RW): DVD drives name-description ( RW): Physical DVD drives host ( RO): XenServer58 type ( RO): udev content-type ( RO): iso uuid ( RO) : 04c0df5f-b878-9d62-5157-649b0ebc8980 name-label ( RW): Local storage name-description ( RW): host ( RO): localhost.localdomain type ( RO): lvm content-type ( RO): user uuid ( RO) : 9ba32798-7dc6-0b2b-8abc-645192a9203a name-label ( RW): 硬件 HBA èæç£çåå¨ name-description ( RW): 硬件 HBA SR [DELL - 2CC001B] host ( RO): type ( RO): lvmohba content-type ( RO): uuid ( RO) : 396812b6-e90b-0761-50a3-b08e57c19453 name-label ( RW): Local storage name-description ( RW): host ( RO): XenServer58 type ( RO): lvm content-type ( RO): user .... |
[root@localhost ~]# cd /etc/lvm/backup/ [root@localhost backup]# ls -l total 8 -rw------- 1 root root 1311 Jan 17 14:02 VG_XenStorage-04c0df5f-b878-9d62-5157-649b0ebc8980 -rw------- 1 root root 3454 Jan 17 14:02 VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a |
[root@localhost backup]# scp -r /etc/lvm/backup/ [email protected]:/root/lvm_backcup The authenticity of host '192.168.1.58 (192.168.1.58)' can't be established. RSA key fingerprint is 21:66:46:86:60:79:12:9a:23:f7:99:34:97:12:e7:a8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.1.58' (RSA) to the list of known hosts. [email protected]'s password: VG_XenStorage-04c0df5f-b878-9d62-5157-649b0ebc8980 100% 1311 1.3KB/s 00:00 VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a 100% 3454 3.4KB/s 00:00 |
[root@localhost ~]# fdisk /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. The number of cylinders for this disk is set to 313300. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) WARNING: The size of this disk is 2.6 TB (2576980377600 bytes). DOS partition table format can not be used on drives for volumes larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID partition table format (GPT). Command (m for help): d Selected partition 1 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@localhost ~]# fdisk -l Disk /dev/sda: 146.8 GB, 146815733760 bytes 255 heads, 63 sectors/track, 17849 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 522 4192933+ 83 Linux /dev/sda2 523 783 2096482+ 83 Linux /dev/sda3 784 17849 137082645 8e Linux LVM WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. WARNING: The size of this disk is 2.6 TB (2576980377600 bytes). DOS partition table format can not be used on drives for volumes larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID partition table format (GPT). Disk /dev/sdb: 2576.9 GB, 2576980377600 bytes 255 heads, 63 sectors/track, 313300 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted. WARNING: The size of this disk is 2.6 TB (2576980377600 bytes). DOS partition table format can not be used on drives for volumes larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID partition table format (GPT). Disk /dev/sdc: 2576.9 GB, 2576980377600 bytes 255 heads, 63 sectors/track, 313300 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System [root@localhost ~]# |
[root@localhost ~]# cd /root/lvm_backcup/ [root@localhost lvm_backcup]# ls -l total 8 -rw------- 1 root root 1311 Jan 16 16:13 VG_XenStorage-04c0df5f-b878-9d62-5157-649b0ebc8980 -rw------- 1 root root 3454 Jan 16 16:13 VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a [root@localhost lvm_backcup]# cat VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a | grep physical_volumes -A3 physical_volumes { pv0 { id = "wQbSMU-CAVF-8P1K-aruD-h8Ts-btVf-jdu0nM" |
[root@localhost lvm_backcup]# pvcreate --uuid "wQbSMU-CAVF-8P1K-aruD-h8Ts-btVf-jdu0nM" --restorefile /root/lvm_backcup/VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a /dev/sdb Couldn't find device with uuid wQbSMU-CAVF-8P1K-aruD-h8Ts-btVf-jdu0nM. Physical volume "/dev/sdb" successfully created [root@localhost lvm_backcup]# pvscan Found duplicate PV wQbSMUCAVF8P1KaruDh8TsbtVfjdu0nM: using /dev/sdc not /dev/sdb PV /dev/sda3 VG VG_XenStorage-396812b6-e90b-0761-50a3-b08e57c19453 lvm2 [130.72 GB / 130.71 GB free] PV /dev/sdc lvm2 [2.34 TB] Total: 2 [2.47 TB] / in use: 1 [130.72 GB] / in no VG: 1 [2.34 TB] |
[root@localhost lvm_backcup]# vgcfgrestore VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a --test -f /root/lvm_backcup/VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a Test mode: Metadata will NOT be updated and volumes will not be (de)activated. Found duplicate PV wQbSMUCAVF8P1KaruDh8TsbtVfjdu0nM: using /dev/sdc not /dev/sdb Restored volume group VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a |
[root@localhost lvm_backcup]# vgcfgrestore VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a -f /root/lvm_backcup/VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a
Found duplicate PV wQbSMUCAVF8P1KaruDh8TsbtVfjdu0nM: using /dev/sdc not /dev/sdb
Restored volume group VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a |
[root@localhost lvm_backcup]# pvscan
Found duplicate PV wQbSMUCAVF8P1KaruDh8TsbtVfjdu0nM: using /dev/sdc not /dev/sdb
PV /dev/sdc VG VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a lvm2 [2.34 TB / 2.26 TB free] PV /dev/sda3 VG VG_XenStorage-396812b6-e90b-0761-50a3-b08e57c19453 lvm2 [130.72 GB / 130.71 GB free] Total: 2 [2.47 TB] / in use: 2 [2.47 TB] / in no VG: 0 [0 ] [root@localhost lvm_backcup]# vgscan Reading all physical volumes. This may take a while... Found duplicate PV wQbSMUCAVF8P1KaruDh8TsbtVfjdu0nM: using /dev/sdc not /dev/sdb Found volume group "VG_XenStorage-9ba32798-7dc6-0b2b-8abc-645192a9203a" using metadata type lvm2 Found volume group "VG_XenStorage-396812b6-e90b-0761-50a3-b08e57c19453" using metadata type lvm2 |