https://rancher.com/ logo
#longhorn-storage
Title
# longhorn-storage
a

ancient-raincoat-46356

07/01/2022, 9:00 PM
So I have 6 VM's (Ubuntu 20.04) with 3 master/3 worker nodes. On the worker nodes I have attached a second 20G disk and here is where I made some assumptions... I learned the Longhorn installs at
/var/lib/longhorn
and I am thinking this is where my provisioned PV's will be created and replica's will be stored. So wanting to use those 20G disk on each, I partitioned the disk, created a logical volume out of it and then formatted it with XFS filesystem which is our standard format. I then mounted that disk at
/mnt/DATA
, created a subfolder named
longhorn
and then symlinked
/mnt/DATA/longhorn -> /var/lib/longhorn
. Is this the correct approach to use? This is the information I am failing to find anywhere including in the Longhorn docs.
m

melodic-manchester-54063

07/01/2022, 9:27 PM
The docs recommend bind mounting the path to
/var/lib/longhorn
instead of symbolically linking it: https://longhorn.io/docs/1.3.0/best-practices/#setting-up-extra-disks
a

ancient-raincoat-46356

07/01/2022, 9:32 PM
I'm not familiar with bind mounting but I'm looking it up now. Do you know if my formatting the logical volume was correct or should the block device be an unformatted/raw block device?
And to be clear, I believe this means I would need two fstab entries. One for mounting my disk and a second bind mount that binds the longhorn directory to my mounted disk?
So would I need to have something like this???
Copy code
UUID="blahblahblah" /mnt/DATA xfs defaults 0 0
/var/lib/longhorn /mnt/DATA none bind
m

melodic-manchester-54063

07/01/2022, 9:43 PM
If you as using the whole disk for longhorn, you can mount it to
/var/lib/longhorn
. It looks like the source and destination are reverse in your fstab example.
/mnt/DATA /var/lib/longhorn none bind
a

ancient-raincoat-46356

07/21/2022, 5:07 PM
ll
7 Views