Mounting a share via Raspi to a QNAS Share
-
- Know my way around
- Posts: 102
- Joined: Tue Jun 03, 2014 8:10 pm
- Location: UK
Mounting a share via Raspi to a QNAS Share
I hope someone can help as I am getting more confused as I look at this.
I have done some reading and I through I had the right command but each time, I try to mount a Qnas share via RaspPI I am getting errors, and I don't know were I am going.
I have a Test account on my NAS called TorPi with R/W access to the Media Folder.
I have created a folder called tank within my PI Home folder as a mounting point.
and here are my commands I have tried
192.168.0.7:/Media/TV_shows /home/pi/tank nfs defaults,user,auto,nostime,intr 0 0
//192.168.0.7:/Media/TV_shows /home/pi/tank cifs rw,user,username=TorPi,password=TorPi,uid=1000,gid=1000,iocharset=utf8 0 0
//192.168.0.7:/Media/TV_shows /home/pi/tank nfs default 0 0
and all are reporting the mounting errors from Error(22) or mount.nfs: remote share not in host:dir format.
any ideals ?
I have done some reading and I through I had the right command but each time, I try to mount a Qnas share via RaspPI I am getting errors, and I don't know were I am going.
I have a Test account on my NAS called TorPi with R/W access to the Media Folder.
I have created a folder called tank within my PI Home folder as a mounting point.
and here are my commands I have tried
192.168.0.7:/Media/TV_shows /home/pi/tank nfs defaults,user,auto,nostime,intr 0 0
//192.168.0.7:/Media/TV_shows /home/pi/tank cifs rw,user,username=TorPi,password=TorPi,uid=1000,gid=1000,iocharset=utf8 0 0
//192.168.0.7:/Media/TV_shows /home/pi/tank nfs default 0 0
and all are reporting the mounting errors from Error(22) or mount.nfs: remote share not in host:dir format.
any ideals ?
Regards
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
-
- Know my way around
- Posts: 102
- Joined: Tue Jun 03, 2014 8:10 pm
- Location: UK
Re: Mounting a share via Raspi to a QNAS Share
ok, after a cup off coffee and a bit more reading, I found out my issue, it was me, I was trying to map to a Sub folder on my Qnaps box, which is not allow.
so now I have a working bit of code that looks like this
the only problem I have now is that when I place this within the "etc/fstab" file, the code is no running when I do a reboot and if I do a
but I get a error on the map drive line 11. which I can't find any error with at the moment,
so now I have a working bit of code that looks like this
Code: Select all
//192.168.0.7/Media/ /home/pi/tank cifs username=admin,password=admin default 0 2
Code: Select all
sudo mount -a
Code: Select all
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
LABEL=ExtStorage /ExtStorage ext4 defaults 0 1
//192.168.0.7/Media/ /home/pi/tank cifs username=admin,password=admin default 0 2
Regards
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
- OneCD
- Guru
- Posts: 12144
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Mounting a share via Raspi to a QNAS Share
That syntax doesn't look right.chrischambers wrote:Code: Select all
//192.168.0.7/Media/ /home/pi/tank cifs username=admin,password=admin default 0 2
Can you try this?
Code: Select all
192.168.0.7:/Media /home/pi/tank cifs username=admin,password=admin
-
- Know my way around
- Posts: 102
- Joined: Tue Jun 03, 2014 8:10 pm
- Location: UK
Re: Mounting a share via Raspi to a QNAS Share
Hi OneCD. I tried your suggestion, but it didn't work.
I waited for about 5 mins, to give the raspberry time to finish doing it thing, and then tried
and I got the following error message
I waited for about 5 mins, to give the raspberry time to finish doing it thing, and then tried
Code: Select all
sudo mount -a
mount.cifs: bad UNC (192.168.0.7:/media/
Regards
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
-
- Know my way around
- Posts: 102
- Joined: Tue Jun 03, 2014 8:10 pm
- Location: UK
Re: Mounting a share via Raspi to a QNAS Share
I think I might know why it Is not working, but I don't know how to resolve it. it looks like that the command is trying to run, was the raspberry is still booting up, and that the wireless services are not running.
is there a way to delay the command for a few seconds to give the raspberry time to finish off loading, before it try's to run the fstab ?
is there a way to delay the command for a few seconds to give the raspberry time to finish off loading, before it try's to run the fstab ?
Regards
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
- OneCD
- Guru
- Posts: 12144
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Mounting a share via Raspi to a QNAS Share
I don't know of a way to do that in fstab as it's just a config file.chrischambers wrote:is there a way to delay the command for a few seconds to give the raspberry time to finish off loading, before it try's to run the fstab ?
You might look at creating a script with the mount command in it and adding init.d & rcS.d entries to call it during startup. When used this way, your mount syntax will be different.
The exact method required will depend on what distro you're running on the Pi. Are you using something like Raspian?
-
- Know my way around
- Posts: 102
- Joined: Tue Jun 03, 2014 8:10 pm
- Location: UK
Re: Mounting a share via Raspi to a QNAS Share
Hi OneCD
Yes I am using the following:
Yes I am using the following:
how would I go about creating this script and I am not sure what you mean butPRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
adding init.d & rcS.d
Regards
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
- OneCD
- Guru
- Posts: 12144
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Mounting a share via Raspi to a QNAS Share
Have a read of this tutorial. It should get you started & it's easier than what I suggested.chrischambers wrote:how would I go about creating this script and I am not sure what you mean butadding init.d & rcS.d
- OneCD
- Guru
- Posts: 12144
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Mounting a share via Raspi to a QNAS Share
Also found some links that may be relevant to your situation:
https://rasspberrypi.wordpress.com/2012 ... pberry-pi/
http://raspberrypi.stackexchange.com/qu ... rive-fails
https://thepihut.com/blogs/raspberry-pi ... ge-at-boot
https://rasspberrypi.wordpress.com/2012 ... pberry-pi/
http://raspberrypi.stackexchange.com/qu ... rive-fails
https://thepihut.com/blogs/raspberry-pi ... ge-at-boot
-
- Know my way around
- Posts: 102
- Joined: Tue Jun 03, 2014 8:10 pm
- Location: UK
Re: Mounting a share via Raspi to a QNAS Share
thanks for the links, and I have tried the following, but for some reason I can't get the .sh to run automatically, but it works fine, if I run it manual.
here is the code / procedure
Sudo nano startup.sh
Cut and pastle
Save the file and exit with Ctrl+X, Y then Return
Sudo chmod +x startup.sh
sudo nano /etc/rc.local
Add line /home/pi/startup.sh
Save the file and exit with Ctrl+X, Y then Return.
and when I reboot, nothing happens. but if I run the startup.sh manual then I get a error at line 9 - which is the command break
any ideals on how to get the script to work ? as all the reading I have done is point to using the rc.local, but for some reason, I can't get this to work
here is the code / procedure
Sudo nano startup.sh
Cut and pastle
Code: Select all
if ! ( ping -c 1 192.168.0.1 ) > /dev/null
then
echo "network is NOT up so wait"
sleep 2
else
echo "Network is UP"
sudo mount -a
break
fi
Sudo chmod +x startup.sh
sudo nano /etc/rc.local
Add line /home/pi/startup.sh
Code: Select all
#!/bin/sh -e
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/home/pi/startup.sh
exit 0
and when I reboot, nothing happens. but if I run the startup.sh manual then I get a error at line 9 - which is the command break
any ideals on how to get the script to work ? as all the reading I have done is point to using the rc.local, but for some reason, I can't get this to work
Regards
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
- OneCD
- Guru
- Posts: 12144
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Mounting a share via Raspi to a QNAS Share
This looks like the solution that was (badly) shown here.chrischambers wrote: Sudo nano startup.sh
Cut and pastleCode: Select all
if ! ( ping -c 1 192.168.0.1 ) > /dev/null then echo "network is NOT up so wait" sleep 2 else echo "Network is UP" sudo mount -a break fi
It should look like this:
Code: Select all
#!/bin/bash
while true; do
if ! ( ping -c 1 My_ROUTER_IP ) > /dev/null then
echo "network is NOT up so wait"
sleep 2
else
echo "Network is UP"
sudo mount -a
break
fi
done
It failed when encountering the 'break' command as it wasn't inside a loop.chrischambers wrote:and when I reboot, nothing happens. but if I run the startup.sh manual then I get a error at line 9 - which is the command break
When testing a startup script, always test it manually first. Resolve any errors and re-test. When it runs without error (and works the way it is supposed to), then integrate it into your startup process.
If you are displaying a script (or command) that was written by someone else, please provide a link to the original. It makes it easier to work out where things are going wrong.
-
- Know my way around
- Posts: 102
- Joined: Tue Jun 03, 2014 8:10 pm
- Location: UK
Re: Mounting a share via Raspi to a QNAS Share
thanks for the reply and I am sorry that I didn't post the Ref Webpage, but I would like to report that the script works with no issues when I run it manual, but still doesn't work when I reboot the machine.
Regards
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
- OneCD
- Guru
- Posts: 12144
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Mounting a share via Raspi to a QNAS Share
To better assist, I decided to get Raspbian running on one of my Pi's here. I've confirmed that it's possible to mount NAS shares on the Pi via cable or WiFi at bootup and that this can be done without additional scripts.
Raspberry Pi 3 model B running Raspbian Jessie Lite #2016-11-25
--> connected via Ethernet cable (or WiFi) to -->
QNAP TS-569 Pro running QTS 4.2.2 #20161214
on the QNAP
Raspberry Pi 3 model B running Raspbian Jessie Lite #2016-11-25
--> connected via Ethernet cable (or WiFi) to -->
QNAP TS-569 Pro running QTS 4.2.2 #20161214
on the QNAP
- I created a new user in QTS called 'piuser' with a password of 'piuser',
- I had to "Enable file service for Microsoft Networking". Personally, I only use NFS, but did this to match what your first post shows,
- In "Shared Folders", I assigned RW permission for 'piuser' to my 'Public' share,
- Also ensured that "Microsoft Networking host access" was set to allow all hosts (*) for this share.
- Logged in at the console with 'pi' and 'raspberry'.
- Created a mount-point:
Code: Select all
$ sudo mkdir -p /mnt/nas/Public
- Edited fstab to specify NAS share and mount-point:
and added this line:
Code: Select all
$ sudo nano /etc/fstab
added automount option as per lightswitch05's answer.Code: Select all
//10.0.0.2/Public /mnt/nas/Public cifs username=piuser,password=piuser,_netdev,x-systemd.automount
Saved fstab and exited. - Then performed semi-auto mount:
Code: Select all
$ sudo mount -a
- Confirmed mount occurred:
Looks good!
Code: Select all
$ ls -la /mnt/nas/Public
- Rebooted Pi, logged in, checked mount-point - success!
-
- Know my way around
- Posts: 102
- Joined: Tue Jun 03, 2014 8:10 pm
- Location: UK
Re: Mounting a share via Raspi to a QNAS Share
Hi OneCD.
I don't know why it has started to work, but for some reason, it has started to mount my share folder.
I re-checked my settings and confirmed that all was the same as your posting above, but I was not able to find the "Microsoft Networking host access" so I Tick the Enable Advanced Folder Permissions to see if that option was within there.
and was the system was applying the new settings, the Raspberry was able to mount.
many thanks for your help.
I don't know why it has started to work, but for some reason, it has started to mount my share folder.
I re-checked my settings and confirmed that all was the same as your posting above, but I was not able to find the "Microsoft Networking host access" so I Tick the Enable Advanced Folder Permissions to see if that option was within there.
and was the system was applying the new settings, the Raspberry was able to mount.
many thanks for your help.
Regards
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
Chris
-------------
QNAps = TS - 469 Pro
Firmware = 4.3.4.1463 Build 2020/10/06
RAID 5= 11TB | Disk1 = ST4000VN000-1H4168 | Disk2 = ST4000VN000-1H4168 |
Disk3 = ST4000VN000-1H4168 |Disk4 = ST4000VN000-1H4168
Other Storage = Unraid; Resources = Plex ; Grafana
- OneCD
- Guru
- Posts: 12144
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Mounting a share via Raspi to a QNAS Share
That's OK. It's a 'Shared Folders' permission setting for each share. But if you're connected now, then it's set correctly.chrischambers wrote:I re-checked my settings and confirmed that all was the same as your posting above, but I was not able to find the "Microsoft Networking host access" so I Tick the Enable Advanced Folder Permissions to see if that option was within there.
Nice work.chrischambers wrote:and was the system was applying the new settings, the Raspberry was able to mount.