How i fixed the hang at boot and got my sata hat working with unionfs

disclaimer
i am a linux noob. there very well might be a far superior way to do this.
this is how i got mine working and not hanging at boot or emergency mode loop
raid 5 - i gave up
since this is just portable server and i have 2 other backups of all of my media i didnt care about losing data if a drive failed in it. so i used unionfs which is basically a drive pool. if a drive fails you only lose data on that drive, i think. correct me if i am wrong
use this at your own risk, it worked for me, if you break something i am not responsible <3

here is what i did step by step to get omv 5 working through reboots and shutdowns

login as pi

use these commands

sudo apt-get update

sudo apt-get upgrade

sudo curl -sL https://rock.sh/get-rockpi-sata | sudo -E bash -

sudo nano /etc/rockpi-sata.conf

make any changes you want

save

sudo systemctl restart rockpi-sata.service

sudo nano /lib/udev/rules.d/60-persistent-storage.rules

add the following jut below “Fall back usb_id for USB devices”

#Fix Quad SATA HAT disk serial number

KERNEL=="sd*", ATTRS{idVendor}=="1058", ATTRS{idProduct}=="0a10", SUBSYSTEMS=="usb", PROGRAM="/root/serial.sh %k", ENV{ID_SERIAL}="USB-%c", ENV{ID_SERIAL_SHORT}="%c"

save

sudo nano /root/serial.sh

add these 2 lines

#!/bin/bash

/sbin/hdparm -I /dev/$1 | grep 'Serial Number' | awk '{print $3}'

Save

sudo chmod +x /root/serial.sh

sudo wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash

setup omv disks, install unionfs plug in, configure unionfs and your shares

do not reboot yet

sudo nano /etc/fstab

move the omv entries for disk mounting to the below file and reorder to correct syntax i copied and pasted out of putty to a txt file and edited them to be in the correct order

save

sudo nano /etc/rc.local

add the following above the section that prints the i.p. address, your setup will be different, use fstab file as a guide

sudo mount -o defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl /dev/disk/by-label/disk1 /srv/dev-disk-by-label-disk1

sudo mount -o defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl /dev/disk/by-label/disk2 /srv/dev-disk-by-label-disk2

sudo mount -o defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl /dev/disk/by-label/disk3 /srv/dev-disk-by-label-disk3

sudo mount -o defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl /dev/disk/by-label/disk4 /srv/dev-disk-by-label-disk4

sudo mergerfs -o defaults,allow_other,cache.files=off,use_ino,category.create=eprand,minfreespace=4G,fsname=ufs:365821fb-30db-4a59-945a-55bfb60a5616 /srv/dev-disk-by-label-disk1:/srv/dev-disk-by-label-disk2:/srv/dev-disk-by-label-disk3:/srv/dev-disk-by-label-disk4 /srv/365821fb-30db-4a59-945a-55bfb60a5616

save and you should be done

2 Likes

Hi, @FBN02

Thanks for sharing. I am sure it’s helpful to others too.(I edited your post for better reading)

thanks jack, it looks much better

Dave

not worked for my : brick my setup (one more time) after OVM stop and powerup :frowning:I’m really in doubt regarding unionfs plugin… each time I’m setup it. At first stop/start = fail

make sure you remove the entries in /etc/fstab that mount the drives before you shutdown. those mount commands need to be in fc.local
these entries for mounting the drives are what cause the fail at boot and emergency mode.
it is because fstab tries to mount the drives before the sata hat service loads and they are not seen until after it loads.

my setup has been running with no issues since i figured this out. i have tested shutdown and reboot many times.

Dave

1 Like

Too late, one more setup brick. I’ve checked on my TV start : Yes system pending on mount disks.

I’ll goinn to format my microsd and restart with you setup and ESPECIALLY “move lines” comment (it’s my fault, miss, only reorder, adjust and add command inside rc.local regarding my setup).

Give you a feedback just after.

Well retried with good lines in good file :slight_smile: stop. plug/unplug : KO :frowning:
I’m going to reinstall and merge Directories

Fresh install without OVM.

I’ve used mhddfs (simply) do mount/merge inside /etc/rc.local

3 times shutdown -r now :slight_smile: still working :slight_smile:
I’m thinking OVM have many drawback (dhcp, mergefs). I will retry install OVM without mergeFS and use mhddfs.

And the HAT display all disks stats

@setq regarding issue with merge/union with OVM and HAT, can i suggest to include mount/merge inside main.py. I never dev on Python. But seem a good idea to have mount inside systemctl services of HAT.
It’s only a suggestion:sunflower:

the main issue is that omv automatically adds the mount commands to fstab.
this is only an issue with our hardware due to how it operates.
if the rpi would initialize the hat at boot instead of needing a service it would not be an issue

the hang at boot is caused by the fstab entries. instead of reflashing the sdcard, just get a windows program to edit ext4 file systems and edit the fstab file. this will fix the boot issue without having to reflash.

Dave

1 Like

Well using mhddfs is not so simple with OVM, most of options in GUI requested access to drive or filesystem or folders, not working. I’m thinking it’s related to rc.local method. I will retry without rc.local but like method suggested bu @FBN02

Well after unknown crash (may be power crash) before add you recommendations, then I’ve reset and applied your recommendations :WORKING fine !
Thank you

@setq may be a good idea to have centralized wiki entry for how to setup SATA HAT with Raspberry of Rocki with OpenMediaVault with UnionFile system and mergeFolders. I will glady help in writing this guide.

1 Like

Hey, just sign up for an account and you can edit wiki pages.

1 Like

Hi, I followed the steps you mentioned but after I reboot the filesystem is not mounted in OMV. I have to mount it manually.

Is there any way to automount it?

I’ve the same issue, then I’ve changed loading mode :slight_smile:sudo

I’m using /dev/disk/by-uuid/ not longer /dev/disk/by-label
Advantages :slight_smile:

  1. You can choose order or disk
  2. Disks always mount :slight_smile:

Example for my last disk (I’ve keep mount point because it’s ok for me) :
mount -o defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl /dev/disk/by-uuid/f7e3afa7-7c1f-45eb-b8c5-dd2dabf5150c /srv/dev-disk-by-label-disk4

Well finally got success for mergerfs step :slight_smile: all inside /etc/rc.local.
Al FS/Merge are visible under OVM :slight_smile: But each time to edit something you have to comment /etc/fstab or next restart = crash.

Hi

For me this worked after I put sleep 15 in rc.local

Without the sleep command the file didn’t load on boot.

Did you have the same issue? Any idea why?

Nope not needed to add it