k0kster
Posts: 10
Joined: Tue Sep 03, 2019 9:02 am

accessing files on NAS drive

Sat Sep 07, 2019 7:21 am

hi all!

i just installed my pi and played around a little with it. but i cant seem to be able to map a network drive on the pi.

i kept assuming that i should do it the same way i would with a pc.

i have a .htm file i want to open using the pi.

i somehow made a folder that syncs with a folder from my nas drive. however, i can only see the files using terminal, and not the folder that appears on my raspberry pi desktop.

please help me access files on my nas!

thanks!

Andyroo

Re: accessing files on NAS drive

Sat Sep 07, 2019 12:46 pm

Normally you instruct the Pi to mount folder using the fstab file (regular mounts) or the mount command (one off or short time use) - both a bit of a pain and hard to enter (due to the number of options and its a manual edit) with the added fun that errors in fstab can stop the Pi booting (recoverable).

The better option if you are new to the Pi is to use the routines known as systemd as these can be changed without the Pi locking up.

Before you can start though you need to know a few things about the share on the NAS:

1) What is it called
e.g. 192.168.1.20/Public or syn01/Public
2) What type of 'disk' format this shows up as
e.g. ext4, FAT NTFS etc
3) Do you want the share mounted to be able to read or read/write the drive
4) Do you want all users to be able to access it or just the root user

Fraoch
Posts: 137
Joined: Thu Mar 07, 2013 11:53 pm
Location: Cambridge, Ontario, Canada

Re: accessing files on NAS drive

Sun Sep 08, 2019 1:34 am

I would assume you have a Windows (samba/cifs) share.

Take a look at this:

https://raspberrypi.stackexchange.com/q ... -pi-client

Install the samba/cifs packages, then alter fstab as shown. Try a temporary mount after altering fstab, "sudo mount -a" and if you encounter no errors you should be able to access it.
Pencoed-made Model 1B, Samsung memory
2B 1.1
3B+
4B 2GB

k0kster
Posts: 10
Joined: Tue Sep 03, 2019 9:02 am

Re: accessing files on NAS drive

Mon Sep 09, 2019 8:16 am

i managed to solve my problem with the link Fraoch pasted.

i previously stumbled onto the same or similar solution, with an added ver=1.0 in the command. goes something like this

sudo mount -t cifs /NAS/shared /mnt/shared -o vers=1.0,username=<username>

entered my pw and im mounted! thanks for the help!

Fraoch
Posts: 137
Joined: Thu Mar 07, 2013 11:53 pm
Location: Cambridge, Ontario, Canada

Re: accessing files on NAS drive

Mon Sep 09, 2019 8:04 pm

Glad that worked!

Note the "mount" command is a one-time thing, if you reboot you will have to enter it again.

Putting it in fstab as shown in the link is permanent and will reconnect on reboot.
Pencoed-made Model 1B, Samsung memory
2B 1.1
3B+
4B 2GB

k0kster
Posts: 10
Joined: Tue Sep 03, 2019 9:02 am

Re: accessing files on NAS drive

Wed Sep 18, 2019 8:50 am

ah i dont seem to be able to make the command run on start up.

this is whats in the last line of /etc/fstab

//<NAS local ip>/autopublish /mnt/autopublish cifs vers=1.0,user=<user>,password=<password> 0 0

it works when i try sudo mount -a, but doesnt run on start up.

please help

Ernst
Posts: 1234
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: accessing files on NAS drive

Wed Sep 18, 2019 9:25 am

k0kster wrote:
Wed Sep 18, 2019 8:50 am
ah i dont seem to be able to make the command run on start up.

this is whats in the last line of /etc/fstab

//<NAS local ip>/autopublish /mnt/autopublish cifs vers=1.0,user=<user>,password=<password> 0 0

it works when i try sudo mount -a, but doesnt run on start up.

please help
try

Code: Select all

//<NAS local ip>/autopublish /mnt/autopublish cifs vers=1.0,user=<user>,password=<password>,x-systemd.automount 0 0
The road to insanity is paved with static ip addresses

LTolledo
Posts: 1958
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: accessing files on NAS drive

Wed Sep 18, 2019 9:28 am

this is how I do it in fstab because I know it always works.

Code: Select all

//192.168.245.150/share   /media/pi/BufNAS    cifs   credentials=/root/.cifuser,nofail,vers=1.0,x-systemd.automount 0 0
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

k0kster
Posts: 10
Joined: Tue Sep 03, 2019 9:02 am

Re: accessing files on NAS drive

Thu Sep 19, 2019 8:14 am

this line worked like a charm!

//<NAS local ip>/autopublish /mnt/autopublish cifs vers=1.0,user=<user>,password=<password>,x-systemd.automount 0 0

thanks for the help guys

cheers!

Return to “Beginners”