How to mount a disk that comes from a RAID 1
When connecting a disk from a RAID 1, the system will try to mount it automatically, but it will not succeed.
The error
You will find that by doing:
# mdadm --assemble --readonly /dev/md1 /dev/sdc1
This returns:
mdadm: Merging with already-assembled /dev/md/pataricu:0
mdadm: failed to add /dev/sdc1 to /dev/md/pataricu:0: Device or resource busy
mdadm: /dev/md/pataricu:0 assembled from 0 drives - need all 2 to start it (use --run to insist).
But when trying to mount it gives error:
# mount /dev/md1 /mnt/raid1
mount: /mnt/raid1: special device /dev/md0 does not exist.
Even using /dev/md/pataricu:0
gives an error:
# mount /dev/md/pataricu\:0 /mnt/raid1
mount: /mnt/raid1: can't read superblock on /dev/md127.
Also using /dev/dm127
:
# mount /dev/md127 /mnt/raid1
mount: /mnt/raid1: can't read superblock on /dev/md127.
The above mdadm
command did not mount the disk to /dev/md1
because it had already been auto-mounted to /dev/md127
and wrong. So undo:
# mdadm --stop /dev/md127
mdadm: stopped /dev/md127
Mount
Repeat the mdadm
command from the beginning:
# mdadm --assemble --readonly /dev/md1 /dev/sdc1
Remount the partition:
# mount /dev/md1 /mnt/raid1
And now it mounts correctly:
# mount | grep ^/dev/md1
/dev/md1 on /mnt/raid1 type ext4 (rw,relatime)
Unmount
Remember to unmount:
# umount /mnt/raid1
# mdadm --stop /dev/md1
Header image: freeimages.com/Staszkinse .