mdadm raid 5 not automounting

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
Doctorbeefy
Posts: 17
Joined: Sun Sep 08, 2019 5:04 pm

mdadm raid 5 not automounting

Post by Doctorbeefy »

I just set up a software raid for the first time after I set it up I rebooted and noticed it doesn't automount. (fstab reverted as well)

I can remount the raid via the drive manager but every time on reboot it does not stay mounted. These are not external drives either.

Please let me know what sort of information you will need and I will gladly get it for you.

Below is what fstab shows after reboot.

Code: Select all

# Please use "dietpi-drive_manager" to setup mounts
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------


#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=11905M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAPFILE
#----------------------------------------------------------------


#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
UUID=2e9d8509-a765-48ba-ba71-4110f21ef219 / ext4 noatime,lazytime,rw 0 1
#UUID=9bdec8cd-8e95-f476-3158-9f8e68a06280 /mnt/9bdec8cd-8e95-f476-3158-9f8e68a06280 linux_raid_member noatime,lazytime,rw,nofail,noauto,x-systemd.automount
#UUID=9bdec8cd-8e95-f476-3158-9f8e68a06280 /mnt/9bdec8cd-8e95-f476-3158-9f8e68a06280 linux_raid_member noatime,lazytime,rw,nofail,noauto,x-systemd.automount
#UUID=9bdec8cd-8e95-f476-3158-9f8e68a06280 /mnt/9bdec8cd-8e95-f476-3158-9f8e68a06280 linux_raid_member noatime,lazytime,rw,nofail,noauto,x-systemd.automount
#UUID=9bdec8cd-8e95-f476-3158-9f8e68a06280 /mnt/9bdec8cd-8e95-f476-3158-9f8e68a06280 linux_raid_member noatime,lazytime,rw,nofail,noauto,x-systemd.automount
#UUID=847b2756-5e7d-464c-9dcf-954e644f1fe3 /mnt/847b2756-5e7d-464c-9dcf-954e644f1fe3 ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount

lsblk

Code: Select all

root@DietPi:/# lsblk
NAME      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda         8:0    0 111.8G  0 disk  
└─sda1      8:1    0 111.8G  0 part  /
sdb         8:16   0 931.5G  0 disk  
└─sdb1      8:17   0 931.5G  0 part  
  └─md127   9:127  0   2.7T  0 raid5 
sdc         8:32   0 931.5G  0 disk  
└─sdc1      8:33   0 931.5G  0 part  
  └─md127   9:127  0   2.7T  0 raid5 
sdd         8:48   0 931.5G  0 disk  
└─sdd1      8:49   0 931.5G  0 part  
  └─md127   9:127  0   2.7T  0 raid5 
sde         8:64   0 931.5G  0 disk  
└─sde1      8:65   0 931.5G  0 part  
  └─md127   9:127  0   2.7T  0 raid5 
EDIT: Actually it looks like they only auto mount when accessed?
User avatar
Joulinar
Posts: 3703
Joined: Sat Nov 16, 2019 12:49 am

Re: mdadm raid 5 not automounting

Post by Joulinar »

correct. the mount contain option x-systemd.automount. Means it is not mounted on reboot directly. It mounts as soon as someone is trying to access the directory.

I did a test on my VM and it's working well

Code: Select all

root@DietPiVM2:/mnt/raid# lsblk -o name,fstype,label,size,ro,type,mountpoint
NAME   FSTYPE            LABEL        SIZE RO TYPE  MOUNTPOINT
sda                                    10G  0 disk
└─sda1 ext4                            10G  0 part  /
sdb    linux_raid_member DietPiVM2:0   10G  0 disk
└─md0  ext4                            20G  0 raid5 /mnt/raid
sdc    linux_raid_member DietPiVM2:0   10G  0 disk
└─md0  ext4                            20G  0 raid5 /mnt/raid
sdd    linux_raid_member DietPiVM2:0   10G  0 disk
└─md0  ext4                            20G  0 raid5 /mnt/raid
sr0                                  1024M  0 rom
sr1                                  1024M  0 rom
root@DietPiVM2:/mnt/raid#

Code: Select all

root@DietPiVM2:/mnt/raid#  cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdd[3] sdc[1] sdb[0]
      20953088 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

unused devices: <none>
root@DietPiVM2:/mnt/raid#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Doctorbeefy
Posts: 17
Joined: Sun Sep 08, 2019 5:04 pm

Re: mdadm raid 5 not automounting

Post by Doctorbeefy »

Is there a way to make it automount on reboot?

It looks like plex kinda makes it work that way without forcing it to, seeing plex accesses the drive on launch.
User avatar
Joulinar
Posts: 3703
Joined: Sat Nov 16, 2019 12:49 am

Re: mdadm raid 5 not automounting

Post by Joulinar »

usually Plex should force the mount as soon as Plex is trying to access files on that device
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply