Ubuntu Mount Share on Startup (failing)
Ubuntu Mount Share on Startup (failing)
Author
Discussion

Munter

Original Poster:

31,331 posts

272 months

Monday 11th February 2019
quotequote all
Ok so I have a camera system using "motion" that was running on Mint, storing video on a Synology NAS.

However the camera died, and mint was playing silly buggers for a while, and new camera, old mint, old motion, didn't want to play.

Scrap the lot. Start again.

Ubuntu18 installed. Motion installed. Videos from new camera. Lovely. Except I can't get the share on the Synology to mount on Ubuntu.

It sort of appears in the "files" application in Gnome. But the user is not allowed to mount the drive. "Operation for root only.

In the fstab file I have the same line as I had in the mint install:

//<ip>/directory/dir2 /home/user/video cifs username=abc,password=xyz 0 0

I even tried changing that to:

//<ip>/directory/dir2 /home/user/video cifs username=abc,password=xyz,user 0 0

As it was suggested online that for other users to mount the share, user option was needed. Still can't get it to connect.

"mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page"

So I'm off to bed. But if anybody has any suggestions I'd be glad to read them in the morning!

(I've also tried the nfs style entry in fstab but no success).


Penelope Stopit

11,209 posts

140 months

Tuesday 12th February 2019
quotequote all
Login as root

Mount the HDD

Double click the HDD to open it

Right click in the open HDD and select properties

Click on permissions

Now you should have a editable page in front of you

Change from root to your username in the drop-down boxes

Select read and write or whatever you require

Logout of root

Login as your username and away you go

I did this yesterday in Debian OS

Munter

Original Poster:

31,331 posts

272 months

Tuesday 12th February 2019
quotequote all
Penelope Stopit said:
Login as root

Mount the HDD
Ok so I'm falling at the 2nd hurdle. Possibly the first.

In Ubuntu you cannot login as root. You can only sudo things.

I cannot find a "sudo mount ..." command that will actually run. (e.g. sudo mount -t cifs -o username=serverUserName //myServerIpAdress/sharename /mnt/myFolder/)

They all result in:
mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

It did ask for my password though so I assume it can locate the remote system...just hates me for a reason I've yet to figure out.

I find that manual page to be inexplicable unfortunately.

GrumpyTwig

3,354 posts

188 months

Tuesday 12th February 2019
quotequote all
sudo su -

As a command will drop you into a root shell session.

Munter

Original Poster:

31,331 posts

272 months

Tuesday 12th February 2019
quotequote all
GrumpyTwig said:
sudo su -

As a command will drop you into a root shell session.
thumbup

That's handy. But i still get the same "Operation not supported" error frown

Gerr

GrumpyTwig

3,354 posts

188 months

Tuesday 12th February 2019
quotequote all
Try putting a -v flag in the mount command to get more verbose log output.

Also try following their guides like https://wiki.ubuntu.com/MountWindowsSharesPermanen...

/edit it might be worth looking at the SMB version used, I recall there being some changes in defaults for what mount/cifs default to. Maybe that's nfs I forget but it's worth a go.

Edited by GrumpyTwig on Tuesday 12th February 10:05

budgie smuggler

6,088 posts

190 months

Tuesday 12th February 2019
quotequote all
Have you installed cifs-utils? You need that installed to be able to mount Windows network shares.

If that doesn't work, you may also need to specify the SMB version level on the mount command line with e.g. -o vers=2.0

Munter

Original Poster:

31,331 posts

272 months

Tuesday 12th February 2019
quotequote all
Ohh apparently you have to put the SMB version in the command options:
mount -t cifs -o username=serverUserName,vers=1.0 //myServerIpAdress/sharename /mnt/myFolder/

Actually makes the mount!

Munter

Original Poster:

31,331 posts

272 months

Tuesday 12th February 2019
quotequote all
Adding the version to the fstab makes that work also.

Thanks guys!

thumbup

Penelope Stopit

11,209 posts

140 months

Tuesday 12th February 2019
quotequote all
Very good

This tool has been of great help to me, perhaps you can install it with ubuntu package manager

gksu

http://www.nongnu.org/gksu/

TonyRPH

13,550 posts

199 months

Tuesday 12th February 2019
quotequote all
To avoid hangups during boot - e.g. is the NAS is down - you should use the automounter instead of fstab.

If the NAS is down, the machine will hang during boot, trying to mount the share from fstab.

Automount NFS share in Linux using autofs

You can also mount SMB / CIFS shares in this manner, however if you have NFS available, I would use that.