I have a disk that used to be inside my qnap NAS (it was in raid1 with another disk, which I still have). The NAS died and I mounted the disk on my ubuntu machine using mdadm
to create the raid array and then followed this to successfully mount and read it.
Then I shut down the laptop and when I turned it back on I couldn't mount anything (mdadm was returning errors saying devices were busy). I tried a bunch of stuff (rebooting as well) but couldn't mount it back.
Out of frustration I had the bad idea to run mdadm --zero-superblock
on every partition of the disk and added more troubles as I am now unable to do anything (except insulting myself).
lsblk
returns this:
sdc 8:32 0 2,7T 0 disk
├─sdc1 8:33 0 517,7M 0 part
│ └─md11 9:11 0 516,7M 0 raid1
├─sdc2 8:34 0 517,7M 0 part
│ └─md12 9:12 0 516,7M 0 raid1
├─sdc3 8:35 0 2,7T 0 part
├─sdc4 8:36 0 517,7M 0 part /media/myuser/2ed9e1b2-2659-4202-9066-bd3246353f1d
└─sdc5 8:37 0 8G 0 part
└─md15 9:15 0 8G 0 raid1
md13 9:13 0 0B 0 md
The disk has indeed 5 partitions and I need to access /dev/sdc3
. To my surprise, Ubuntu is able to mount /dev/sdc4
without even asking.
When I run lvm fullreport
I get:
lvm fullreport
WARNING: wrong checksum 0 in mda header on /dev/sdc3 at 4096
WARNING: wrong magic number in mda header on /dev/sdc3 at 4096
WARNING: wrong version 0 in mda header on /dev/sdc3 at 4096
WARNING: wrong start sector 0 in mda header on /dev/sdc3 at 4096
WARNING: bad metadata header on /dev/sdc3 at 4096.
WARNING: scanning /dev/sdc3 mda1 failed to read metadata summary.
WARNING: repair VG metadata on /dev/sdc3 with vgck --updatemetadata.
WARNING: scan failed to get metadata summary from /dev/sdc3 PVID A0oBICVnS2UPgax0Y8H2F5lgP2L3Xa3D
Fmt PV UUID DevSize PV Maj Min PMdaFree PMdaSize PExtVsn 1st PE PSize PFree Used Attr Allocatable Exported Missing PE Alloc PV Tags #PMda #PMdaUse BA Start BA Size PInUse Duplicate
lvm2 A0oBIC-VnS2-UPga-x0Y8-H2F5-lgP2-L3Xa3D <2,72t /dev/sdc3 8 35 0 0 1 1,00m <2,72t <2,72t 0 --- 0 0 0 0 0 0
Start SSize PV UUID LV UUID
0 0 A0oBIC-VnS2-UPga-x0Y8-H2F5-lgP2-L3Xa3D
I have some things in /etc/lvm
that seem backups, but I messed up enough already and I don't want to do more damage.
Searching in this and other forums I tried many things, most notably
mdadm --create --assume-clean /dev/md0 --level=1 --raid-devices=2 /dev/sdc3 missing
but then if I try to mount the /dev/md0
I get
mount: /mnt/1: wrong fs type, bad option, bad superblock on /dev/md0, missing codepage or helper program, or other error.
and lvm fullreport
doesn't give any outputs.
Any help would be highly appreciated, I have the other raid disk that should contain the same info but before I mess that up as well I'd like to see if I can recover this one.
EDIT 1
Output of blkid
:
/dev/sdc: PTUUID="170dad0b-6e63-4bbc-835e-9c7e901e3d4d" PTTYPE="gpt"
/dev/sdc2: UUID="2d0918c5-2ae2-6736-cb3a-9dfb2f014dc0" UUID_SUB="7b071e98-21b9-2459-7b3d-232247796426" LABEL="home-x1-carbon:12" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="61b68a0d-0ebc-4379-9d8e-9694a0edc09d"
/dev/sdc5: UUID="2d279112-312e-1a89-d597-da4cc01c2a92" UUID_SUB="72243364-539b-6614-53c2-374e28a6a4e7" LABEL="home-x1-carbon:15" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="29af1fc5-57ab-4da4-ac38-d3d9955072b5"
/dev/sdc3: UUID="01f77d36-7ed1-f4be-6948-820e41b0956a" UUID_SUB="c78c6ff9-63bb-002f-93a4-c901bdb14307" LABEL="home-x1-carbon:0" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="4feebb7b-0a90-490c-a516-3fdca113592f"
/dev/sdc1: UUID="4a443aca-7fbe-197c-0bcb-72ec6c0c3ce0" UUID_SUB="55bf9203-a7ca-a8a3-4cdb-5cef7f12e54f" LABEL="home-x1-carbon:11" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="22efde15-2e64-4cf5-b220-21ee5c57aed2"
/dev/sdc4: UUID="2ed9e1b2-2659-4202-9066-bd3246353f1d" BLOCK_SIZE="4096" TYPE="ext3" PARTLABEL="primary" PARTUUID="d5ae2202-0f7b-4c30-b7c3-f9d84de4b14e"
blkid /dev/md0
is empty.
EDIT 2
After trying this:
# mdadm --create --assume-clean /dev/md0 --level=1 --raid-devices=2 /dev/sdc3 missing
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
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
lsblk
now shows /dev/md0
:
sdc 8:32 0 2,7T 0 disk
├─sdc1 8:33 0 517,7M 0 part
│ └─md11 9:11 0 516,7M 0 raid1
├─sdc2 8:34 0 517,7M 0 part
│ └─md12 9:12 0 516,7M 0 raid1
├─sdc3 8:35 0 2,7T 0 part
│ └─md0 9:0 0 2,7T 0 raid1
├─sdc4 8:36 0 517,7M 0 part /media/dani/2ed9e1b2-2659-4202-9066-bd3246353f1d
└─sdc5 8:37 0 8G 0 part
└─md15 9:15 0 8G 0 raid1
md13 9:13 0 0B 0 md
but I still cannot mount it:
# mount /dev/md0 /mnt/1
mount: /mnt/1: wrong fs type, bad option, bad superblock on /dev/md0, missing codepage or helper program, or other error.
blkid
? At least on allsdc
partitions. - What is the output ofblkid
on/dev/md0
? Thanks.mdadm --create --assume-clean /dev/md0 --level=1 --raid-devices=2 /dev/sdc3 missing
(without error) ? - You are able to mount the/dev/sdc4
because it's anext3
partition, not amd
device./dev/md0
in thelsblk
output ? - If no, it's normal you are not able to mount it. - Themdadm --zero-superblock
command removes the metadata that describes the raid array, you should always have the data themself.