Linux For Cynics One user's experiences with Linux

21Oct/120

Ubuntu 12.10 Broke My External HDD Shares

The set up I have for my NAS computer might not be typical, so perhaps this doesn't apply to most people. But when I upgraded to Ubuntu 12.10, my external hard drive was no longer accessible from the network. I would get the ""Unable to mount location. Failed to mount Windows share" error dialogue. What was most puzzling was that when I connected through ssh and tried to access /media/My Book, it was there, but I would get

ls: cannot open directory My Book/: Permission denied

The problem is that the mount points for external media have changed. For your user, they are now:

/media/<username>/<drivename>

So, in order to share them over the network, your /etc/samba/smb.conf must reflect that (replace <username> and <drivername> with your details):

[My Book]
path = /media/<username>/<drivename>
available = yes
browsable = yes
public = yes
writable = yes
force user = <username>

And restart the samba service:

 sudo service smbd restart

Still won't work? Try this: How to share an external harddrive

10Jan/122

How to Share an External Harddrive in Ubuntu

If you have files you want to share on an external hard drive, and then you try to access them on another machine, you might get an error like this:

"Unable to mount location. Failed to mount windows share"

Here's what went wrong and how to fix it:

Is the external drive formatted in NTFS or FAT32? If so, and it automatically mounts when plugged in, then it will mount with you as owner and with permissions to allow only you to access it. The remote guest is not you so access is denied. The easiest way out of this is to add the following line to your smb.conf file (located in /etc/samba/) on the machine which is sharing:

 force user = yourusername 

Change yourusername to your own local login user name.

Where you put that line depends on what method you used to create the share - there are two:

If you used Nautilus (the file browser) to create the share then add the line to the [global] section of smb.conf. If you used the classical (shares-admin) method then add it to the share definition itself in smb.conf. The share definition is towards the end of the file and looks like this:

[My Book]
path = /media/My Book
available = yes
browsable = yes
public = yes
writable = yes
force user = yourusername

Then restart samba:

 sudo service smbd restart 

EDIT:
Still won't work? Try this.