Quantcast
Channel: Active questions tagged mount+fstab - Ask Ubuntu
Viewing all articles
Browse latest Browse all 714

unable to auto-mount path even tho i can mount it using mount command

$
0
0

I can successfully mount an SMB share if I do this:

sudo mount -v -t cifs -o username=neubert,password=whatever //192.168.1.128/shared /media/shared

Like if I do that and go to /media/shared in the File Explorer I can view the contents of the mount point.

Putting this into my /etc/fstab, however, does not result in /media/shared being auto-mounted when I start the computer up:

//192.168.1.128/shared /media/shared cifs username=neubert,password=whatever,rw,uid=1000,gid=1000

No problem, I thought, I'll just put the mount command into my ~/.bashrc. If I just put it in my ~/.bashrc file without some sort of if statement, however, it'll give me errors whenever that location is already mounted so I tried this:

if mount -l | grep -q 192.168.1.128then   sudo mount -v -t cifs -o username=neubert,password=whatever //192.168.1.128/shared /media/sharedfi

Unfortunately, that doesn't work. Like even if I put that in a standalone test.sh file nothing is mounted, which just seems strange to me given that this reliably tells me if 192.168.1.128 is mounted or not:

if mount -l | grep -q 192.168.1.128then   echo "OK";else   echo "NOT OK";fi

Any ideas?


Viewing all articles
Browse latest Browse all 714

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>