LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't find in /etc/fstab error, unable to mount the drive. (https://www.linuxquestions.org/questions/linux-newbie-8/cant-find-in-etc-fstab-error-unable-to-mount-the-drive-4175653223/)

Hchinasky 05-02-2019 11:47 PM

Can't find in /etc/fstab error, unable to mount the drive.
 
Hello! First posting on LinuxQuestions.
Im using ubuntu 10.04.2-desktop-amd64 on my virtual machine. I created a directory called ~/SambaMount and when i try to mount the drive i get this /etc/fstab error. Here is the command I typed.
$sudo mount -t cifs -o username=alex,uid=100,gid=1000 //server1/SambaMount

ehartman 05-03-2019 12:14 AM

Quote:

Originally Posted by Hchinasky (Post 5990915)
$sudo mount -t cifs -o username=alex,uid=100,gid=1000 //server1/SambaMount

You're missing the directory to mount it on.
So then mount will try to find that directory in the /etc/fstab file and when no entry for that shared drive is present there you get an error.
Either specify the directory (which MUST already exist) or create a line for it in the /etc/fstab (which will also save you the trouble of specifying the options).

Hchinasky 05-03-2019 01:10 AM

The first issue cleared up with the corrected command. Now I'm getting an error that says couldn't chdir to SambaMount no such file or directory. I created a directory called SambaMount prior to attempting the command.
Corrected command
username=alex,uid=1000,gid=1000 //server1/SharedWindows /SambaMount

Shadow_7 05-03-2019 08:02 AM

It's been a while since I windows or samba'd, but shouldn't that be \\ not // ?
AKA \\server1\SambaMount

It's the reason I favor keyboards with the \ + | key above the enter key. Even though I haven't coded for windows in more than a decade.

It might not matter, but did you chown the /SambaMount before mounting?

$ sudo chown alex:alex /SambaMount

Otherwise you might be limited to chdir of subdirectories under /SambaMount. Not that I fiddle in that land much. Also if you're not concerned with security, or shooting your own foot off, you could use umask=#### where #### is the permissions you don't want. With 0222 being no write access, and 0000 being universal access to anyone and all things relative to the mount point. Perhaps only useful for shortening your mount command at a risk.

$ sudo mount -t cifs -o umask=0000 \\server1\SambaMount /SambaMount

Perhaps samba in linux is as / \ insensitive as windows is case insensitive. Never really dwell-ed there much since I don't do windows and NFS or just nc files between computers depending on the lazy attributes of any given day.

berndbausch 05-03-2019 10:20 AM

Quote:

Originally Posted by Shadow_7 (Post 5991028)
It's been a while since I windows or samba'd, but shouldn't that be \\ not // ?

Forward slashes are fine.

berndbausch 05-03-2019 10:22 AM

Quote:

Originally Posted by Hchinasky (Post 5990928)
The first issue cleared up with the corrected command. Now I'm getting an error that says couldn't chdir to SambaMount no such file or directory. I created a directory called SambaMount prior to attempting the command.
Corrected command
username=alex,uid=1000,gid=1000 //server1/SharedWindows /SambaMount

So you ran these commands:
Code:

mount -o username=alex,uid=1000,gid=1000 //server1/SharedWindows /SambaMount
cd /SambaMount

The first command succeeded, and the second one failed with the error message. Correct?
If so, this is very strange, and I wonder if you omitted the slash when trying to change to the /SambaMount directory.


All times are GMT -5. The time now is 06:10 PM.