1

I used to have a raid1 array on the mountpoint /mnt/md0, however I re-installed my OS and now I don't know how to re assemble it.

I believe I should be doing something along the lines of mdadm --assemble, but I don't know how to add this information into a configuration file which is persistent between reboots. (I don't recall the location of the config file either.)

I followed this information to create the array in the first place

https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-debian-9

but there is no info about how to create an array using existing disks.

Can someone point me in the right direction?

Update: I found this config file: /etc/mdadm/mdadm.conf

This is what it contains

# 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=(uuid here) name=(system name here):0

# This configuration was auto-generated on Fri, 19 Jun 2020 13:52:02 +0100 by mkconf
1

It was actually trivial.

The OS re-install (same version of debian 10) seemed to detect the RAID disks during the install. It indicated there were 2 disks which were in some kind of raid mode. I assume because it saw this it pulled the relevant packages from the web during the netinstall as well... Regardless...

sudo mdadm --assemble --scan

this is (I guess?) what populated the config file

This is also in my history, but probably not needed... sudo mdadm --assemble /dev/md0 ?

Then to mount (this is why I was confused)

sudo mount /dev/md0 /mnt/md0

No idea if this will be persistent between reboots? Probably not. I don't know what to put in /etc/fstab to accomplish this.

Edit: To mount at boot I followed this https://askubuntu.com/questions/540202/mount-an-mdadm-raid-1-drive-at-boot

/dev/md0    /mnt/md0    ext4    defaults    0   0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.