You are Here:
Linux Lite 5.2 RC1 is now available for download and testing

How to make auto start script to mount NAS drive?

Author (Read 1557 times)

0 Members and 3 Guests are viewing this topic.

How to make auto start script to mount NAS drive?
« on: May 15, 2019, 09:30:24 AM »

Keith Buckner

  • New to Forums
  • *
  • 3
  • Country: us
  • Reputation: 0

  • Linux Lite: 3.8 32bit

  • CPU: Intel P4 @ 2.70GHz

  • MEMORY: 4Gb

  • VIDEO CARD: nVidia GeForce 8400GS/PCIe/: 1920x1080:
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]
// /media/NAS1 cifs username=un,password=pw,nounix,auto,user,uid=1000 0 0
// /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 // /media/NAS2 -o username=un,password=pw,nounix,uid=1000
sudo mount -t cifs // /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

Mint 19.1 x64 Tessa-Dell-PowerEdge T310-Xeon X3430 4 Cores 2.40GHz-16GB-GeForce GT730 2GB
Mint 19.1 x64 Tessa-ASUSTek CM5571-Intel Dual Core ES5400 2.7GHz-8GB-GeForce 8400 1GB
Lite 3.8 x86-DEll Dimension 4600-Intel Pentium 4  2.80GHz-4GB-GeForce FX 5200 1GB
Mint 19 x64 Tara-ASRock K8NF4GAMD-Athlon64 Processor 2800+-2GB-GeForce GTS 450 2GB
Bodhi 3.2.1 x64-Acer Aspire 5000 Laptop-AMD Turion 64ML-30 1600MHz-1GB-SIS661
Lite 4.2 x64-Toshiba Laptop-AMD 2.2GHz-1GB

Re: How to make auto start script to mount NAS drive?
« Reply #1 on: May 18, 2019, 07:17:24 AM »


  • Platinum Level Poster
  • **********
  • 1159
  • Country: us
  • Reputation: 187
  • Linux Lite Member

  • Linux Lite: 5.0 64bit

  • CPU: AMD A8 5500 4 cores

  • MEMORY: 8Gb

  • VIDEO CARD: AMD/ATI Radeon HD 7560D

  • Kernel: 5.x
@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.

All opinions expressed and all advice given by Trinidad Cruz on this forum are his responsibility alone and do not necessarily reflect the views or methods of the developers of Linux Lite. He is a citizen of the United States where it is acceptable to occasionally be uninformed and inept as long as you pay your taxes.


Linux Lite 5.2 RC1 is now available for download and testing