0%

How to mount a single hard disk that was part of RAID 1

I will share my experiences below on how I managed to mount a single hard disk that was part of RAID 1 and the issues I’ve encountered during the process.

First, do lsblk to prints all block devices.

1
2
3
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sde 8:64 0 4.5T 0 disk
└─sde1 8:65 0 4.5T 0 part

In this case, sde1 is what I was looking for.
I proceeded to run the following command:

1
$ mdadm --assemble --run /dev/md2 /dev/sde1

And encountered the following:

1
2
mdadm: Found some drive for an array that is already active: /dev/md/ubuntu:0
mdadm: giving up.

This is caused by mdadm complaining that you’re trying to assemble an array with a UUID matching one already running.
We can fix this by changing the UUID on the /dev/sde1 superblock when we assemble it.

To find the old UUID:

1
$ mdadm --examine /dev/sde1

Results

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/dev/sde1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x1
Array UUID : e1dc032e:d7d02935:71895af8:53eea165
Name : ubuntu:0
Creation Time : Tue Mar 30 18:23:45 2021
Raid Level : raid1
Raid Devices : 2

Avail Dev Size : 9767274496 (4657.40 GiB 5000.84 GB)
Array Size : 4883637248 (4657.40 GiB 5000.84 GB)
Data Offset : 264192 sectors
Super Offset : 8 sectors
Unused Space : before=264112 sectors, after=0 sectors
State : clean
Device UUID : cb083a67:de3131fa:ad29c9a8:7e44fbfb

Internal Bitmap : 8 sectors from superblock
Update Time : Wed Mar 17 17:36:14 2021
Bad Block Log : 512 entries available at offset 32 sectors
Checksum : 6854a473 - correct
Events : 64302


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

Finally, excute ths following command:

1
$ mdadm --assemble /dev/md11 --update=uuid --uuid=<newuuid> /dev/sde1

For me, I just changed the last character to a instead of b:

1
$ mdadm --assemble /dev/md11 --update=uuid --uuid=cb083a67:de3131fa:ad29c9a8:7e44fbfa /dev/sde1