Linux Lite Forums

Hardware - Support => Start up and Shutdown => Topic started by: Keith Buckner on May 15, 2019, 09:30:24 AM

Title: How to make auto start script to mount NAS drive?
Post by: Keith Buckner on May 15, 2019, 09:30:24 AM
Need to make a start up item in session and start up to mount my two NAS drives.

They mount manually like this:

I did the following to manually mount drive, and they mount and show on the desktop;
Code: [Select]
sudo mkdir /media/NAS1
sudo mkdir /media/NAS2

then in fstab;

Code: [Select]
//192.168.1.8/Download /media/NAS1 cifs username=un,password=pw,nounix,auto,user,uid=1000 0 0
//192.168.1.9/Download /media/NAS2 cifs username=un,password=pw,nounix,auto,user,uid=1000 0 0

but I still have to do this after boot for them to mount;

Code: [Select]
sudo mount -t cifs //192.168.1.9/Download /media/NAS2 -o username=un,password=pw,nounix,uid=1000
sudo mount -t cifs //192.168.1.8/Download /media/NAS1 -o username=un,password=pw,nounix,uid=1000

How can I make a make a start up script or change fstab for them to auto mount?

Linux Lite 3.8
Kernel 4.4.0-148
Ubuntu 5.4.0-6


Title: Re: How to make auto start script to mount NAS drive?
Post by: trinidad on May 18, 2019, 07:17:24 AM
@Keith Buckner
Not a simple question. Depends somewhat on what's on the drives, and/or how they are set up and powered. You will definitely need a timeout in the startup script (even if you add fstab entries) to allow the network to come up, at least 10s probably. Some computers can solve this via the BIOS, but others not so much. I would just bookmark them in Thunar to connect. Once the OS is up you would only have to click your bookmark.

TC