NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Tennessee_Slim
Aug 29, 2011Aspirant
How to map to NAS share from Linux by CLI?
I've searched the forum and found others having problems mapping ReadyNAS shares to a *NIX box but none of that helped me find a solution.
I have two NVs, one is a plus, both are on RAIDiator 4.1.7. All shares on both NASs have CIFS and NFS only enabled and no security measures. None.
What I'm trying to do is create temporary mounts to shares on the NASs from an Ubuntu box by command line. I can do this fine using Ubuntu's "Connect to Server" applet, but that requires several user inputs, which have to be repeated every time the system is rebooted. And with several different shares to be mounted independently, it's a PITA. And I'm cultivating my Leenuks-fu again so, unfortunately, this system is requiring reboots far more frequently than any self-respecting *NIX box should. If I can figure out the CLI syntax, I can write a script but it's the syntax that has me bumfuzzled.
I'm sudo-ing the mount.cifs command and I've systematically tried what I think are all the pertinent variables to the command but I keep getting "mount error(13): Permission denied". I've used the remote host's name and it's IP address. I've tried the 'guest' option, and I've tried authenticating. I've tried user 'admin' and user 'root'. I've tried prefixing the user name with the 'domain' name and with the name of the remote host (whose login is what I'm using). I've used all the above in every possible configuration and repeated the identical procedure on both NASs. And I'm certain I'm using the proper password. 'user' and 'password' are the only options I'm trying.
Regardless of the combination, the response is:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Except the man pages for mount.cifs don't give me any clue what "error(13)" is all about.
dmesg shows a long list of CIFS VFS: cifs_mount failed w/return code = -13.
The Linux box is on Ubuntu 11.04, kernel 2.6.38-11-generic. It's a headless box I administer remotely via WiFi and VNC. My network is a mixed Win32/*NIX IPV4-only workgroup, no domain or DC. My NV is the DHCP server and it is configured to use the domain name "mshome," which actually is just a workgroup.
While I had one NAS share mounted (via the appplet), I searched the entire system for any file modded within the last day that contained the name of the remote folder in that share. Linux being Linux, I figured it had to be logged in clear text somewhere, and I was hoping it would show me some snippet of syntax that might give me a "Eureka" moment. But it found nothing.
If anyone has any insight how to do this, or what I'm doing wrong, I'd be obliged if you'd pass it along.
I have two NVs, one is a plus, both are on RAIDiator 4.1.7. All shares on both NASs have CIFS and NFS only enabled and no security measures. None.
What I'm trying to do is create temporary mounts to shares on the NASs from an Ubuntu box by command line. I can do this fine using Ubuntu's "Connect to Server" applet, but that requires several user inputs, which have to be repeated every time the system is rebooted. And with several different shares to be mounted independently, it's a PITA. And I'm cultivating my Leenuks-fu again so, unfortunately, this system is requiring reboots far more frequently than any self-respecting *NIX box should. If I can figure out the CLI syntax, I can write a script but it's the syntax that has me bumfuzzled.
I'm sudo-ing the mount.cifs command and I've systematically tried what I think are all the pertinent variables to the command but I keep getting "mount error(13): Permission denied". I've used the remote host's name and it's IP address. I've tried the 'guest' option, and I've tried authenticating. I've tried user 'admin' and user 'root'. I've tried prefixing the user name with the 'domain' name and with the name of the remote host (whose login is what I'm using). I've used all the above in every possible configuration and repeated the identical procedure on both NASs. And I'm certain I'm using the proper password. 'user' and 'password' are the only options I'm trying.
Regardless of the combination, the response is:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Except the man pages for mount.cifs don't give me any clue what "error(13)" is all about.
dmesg shows a long list of CIFS VFS: cifs_mount failed w/return code = -13.
The Linux box is on Ubuntu 11.04, kernel 2.6.38-11-generic. It's a headless box I administer remotely via WiFi and VNC. My network is a mixed Win32/*NIX IPV4-only workgroup, no domain or DC. My NV is the DHCP server and it is configured to use the domain name "mshome," which actually is just a workgroup.
While I had one NAS share mounted (via the appplet), I searched the entire system for any file modded within the last day that contained the name of the remote folder in that share. Linux being Linux, I figured it had to be logged in clear text somewhere, and I was hoping it would show me some snippet of syntax that might give me a "Eureka" moment. But it found nothing.
If anyone has any insight how to do this, or what I'm doing wrong, I'd be obliged if you'd pass it along.
11 Replies
Replies have been turned off for this discussion
- Tennessee_SlimAspirantNope, sorry. Been there, done that, do help.
- dbott67GuideBack when I had my NV+, I added the following command to the /etc/fstab file on my Ubuntu box to mount a share via NFS:
192.168.1.2:/Archive /home/dbott/NFS nfs nfsvers=3,rsize=65536,wsize=65536,tcp,noatime,intr
Where 192.168.1.2 is the IP address of the NAS, Archive is the shared folder and /home/dbott/NFS is the mount point on my Ubuntu box.
You may want to reboot both the computer and the NAS.
The other thing to check is that you have added the Ubuntu IP address to "root privilege-enabled hosts" in Frontview > Share Listing > NFS: - Tennessee_SlimAspirantThanks, but /etc/fstab will mount it permanently.
- Tennessee_SlimAspirantSince my best success always has been mounting remote drives through Kommander and SMB, I tried 'smbmount'. Same result, all Error 13s.
- WhoCares_MentorAs you already figured, mounting SMB/CIFS shares from the command line is a PITA :) Afair there's two major obstacles that need to be overcome. First, that the actual mounting can only be done by the root user. Second, that you need to get the parameters right.
I found that the easiest way of getting it to work was to use automount. Using that has two advantages: shares will only be mounted when needed/accessed and the syntax to use is fairly simple. I'd love to provide examples but I'm currently some hu dred miles from home and office and connected through a shaky GSM connection so VPN is all but a theoretical possibility. If you can't figure out the setup on your own, just ping in about two weeks, I should have access to my setup by then.
-Stefan - Tennessee_SlimAspirantFor the third and final time, a permanent mount will not work. It has to be CLI.
- WhoCares_MentorSorry, I was under the impression that a temporary mount would be what you wanted.
-Stefan - WhoCares_MentorFor the fun of it I tried using the CLI only. Works for connecting to a share but I can't make it disconnect automatically. Not what I'd call temporary, so that's not a solution to your problem either, sorry.
-Stefan - CharlesLaCourAspirantI am not sure what you mean by a temporary mount. If you want the mount to be automatically done on boot why can it not be in the /etc/fstab? I know that you say that it has to be temporary but what do you mean by temporary, normally if a mount is going to be done every time you boot the best place for it is in the fstab. If you only need the mounts for a while just remove it from the fstab once you don't need them anymore.
To mount a CIFS share from the Command Line interface you use "mount -t cifs".
Here is an excerpt from the page that "arjoseph" posted a link to:
# mount -t cifs //server-name/share-name /mnt/cifs -o username=shareuser,password=sharepassword,domain=nixcraft
# mount -t cifs //192.168.101.100/sales /mnt/cifs -o username=shareuser,password=sharepassword,domain=nixcraft
# mount.cifs //192.168.101.100/sales /mnt/cifs -o username=shareuser,password=sharepassword,domain=nixcraft
I have tried all three of these from an Ubuntu 11.04 system and they work using sudo. These should work for you. You should remove the domain portion since your NAS is not part of a domain.
I sounds to me like you are either not supplying the correct user name and password or using a user that doesn't have access to the share. The user "root" is not in CIFS you would have to use "admin".
Related Content
- Aug 23, 2020Retired_Member
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!