View: 47301|Reply: 606

How to auto-mount NAS or network share on OrangePi Zero

  [Copy link]

1

threads

2

posts

19

credits

Novice

Rank: 1

credits
19
Published in 2022-11-19 11:51:47 | Show all floors |Read mode
This post was finally edited by jgbrown54 at 2022-11-19 11:56

After trying numerous references on the internet for mounting network drives on Armbian and Linux, I finally found a way that works and is easy. It uses entries in fstab and mounts them using cron.

The first thing to do is to create a mount point. I added a folder to /mnt named share with the following command:

sudo mkdir /mnt/share

This is where you will access the drive after it's mounted. You can reference a folder anywhere you have access to.

I also needed to add the cifs utilities with the following command:

sudo apt install cifs-utils

Then I needed to figure out how to mount the share. I found that it would mount manually with the following command:

sudo mount -o username=<username>,password=<password>,nofail,vers=1.0 //192.168.1.115/Media_Disk1 /mnt/share

I had to add the vers=1.0 because the NAS I was accessing uses an old format for SAMBA. You can probably leave this off or try it at 1.0, 2.0, or 3.0.

That command mounted the external share //192.168.1.115/Media_Disk1 so that I could access all the files on it by accessing /mnt/share.

Since that was successful, I unmounted the drive using the following command:

sudo umount /mnt/share

Notice the spelling. That is umount not unmount.

Then I opened fstab with the following command:

sudo nano /etc/fstab

At the bottom of fstab I added the following line:

//192.168.1.116/Media_Disk1 /mnt/share cifs username=<username>,password=<password>,nofail,vers=1.0

Notice that this is basically the same as the mount command except for the cifs and the options are at the end instead of at the beginning. I saved the changes to fstab.

Entering the following command would mount all the drives in fstab:

sudo mount -a

I thought this was all I needed to do but the drive did not maount on a reboot. As it turns out, Armbian does not automount fstab during boot. So I had to set up an entry in crontab using the following command:

sudo crontab -e

Then at the bottom of the crontab add a line that reads like this:

@reboot /bin/bash -c 'sleep 10 && /bin/mount -a'

And then saved the crontab. I added the 10 second sleep just to make sure the network was up and stable before mounting the drive. You may not need this but I thought it was a good idea. So now cron will wait 10 seconds after boot and issue the /bin/mount -a.

I actually wound up adding several network locations and they all mount as long as the system they are on is running when the OPIzero is booted. This should work for other Armbiam systems as well.


0

threads

11

posts

42

credits

Novice

Rank: 1

credits
42
Published in 2023-6-5 10:21:33 | Show all floors
The OrangePi Zero is a versatile single-board computer that provides a rankdle cost-effective solution for various DIY projects. One popular use case is transforming it into a network-attached storage (NAS) device or utilizing it to access network shares. In this article, we will explore an efficient method to automate the mounting process, enabling seamless access to your NAS or network shares on the OrangePi Zero.

0

threads

9

posts

28

credits

Novice

Rank: 1

credits
28
Published in 2023-6-13 09:49:05 | Show all floors
In the end, I added numerous network locations, and the OPIzero will automatically mount them all so long as the computer that they are running on is active when it boots up. It is expected that this will also work for other Armbiam systems. funny shooter 2
  

0

threads

22

posts

216

credits

Intermediate member

Rank: 3Rank: 3

credits
216
Published in 2023-7-7 19:06:09 | Show all floors
The wide feed dogs on upholstery sewing machines provide excellent fabric control. They ensure smooth feeding and help prevent fabric bunching or uneven stitches. internet

1

threads

509

posts

1447

credits

Gold member

Rank: 6Rank: 6

credits
1447
Published in 2023-7-22 23:20:34 | Show all floors
Hi there! Nice stuff, do keep me posted when you post again something like this!        acheter clenbuterol

1

threads

509

posts

1447

credits

Gold member

Rank: 6Rank: 6

credits
1447
Published in 2023-7-27 20:04:35 | Show all floors
After sending off the game, look into the UI to easily explore the universe of Dewagg Game. From getting to journeys to tweaking your symbol, the natural UI makes everything effectively open.        Dewagg

1

threads

509

posts

1447

credits

Gold member

Rank: 6Rank: 6

credits
1447
Published in 2023-8-3 18:32:24 | Show all floors
Excellent post. I was reviewing this blog continuously, and I am impressed! Extremely helpful information especially this page. Thank you and good luck.        ufabet777 wallet

1

threads

509

posts

1447

credits

Gold member

Rank: 6Rank: 6

credits
1447
Published in 2023-8-7 22:21:17 | Show all floors
I would like to say that this blog really convinced me to do it! Thanks, very good post.        redmi note 9 pro

1

threads

509

posts

1447

credits

Gold member

Rank: 6Rank: 6

credits
1447
Published in 2023-8-9 18:01:07 | Show all floors
Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.        uniswap v2

1

threads

509

posts

1447

credits

Gold member

Rank: 6Rank: 6

credits
1447
Published in 2023-8-9 21:25:13 | Show all floors
In the world of www, there are countless blogs. But believe me, this blog has all the perfection that makes it unique in all. I will be back again and again.        uniswap v2
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list