raid1 array missing, gpt was corrupted on 1 disk..

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • raid1 array missing, gpt was corrupted on 1 disk..

      short version: I have broken both partition tables, mdadm --examine shows:
      root@geonas:~# mdadm --examine /dev/sda
      /dev/sda:
      MBR Magic : aa55
      Partition[0] : 3907029167 sectors at 1 (type ee)
      root@geonas:~# mdadm --examine /dev/sdb
      /dev/sdb:
      MBR Magic : aa55
      Partition[0] : 3907029167 sectors at 1 (type ee)

      any option I can regenerate it? from openmediavault logs maybe? Or via some scanning option?


      whole story, if anyone is patient enough:

      # at this point I had /dev/md127 with /dev/sdb running.

      root@geonas:~# cat /proc/mdstat
      Personalities : [raid1]
      md127 : active raid1 sdb[1]
      1953383488 blocks super 1.2 [2/1] [_U]
      bitmap: 15/15 pages [60KB], 65536KB chunk

      unused devices: <none>

      #/dev/sda was separated and when using gdisk showing errors regarding partition table:

      root@geonas:~# gdisk /dev/sda
      GPT fdisk (gdisk) version 0.8.10

      Caution! After loading partitions, the CRC doesn't check out!
      Warning! Main partition table CRC mismatch! Loaded backup partition table
      instead of main partition table!

      Warning! One or more CRCs don't match. You should repair the disk!

      Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: damaged


      While /dev/sdb (correctly attached to raid) was showing:

      root@geonas:~# gdisk /dev/sdb
      GPT fdisk (gdisk) version 0.8.10

      Partition table scan:
      MBR: not present
      BSD: not present
      APM: not present
      GPT: not present

      Creating new GPT entries.

      Command (? for help):

      additional info from fdisk -l:

      root@geonas:~# fdisk -l /dev/sdb

      Disk /dev/sdb: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 4096 bytes
      I/O size (minimum/optimal): 4096 bytes / 4096 bytes

      root@geonas:~# fdisk -l /dev/sda

      Disk /dev/sda: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 4096 bytes
      I/O size (minimum/optimal): 4096 bytes / 4096 bytes
      Disklabel type: gpt
      Disk identifier: E53B2EDE-21D3-4B37-8911-833B491F7D46

      Device Start End Sectors Size Type
      /dev/sda1 2048 3907029134 3907027087 1,8T Linux filesystem

      #in the meantime fdisk -l changed to:

      root@geonas:~# fdisk -l /dev/sda
      The primary GPT table is corrupt, but the backup appears OK, so that will be used.

      Disk /dev/sda: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 4096 bytes
      I/O size (minimum/optimal): 4096 bytes / 4096 bytes
      Disklabel type: gpt
      Disk identifier: E53B2EDE-21D3-4B37-8911-833B491F7D46

      Device Start End Sectors Size Type
      /dev/sda1 2048 3907029134 3907027087 1,8T Linux filesystem

      root@geonas:~# fdisk -l /dev/sdb

      Disk /dev/sdb: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 4096 bytes
      I/O size (minimum/optimal): 4096 bytes / 4096 bytes


      I did:
      root@geonas:~# sgdisk /dev/sdb -R /dev/sda
      # shutdown, forgot to regenerate UUIDS
      root@geonas:~# sgdisk -G /dev/sda
      The operation has completed successfully.
      # here I wanted to run gdisk to see if it still shows errors..
      root@geonas:~# sgdisk /dev/sdb
      Creating new GPT entries.
      # freaked out that I messed with entries, so tried to recreate them from sda
      root@geonas:~# sgdisk /dev/sda -R /dev/sdb
      The operation has completed successfully.
    • I panicked unnecessary. After cloning disk (just to be safe) and running mdadm create:
      root@geonas:~# mdadm --create /dev/md127 --level=1 --raid-devices=2 missing /dev/sdb
      mdadm: /dev/sdb appears to be part of a raid array:
      level=raid0 devices=0 ctime=Thu Jan 1 01:00:00 1970
      mdadm: partition table exists on /dev/sdb but will be lost or
      meaningless after creating array
      mdadm: Note: this array has metadata at the start and
      may not be suitable as a boot device. If you plan to
      store '/boot' on this device please ensure that
      your boot-loader understands md/v1.x metadata, or use
      --metadata=0.90

      works just fine. :)