PDA

View Full Version : I need some help with mergerfs & fstab



yoda2016
25th April 2019, 11:57 AM
hi all, im having a little trouble with mergerfs, i can create my drive pool, but it will not be persistant after reboot.

ive been following a guide

https://www.teknophiles.com/2018/02/19/disk-pooling-in-linux-with-mergerfs/

i create my drive pool using the below command


sudo mergerfs -o defaults,allow_other,use_ino,fsname=mergerFS /mnt/storage:/mnt/hshdd /mnt/virt/

it goes on to say


mergerFS & fstab

Typically, you’re going to want your mergerFS pool to be persistent upon reboot. To do this we can simply leverage fstab as we would for any mount point. Using our example above, fstab should follow the following format:
# <file system> <mount point> <type> <options> <dump> <pass>
/mnt/mergerFS*/mnt/virt fuse.mergerfs defaults,allow_other,use_ino,fsname=mergerFS00


so i put
/mnt/storage:/mnt/hshdd:/mnt/virt/ fuse.mergerfs defaults,allow_other,use_ino,fsname=mergerFS 0 0
into my fstab and reboot when it reboots i get greeted by emergency mode until i comment out my addition to fstab.

can anyone help me out with this

HaydnH
25th April 2019, 12:24 PM
Shouldn't the second ":" be a tab? "/mt/storage:/mnt/hshdd" would be the filesystems and "/mnt/virt" would be the mount point. I haven't used mergerFS, but I'm assuming the first ":" is fine, the example in the link uses "*", but as your filesystems aren't similarly named that obviously isn't an option unless you rename them.

HaydnH
25th April 2019, 12:25 PM
Oh, and instead of rebooting, use "mount all" after changing fstab to test it.

yoda2016
25th April 2019, 01:02 PM
remaining my filesystem is not really an option, hopefully someone who is familiar with mergerfs will pop in and give us a hand

HaydnH
25th April 2019, 01:18 PM
remaining my filesystem is not really an option, hopefully someone who is familiar with mergerfs will pop in and give us a hand

Did you read the first sentence?



Shouldn't the second ":" be a tab? "/mt/storage:/mnt/hshdd" would be the filesystems and "/mnt/virt" would be the mount point.

HaydnH
25th April 2019, 01:27 PM
/mnt/storage:/mnt/hshdd:/mnt/virt/ fuse.mergerfs defaults,allow_other,use_ino,fsname=mergerFS 0 0


To clarify, it looks like you're trying to mount the 3 filesystems /mnt/storage, /mnt/hshdd, /mnt/virt/ on a mount point called fuse.mergerfs which obviously doesn't exist. Change that red colon to a tab so that you have the first column as "/mnt/storage:/mnt/hshdd" and the second column as "/mnt/virt".

Oh, also remove the trailing slash from /mnt/virt/, it shouldn't cause an an issue but there have been bugs with that in the past.

yoda2016
25th April 2019, 02:18 PM
To clarify, it looks like you're trying to mount the 3 filesystems /mnt/storage, /mnt/hshdd, /mnt/virt/ on a mount point called fuse.mergerfs which obviously doesn't exist. Change that red colon to a tab so that you have the first column as "/mnt/storage:/mnt/hshdd" and the second column as "/mnt/virt".

Oh, also remove the trailing slash from /mnt/virt/, it shouldn't cause an an issue but there have been bugs with that in the past.

so it should look like this


/mnt/storage:/mnt/hshdd /mnt/virt defaults,allow_other,use_ino,fsname=mergerFS 0 0

bare in mind that /mnt/virt is the mount point for the pool

yoda2016
25th April 2019, 06:31 PM
does it look right to you?

amiga
25th April 2019, 10:32 PM
does it look right to you?

You also didn't show the rest of your fstab. This line would of course have to be after /mnt/storage:/mnt/hshdd were mounted themselves.

yoda2016
25th April 2019, 10:44 PM
You also didn't show the rest of your fstab. This line would of course have to be after /mnt/storage:/mnt/hshdd were mounted themselves.

sorry bro hear it is


GNU nano 2.9.8 /etc/fstab
#
# /etc/fstab
# Created by anaconda on Mon Mar 11 17:19:07 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
## Below are the System generated mount points for the OS hard disk and storage drives ###
#
/dev/mapper/fedora_localhost--live-root / ext4 defaults 1UUID=a8703b97-8dcf-40b2-9e4d-b00d90aed7c9 /boot ext4 defaults 1/dev/mapper/fedora_localhost--live-home /home ext4 defaults 1/dev/mapper/fedora_localhost--live-swap swap swap defaults 0/dev/sdc1 /mnt/storage ext4 defaults 0/dev/sdb1 /mnt/hshdd ext4 defaults 0
### Mount-point for Media for CHROOT JAILED SFTP USERS Note: The chroot Jail is READ-ONLY##
/mnt/storage/TV /yhn/home/media/TV none bind /mnt/storage/Films /yhn/home/media/Films none bind

yoda2016
25th April 2019, 10:45 PM
ok that's not posted it with correct formatting, ill repost my fstab file tomorrow ill add the entry too can you check ive got it right?

yoda2016
26th April 2019, 10:48 AM
as promised here is my fstab file ive put the mergerfs entry in hopefully i got it right



#
# /etc/fstab
# Created by anaconda on Mon Mar 11 17:19:07 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
## Below are the System generated mount points for the OS hard disk and storage drives ########
# The Last entry in this section is my mergerFS entry #####
#
/dev/mapper/fedora_localhost--live-root / ext4 defaults 1 1
UUID=a8703b97-8dcf-40b2-9e4d-b00d90aed7c9 /boot ext4 defaults 1 2
/dev/mapper/fedora_localhost--live-home /home ext4 defaults 1 2
/dev/mapper/fedora_localhost--live-swap swap swap defaults 0 0
/dev/sdc1 /mnt/storage ext4 defaults 0 0
/dev/sdb1 /mnt/hshdd ext4 defaults 0 0
/mnt/storage:/mnt/hshdd /mnt/virt defaults,allow_other,use_ino,fsname=mergerFS ` 0 0


### Mount-point for Media for CHROOT JAILED SFTP USERS Note: The chroot Jail is READ-ONLY Please use /mnt/virt (if fall Back is enabled then use /mnt/storage ) to Add content ###


/mnt/virt/TV /yhn/home/media/TV none bind 0 0
/mnt/virt/Films /yhn/home/media/Films none bind 0 0


####Fall Back Mount-points for Chroot Jail incase main data pool fails simple solution uncomment the lines Below and it should restore yhn mount for primary drive only ###


#/mnt/storage/TV /yhn/home/media/TV none bind 0 0
#/mnt/storage/Films /yhn/home/media/Films none bind 0 0

yoda2016
26th April 2019, 11:08 AM
i decided to do a quick test using mount -a this is what it gave me



[yoda@localhost ~]$ sudo mount -a
mount: /mnt/virt: unknown filesystem type 'defaults,allow_other,use_ino,fsname=mergerFS'.


so i can tell its not identifying the file systems All disks os drive storage and hshdd are all formatted in ext4 how do i give it the information it needs

HaydnH
26th April 2019, 11:51 AM
You've somehow dropped the "fuse.mergerfs" entry in the third column (after /mnt/virt) so it thinks column 4 (the options) is the fs type.

yoda2016
26th April 2019, 12:09 PM
You've somehow dropped the "fuse.mergerfs" entry in the third column (after /mnt/virt) so it thinks column 4 (the options) is the fs type.

how do i fix that sorry my head's fried im slightly over worked of late

yoda2016
26th April 2019, 01:43 PM
You've somehow dropped the "fuse.mergerfs" entry in the third column (after /mnt/virt) so it thinks column 4 (the options) is the fs type.

so should it be like this?

/mnt/storage:/mnt/hshdd /mnt/virt fuse.mergerfs,defaults,allow_other,use_ino,fsname= mergerFS ` 0 0

HaydnH
26th April 2019, 02:18 PM
so should it be like this?

/mnt/storage:/mnt/hshdd /mnt/virt fuse.mergerfs,defaults,allow_other,use_ino,fsname= mergerFS ` 0 0


fuse.mergerfs should be in it's own column, not as one of the options in the following column. Also, you appear to have an extra back tick before the dump/pass columns?


/mnt/storage:/mnt/hshdd /mnt/virt fuse.mergerfs defaults,allow_other,use_ino,fsname=mergerFS 0 0

yoda2016
26th April 2019, 02:53 PM
fuse.mergerfs should be in it's own column, not as one of the options in the following column. Also, you appear to have an extra back tick before the dump/pass columns?


/mnt/storage:/mnt/hshdd /mnt/virt fuse.mergerfs defaults,allow_other,use_ino,fsname=mergerFS 0 0

Thanks HaydnH that solved it thanks again for all your help on this one :)