如何从 mdadm raid 1 HDD 恢复 XenServer 虚拟机

如何从 mdadm raid 1 HDD 恢复 XenServer 虚拟机

我有一台较旧的服务器,即 Fujitsu Siemens Primergy TX 150 S6,我在其上安装了 XenServer 6.5.0-90233c。

在其上我有多个不同大小的虚拟机,我需要恢复一些数据。

我已经将 XenServer 安装在直接插入主板的 USB 设备上,我使用两个 1T HDD 组成 Raid 1使用mdadm简写(存储库)。

为了在启动时组装阵列,我在我的rc.local文件中使用这些命令:

modprobe md_mod
mdadm --assemble --verbose /dev/md1 /dev/sdb /dev/sdc

今天我遇到了一个问题,我正在做一些维护,因为它至少有几个安装时间并且它不会关闭,所以我按下电源按钮强制关闭它。

在重新启动服务器时,我注意到在将内核传输到内存后,服务器进入了循环重新启动。

我拿了另一个装有 Xen 的 USB 棒并插入。系统启动正常,现在在组装阵列后,我错误地写了命令xe sr-create ... ,因此重新创建了一个空的简写

现在使用这里当然是使用/etc/lvm/backup/file原始 USB 并使用命令组装阵列mdadm --assemble --scan- 因为现在我已经取出硬盘以便安全保存,而且这是我发现的唯一可以组装阵列的方法 - 我最终得到以下结果:

fdisk -l

Disk /dev/sda: 15.7 GB, 15728640000 bytes
256 heads, 63 sectors/track, 1904 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1905    15359999+  ee  EFI GPT

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121601   976760001   83  Linux

Disk /dev/md127: 1000.0 GB, 1000067825664 bytes
2 heads, 4 sectors/track, 244157184 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md127 doesn't contain a valid partition table

lvscan

  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/MGT' [4.00 MB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-8d2d5e42-1327-4e9f-9d22-3ede3f0c6c05' [2.28 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-4fdddb5e-1161-4b6e-9545-430ed6ed915f' [8.02 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-b4614124-f4ea-466e-a598-111507ccf971' [80.16 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-9aad79b1-e54d-4d27-b9ea-84f8982ffa1d' [8.02 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-41d723fc-b805-4abb-89ce-a17aedfcf9f1' [100.20 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-830ce97a-8633-495c-898d-eb130351f66c' [100.20 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-19123cb8-cc2d-4fde-bca1-ee53c9c81c11' [8.02 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-5596a2ce-0ea7-4742-b172-78a677bed423' [100.20 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-59cedc2b-6f96-4d4e-a7d1-ccd152eeb9f0' [8.02 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-cb7650cc-9702-44f7-967e-18da0c5b87b7' [50.11 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-d7a1a2a2-e466-4fb7-bacc-edcd7660665a' [256.00 MB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-a4ce27ac-ffc1-496e-a415-878cd91d83e0' [10.03 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-00f4c83e-03de-4f47-876e-3f25790fce91' [10.03 GB] inherit
  inactive          '/dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-d5dc7799-4849-4ae4-aa2e-3aa9a4a6f13d' [200.40 GB] inherit
  ACTIVE            '/dev/XSLocalEXT-72ae6106-a518-3a75-71e2-73d33fc2e931/72ae6106-a518-3a75-71e2-73d33fc2e931' [6.64 GB] inherit

我可以通过使用来激活它们lvchange -a y <path to lv>

lv显示器

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/MGT
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                SMGgs5-hR1n-bniH-Rz3t-VIK4-GbTY-fkLsut
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                4.00 MB
  Current LE             1
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-8d2d5e42-1327-4e9f-9d22-3ede3f0c6c05
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                BuLGEF-ASSz-51Ud-6y7h-as4t-bjIF-hOLC1R
  LV Write Access        read only
  LV Status              NOT available
  LV Size                2.28 GB
  Current LE             583
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-4fdddb5e-1161-4b6e-9545-430ed6ed915f
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                To0vZA-1uQ9-IY2W-Bd52-pyAQ-lq9J-PLRGQj
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                8.02 GB
  Current LE             2054
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-b4614124-f4ea-466e-a598-111507ccf971
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                fv0r3c-ElRb-bBwP-EFer-WKnT-pzPx-uNtvfA
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                80.16 GB
  Current LE             20522
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-9aad79b1-e54d-4d27-b9ea-84f8982ffa1d
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                cVu0T4-xHWP-9QIr-WY3p-7Cri-6Z8d-cRjh37
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                8.02 GB
  Current LE             2054
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-41d723fc-b805-4abb-89ce-a17aedfcf9f1
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                qYQ4kl-oAZA-NMP8-QcNT-AtRG-FOkg-mSUJmn
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                100.20 GB
  Current LE             25652
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-830ce97a-8633-495c-898d-eb130351f66c
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                8l9w3j-gp7z-nPZs-ed45-a32Y-rmSR-gYWI4A
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                100.20 GB
  Current LE             25652
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-19123cb8-cc2d-4fde-bca1-ee53c9c81c11
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                E54dY6-n8Jl-KccN-elum-dcwf-ABeJ-Wfs8BK
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                8.02 GB
  Current LE             2054
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-5596a2ce-0ea7-4742-b172-78a677bed423
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                Ug2dke-h04E-8WTd-b37v-oSDd-sRst-9LqdcC
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                100.20 GB
  Current LE             25652
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-59cedc2b-6f96-4d4e-a7d1-ccd152eeb9f0
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                X0P4Eq-I9oo-xl0U-sc2G-2S8f-1UB9-ZLijgq
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                8.02 GB
  Current LE             2054
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-cb7650cc-9702-44f7-967e-18da0c5b87b7
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                5kgOE0-zcsQ-JQKi-6sAi-ytE7-SJfv-l71hIX
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                50.11 GB
  Current LE             12827
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-d7a1a2a2-e466-4fb7-bacc-edcd7660665a
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                UI17NG-V5RK-FPgr-suaq-TCOk-pMC7-NQdQiS
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                256.00 MB
  Current LE             64
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-a4ce27ac-ffc1-496e-a415-878cd91d83e0
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                aI8jMD-gucv-VH2L-sbGv-11Px-Rjwd-rQcpfc
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                10.03 GB
  Current LE             2567
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-00f4c83e-03de-4f47-876e-3f25790fce91
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                05Lvub-73EW-1re5-Zjay-5WRd-8I1q-2B5Yq6
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                10.03 GB
  Current LE             2567
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324/VHD-d5dc7799-4849-4ae4-aa2e-3aa9a4a6f13d
  VG Name                VG_XenStorage-eca2a6f4-ad2f-3205-3ddd-39232f91f324
  LV UUID                cbyeON-iK4x-sRKB-vxop-7klU-DfLK-4I9NlW
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                200.40 GB
  Current LE             51302
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

  --- Logical volume ---
  LV Name                /dev/XSLocalEXT-72ae6106-a518-3a75-71e2-73d33fc2e931/72ae6106-a518-3a75-71e2-73d33fc2e931
  VG Name                XSLocalEXT-72ae6106-a518-3a75-71e2-73d33fc2e931
  LV UUID                V0xnx6-Ggz6-uqbX-NSvC-IKtF-Vttc-0ZOc0E
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                6.64 GB
  Current LE             1699
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

现在,如果我到目前为止所做的是正确的,我不知道如何附加简写在我的情况下或手动安装lv的。挂载不起作用,因为它说它没有文件系统 - 实际上它说我需要指定文件系统 - 但我明白这是因为它们实际上是 xen虚拟机,并附加简写我找不到任何可行的方法,我找到的所有方法都已过时。

编辑:现在我处于不同的阶段:

  • 我已经删除了旧的、不必要的/损坏的SR就像提到的这里
  • 我已按照以下说明将包含我的虚拟机的 SR 添加到 xen这里

结果是,我可以看到存储虚拟机在 xencenter 中 -图片- 但当连接到正常运行的虚拟机时,我发现有两个问题,一个与设备路径有关图片fdisk -l第二个是关于内部的输出虚拟机

Disk /dev/xvda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders, total 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d3bb2

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1            2048      499711      248832   83  Linux
/dev/xvda2          501758    31455231    15476737    5  Extended
/dev/xvda5          501760    31455231    15476736   8e  Linux LVM

Disk /dev/mapper/giumbai--vg-root: 12.5 GB, 12452888576 bytes
255 heads, 63 sectors/track, 1513 cylinders, total 24322048 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/giumbai--vg-root doesn't contain a valid partition table

Disk /dev/mapper/giumbai--vg-swap_1: 3342 MB, 3342860288 bytes
255 heads, 63 sectors/track, 406 cylinders, total 6529024 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/giumbai--vg-swap_1 doesn't contain a valid partition table

我的新问题是,我真的可以恢复我的数据吗?还是我应该忘掉它?

另外,如果我尝试在 xen 中手动安装存储,请按照例如我得到Required parameter not found: device,因为没有指定设备:

列表

uuid ( RO)             : 835c791f-79b5-e6c2-738b-dbba04689325
          vm-uuid ( RO): ef376a47-e477-ba06-41fd-b892ffe50b4f
    vm-name-label ( RO): Ubuntu Trusty Tahr 14.04 (1)
         vdi-uuid ( RO): d5dc7799-4849-4ae4-aa2e-3aa9a4a6f13d
            empty ( RO): false
           device ( RO): 


uuid ( RO)             : b0b14f6c-0aa4-8ac3-83c2-6e848f4ec5c3
          vm-uuid ( RO): ef376a47-e477-ba06-41fd-b892ffe50b4f
    vm-name-label ( RO): Ubuntu Trusty Tahr 14.04 (1)
         vdi-uuid ( RO): 830ce97a-8633-495c-898d-eb130351f66c
            empty ( RO): false
           device ( RO): 


uuid ( RO)             : f2bcdd13-219d-075d-4a23-1552a70f6b6a
          vm-uuid ( RO): ef376a47-e477-ba06-41fd-b892ffe50b4f
    vm-name-label ( RO): Ubuntu Trusty Tahr 14.04 (1)
         vdi-uuid ( RO): 96e23a4c-5786-444b-bb0c-34c604097c85
            empty ( RO): false
           device ( RO): xvda


uuid ( RO)             : e08ee76a-d374-2f0d-4a21-b4d1352391f2
          vm-uuid ( RO): ef376a47-e477-ba06-41fd-b892ffe50b4f
    vm-name-label ( RO): Ubuntu Trusty Tahr 14.04 (1)
         vdi-uuid ( RO): 8c56153b-d64a-4e96-82c9-f492792a190e
            empty ( RO): false
           device ( RO): xvdd

为什么?我该如何修复它?

相关内容