B
B
BoneFletcher2018-06-03 23:59:35
System administration
BoneFletcher, 2018-06-03 23:59:35

How to make mdadm raid1 on ubuntu 18 work after system reboot?

I build raid1 from two disks as described in the article:
https://www.digitalocean.com/community/tutorials/h...
I run the following commands:

$ sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb
дожидаюсь пока raid соберется
$ sudo mkfs.ext4 -F /dev/md0
$ sudo mkdir -p /mnt/md0
$ sudo mount /dev/md0 /mnt/md0
$ sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
$ sudo update-initramfs -u
$ echo '/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0' | sudo tee -a /etc/fstab

Then I go to /mnt/md0, create files there, everything works. But after a reboot, /mnt/md0 is not mounted, when trying to mount again:
$ sudo mount /dev/md0 /mnt/md0
mount: /mnt/md0: can't read superblock on /dev/md0.

The lsblk command shows that only the first disk is marked as linux_raid_member
$ lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
sda           3,7T linux_raid_member disk 
sdb           3,7T                   disk

$ cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : inactive sda[0](S)
      3906887512 blocks super 1.2
       
unused devices: <none>

What could be the reason? I repeated the above sequence of actions 2 times and both times the same result.
Ubuntu 18.04 LTS system
Mat. ASUS prime z370-a board (default BIOS settings)
Drives 2 x Western Digital WD Red 4 TB (WD40EFRX)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2018-06-04
@notwrite

Here according to this instruction, everything is assembled without problems. xgu.ru/wiki/mdadm

M
moropsk, 2018-06-04
@moropsk

For automatic mounting, it seems that you need to add:
Example
nano /etc/fstab
/dev/md1 /mnt/md1 ext4 defaults 0 0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question