Linux help - Ubuntu - "re" mounting shares

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
42,198
Reaction score
4,042
Location
Cape Town
I'm running rancheros - with ubuntu as the console.

I have an issue where my NAS takes about 5min to come up after load shedding, and my docker server takes about 4min.

In my RancherOS startup script I run a couple of mount commands to mount various NAS shares - but with the NAS not up yet, it just leaves the mount point as is. This then causes problems with any downloads, motion capture, etc - downloading to the server instead of the NAS.

I'm trying to get the server to reload the shares after a specific up-time - but not coming right - if I run mount -a, it doesn't reload the shares. Any tips or ideas on how to get the startup script to either wait x interval before loading the shares, or to keep trying until it finds a specific file in one of the shares?
 
I have a similar setup to yours, Docker on top of Ubuntu with NFS shares via three NAS units. My cabinet is all hooked into an APC UPS and APC metered PDUs. I don't have any experience with RancherOS though, is it just a Docker wrapper running on top of Ubuntu Server?

What does your startup script look like? Is it written in bash?

I've had similar issues when everything came back online after load shedding, I set my PDU to stagger boots on my system. When the power came back immediately start all the NAS units, wait 15 mins and then start the Ubuntu server.

It should be fairly easy to complete on the OS though, if that's Ubuntu I can try and help. You could try something like this in docker compose https://docs.docker.com/compose/startup-order/

A rudimentary hack could also be to just increase the GRUB select time on boot.

Need more info on your OS setup and what your scripts look like though.
 
Here's more on RancherOS https://rancher.com/rancher-os/, its supposed to be a lightweight docker management OS, I've just switched to Ubuntu as the console.

I am however going to rebuild the machine in the next week or two with straight Ubuntu as I'm going to need the server for more than just docker container management.

Currently, Rancher has their own container management component similiar to Docker Compose.

The OS uses a YAML file to configure everything during boot (/var/lib/rancher/conf/cloud-config.yml), in that I have a section that does the mounts

Code:
runcmd:
- apt update
- apt install cifs-utils -y
- sudo mount //192.168.1.4/Media -t cifs -o vers=1.0,uid=1101,gid=1101  /mnt/Media
- sudo mount //192.168.1.4/system$ -t cifs -o vers=1.0,uid=1101,gid=1101  /mnt/System
- sudo mount //192.168.1.4/Systems$ -t cifs -o vers=1.0,uid=1101,gid=1101  /mnt/Systems
- sudo mount //192.168.1.4/FileRepo -t cifs -o vers=1.0,uid=1101,gid=1101  /mnt/FileRepo

Just realised now that the above probably means the entries aren't in fstab, hence why mount -a afterwards isn't working?

Currently running an APC router on the NAS - and will hopefully install another on the server this week.
 
(btw - only getting back into Unix environment after a 10 odd year absence)
 
There are better ways to mount your fs in rancher. I'll find my config later.

But I'm moving away from rancherOS to Ubuntu and rancher 2. Pita to migrate tho

Also looking at container based nfs rather than a mount on the host service.
 
Occams Razor - I wouldn't even complicate this. I'd just add a sleep:

$ sleep 180 && your_mount_command_here

That way it will wait another 3 minutes before it tries to perform the mount operation.
 
Well I now have time to research a bit more - home laptop died, so no access to the server (unless I use my tablet and keyboard - but not that desperate)
 
Top
Sign up to the MyBroadband newsletter
X