Score:2

Transferring RAID1 to a new motherboard after HDD failure, and no "Superblock" found

tr flag

First an OS SDD failure followed by a mobo failure, new mobo/cpu/ram later, and I have a RAID1 with a single working disk, and I am trying to get it remounted so that I can add in a new replacement disk.

But to do that I need to assemble it using mdadm.... but mdadm is reporting superblock isn't working. (btw I'm not a programmer or sysadmin, just a hobbyist and I have no clue what most of this stuff means really)

Here's what my mdadm.conf says:


# mdadm.conf
#
# !NB! Run update-initramfs -u after updating this file.
# !NB! This will ensure that initramfs has an uptodate copy.
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
MAILADDR root
# definitions of existing MD arrays
ARRAY /dev/md/0  metadata=1.2 UUID=1a544a98:559ba1df:81b67841:7640bf5d name=lovelace:0
# This configuration was auto-generated on Sat, 21 Jan 2023 18:40:25 -0600 by mkconf

Following this advice here I decided to run the following commands with the following outputs:

┌─      ~                                               
└─➤ mdadm --assemble --scan --verbose /dev/md0 /dev/sdb
mdadm: must be super-user to perform this action
┌─      ~                                                
└─➤ sudo !!
sudo mdadm --assemble --scan --verbose /dev/md0 /dev/sdb
[sudo] password for aslan:
mdadm: looking for devices for /dev/md0
mdadm: No super block found on /dev/loop16 (Expected magic a92b4efc, got b94e0a62)
mdadm: no RAID superblock on /dev/loop16
mdadm: No super block found on /dev/loop15 (Expected magic a92b4efc, got 89924e23)
mdadm: no RAID superblock on /dev/loop15
mdadm: No super block found on /dev/loop14 (Expected magic a92b4efc, got 89ab2deb)
mdadm: no RAID superblock on /dev/loop14
mdadm: No super block found on /dev/loop13 (Expected magic a92b4efc, got 3e22646e)
mdadm: no RAID superblock on /dev/loop13
mdadm: No super block found on /dev/loop12 (Expected magic a92b4efc, got 3e22646e)
mdadm: no RAID superblock on /dev/loop12
mdadm: No super block found on /dev/loop10 (Expected magic a92b4efc, got 08e76eab)
mdadm: no RAID superblock on /dev/loop10
mdadm: No super block found on /dev/loop11 (Expected magic a92b4efc, got 448ff4ed)
mdadm: no RAID superblock on /dev/loop11
mdadm: No super block found on /dev/loop9 (Expected magic a92b4efc, got 6042ae44)
mdadm: no RAID superblock on /dev/loop9
mdadm: No super block found on /dev/loop8 (Expected magic a92b4efc, got 6405001a)
mdadm: no RAID superblock on /dev/loop8
mdadm: /dev/sdb is busy - skipping
mdadm: No super block found on /dev/sda (Expected magic a92b4efc, got 000005d3)
mdadm: no RAID superblock on /dev/sda
mdadm: No super block found on /dev/nvme0n1p2 (Expected magic a92b4efc, got 00000476)
mdadm: no RAID superblock on /dev/nvme0n1p2
mdadm: No super block found on /dev/nvme0n1p1 (Expected magic a92b4efc, got 00000000)
mdadm: no RAID superblock on /dev/nvme0n1p1
mdadm: No super block found on /dev/nvme0n1 (Expected magic a92b4efc, got 00000000)
mdadm: no RAID superblock on /dev/nvme0n1
mdadm: No super block found on /dev/loop7 (Expected magic a92b4efc, got 6405001a)
mdadm: no RAID superblock on /dev/loop7
mdadm: No super block found on /dev/loop6 (Expected magic a92b4efc, got c4b43b1a)
mdadm: no RAID superblock on /dev/loop6
mdadm: No super block found on /dev/loop5 (Expected magic a92b4efc, got c4b43b1a)
mdadm: no RAID superblock on /dev/loop5
mdadm: No super block found on /dev/loop4 (Expected magic a92b4efc, got 3a23b8f9)
mdadm: no RAID superblock on /dev/loop4
mdadm: No super block found on /dev/loop3 (Expected magic a92b4efc, got 3a23b8f9)
mdadm: no RAID superblock on /dev/loop3
mdadm: No super block found on /dev/loop2 (Expected magic a92b4efc, got 764c0e15)
mdadm: no RAID superblock on /dev/loop2
mdadm: No super block found on /dev/loop1 (Expected magic a92b4efc, got 764c0e15)
mdadm: no RAID superblock on /dev/loop1
mdadm: /dev/loop0 is too small for md: size is 8 sectors.
mdadm: no RAID superblock on /dev/loop0
mdadm: /dev/sdb not identified in config file.

The lsblk readout:

┌─      ~                                                 
└─➤ lsblk
NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0
       7:0    0     4K  1 loop /snap/bare/5
loop1
       7:1    0  55.6M  1 loop /snap/core18/2667
loop2
       7:2    0  55.6M  1 loop /snap/core18/2679
loop3
       7:3    0    62M  1 loop /snap/core20/1587
loop4
       7:4    0  63.3M  1 loop /snap/core20/1778
loop5
       7:5    0 238.7M  1 loop /snap/firefox/2277
loop6
       7:6    0 239.1M  1 loop /snap/firefox/2311
loop7
       7:7    0 400.8M  1 loop /snap/gnome-3-38-2004/112
loop8
       7:8    0 346.3M  1 loop /snap/gnome-3-38-2004/119
loop9
       7:9    0  91.7M  1 loop /snap/gtk-common-themes/1535
loop10
       7:10   0 263.8M  1 loop /snap/nextcloud/33054
loop11
       7:11   0 265.6M  1 loop /snap/nextcloud/33493
loop12
       7:12   0  45.9M  1 loop /snap/snap-store/582
loop13
       7:13   0  45.9M  1 loop /snap/snap-store/638
loop14
       7:14   0  49.8M  1 loop /snap/snapd/17950
loop15
       7:15   0   284K  1 loop /snap/snapd-desktop-integration/14
loop16
       7:16   0   304K  1 loop /snap/snapd-desktop-integration/49
sda    8:0    0   3.6T  0 disk /media/aslan/archive1
sdb    8:16   0   2.7T  0 disk 
└─md0
       9:0    0     0B  0 md   
nvme0n1
     259:0    0 931.5G  0 disk 
├─nvme0n1p1
│    259:1    0   512M  0 part /boot/efi
└─nvme0n1p2
     259:2    0   931G  0 part /var/snap/firefox/common/host-hunspell 

blkdid output:

┌─      ~                                                 
└─➤ blkid
/dev/nvme0n1p1: UUID="A220-90FF" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="0c5cbefa-f89b-4a6b-9fb3-af849a49a342"
/dev/nvme0n1p2: UUID="e1011499-b5df-4a86-b6ba-0ce0aa1df65b" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d370bb37-a2eb-4b1b-991b-22cc25cf2a48"
/dev/sdb: UUID="1a544a98-559b-a1df-81b6-78417640bf5d" UUID_SUB="6aa3c8b4-fd85-548f-629b-1207ce00114b" LABEL="lovelace:0" TYPE="linux_raid_member"
/dev/sda: LABEL="archive1" UUID="64e34e9d-427c-4ece-bf97-6e1475229e2e" BLOCK_SIZE="4096" TYPE="ext4"

EDIT: I made a copy of the drive, and tried to run fsck to fix the new drive and got the following:

sudo fsck.ext4 -v /dev/md0
[sudo] password for aslan: 
e2fsck 1.46.5 (30-Dec-2021)
fsck.ext4: Invalid argument while trying to open /dev/md0

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Adding mdadm details:

┌─      ~                                                                                                                        
└─➤ sudo !!
sudo mdadm --detail /dev/md0
/dev/md0:
           Version : 1.2
        Raid Level : raid1
     Total Devices : 1
       Persistence : Superblock is persistent

             State : inactive
   Working Devices : 1

              Name : lovelace:0  (local to host lovelace)
              UUID : 1a544a98:559ba1df:81b67841:7640bf5d
            Events : 4286

    Number   Major   Minor   RaidDevice

       -       8        0        -        /dev/sda
sudo mdadm --examine /dev/sda
/dev/sda:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 1a544a98:559ba1df:81b67841:7640bf5d
           Name : lovelace:0  (local to host lovelace)
  Creation Time : Tue Jul 31 13:49:48 2018
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 5860268976 sectors (2.73 TiB 3.00 TB)
     Array Size : 2930134464 KiB (2.73 TiB 3.00 TB)
  Used Dev Size : 5860268928 sectors (2.73 TiB 3.00 TB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=1953504048 sectors
          State : clean
    Device UUID : 6aa3c8b4:fd85548f:629b1207:ce00114b

Internal Bitmap : 8 sectors from superblock
    Update Time : Sun Nov  6 21:19:33 2022
  Bad Block Log : 512 entries available at offset 24 sectors
       Checksum : 9ad9915f - correct
         Events : 4286


   Device Role : Active device 0
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)

Nikita Kipriyanov avatar
za flag
Please show `lsblk` and `blkid` with the survived component device attached (while boot from network or liveusb or livecd). I expect to see where the superblock could be. Notice that metadata version 1.2 means RAID superblock should be in the beginning of the component device.
shodanshok avatar
ca flag
Your RAID is a `md` one (created with `mdadm`) or a motherboard BIOS RAID (ie: BIOS fakeraid)?
David A. French avatar
tr flag
@shodanshok the RAID1 is md0, and was created with mdadm.
David A. French avatar
tr flag
@NikitaKipriyanov I will try that and update my question. Worth noting that I don't need boot from network or liveusb because I've already set up a new mobo with a full installation of Ubuntu 22.0.4
David A. French avatar
tr flag
Okay I've added more information. thank ya'll for the assistance.
Nikita Kipriyanov avatar
za flag
Well, `sdb` looks like a RAID member. What's `mdadm --examine /dev/sdb` and `mdadm --detail /dev/md0`? (Is it thinking it's a spare?)
David A. French avatar
tr flag
@NikitaKipriyanov Thank you. I have added the mdadm details to the post. I also made a copy of the disk to a new disk, and have unplugged the original disk, so as to not further damage it. I made a byte clone using dd as per a friends suggestion. The mdadm command seems to confirm the same issues with the superblock on the new drive.
Nikita Kipriyanov avatar
za flag
Well (the device changed name to sda I guess), the *RAID* superblock seems to be fine. Note that it is not the same as *filesystem* superblock. So I/O operations against /dev/md0 should succeed. However, since this is RAID1, you can stop an array with `mdadm --stop /dev/md0` and then access the data (filesystem) on in by mapping some loop device with the offset defined in the superblock: `losetup /dev/loop15 -r --offset 264192 /dev/sda`, then examine this loop device for a valid file system. `-r` will make it read only so don't try to fix but use this just to examine.
David A. French avatar
tr flag
@NikitaKipriyanov Stopped the array, and tried running the losetup command and got the following response "losetup: /dev/sda: failed to set up loop device: Device or resource busy". I tried running the command again but with /dev/loop17 and it did nothing, no response in console. When I look at the disk utility I now see a 4TB Loop Device, but don't know what to do with it. I can't open it in Nautilus or anything like that.
David A. French avatar
tr flag
I continued troubleshooting with chatgpt, created a dir to mount the loop device to, and when I tried to mount it said "mount: /mnt/temp: wrong fs type, bad option, bad superblock on /dev/loop18, missing codepage or helper program, or other error."
David A. French avatar
tr flag
It's working now! did some more troubleshooting and chatgpt managed to guide me the rest of the way :) woah!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.