Can't access my external hard drive on RPi2 from Windows

Hi all,

I have a Raspberry Pi 2 using OSMC with an external hard drive attached. The RPi2 has a fixed IP address of I have basically followed the instructions at I was able to access the external hard drive before from Windows but did a clean install on the RPi2 and longer can.

I am using Windows 10 on my PC. I have no problem accessing the RPi2 and external hard drive using Filezilla. I have installed Samba (both from the command line) and followed those web page instructions but no luck accessing the external hard drive from Windows.

The error I get is "Windows cannot access \OSMC. OSMC is the name of my RPi2 and my external hard drive is named HDD. I can ping from the PC OK. However, if I enter // in Windows Explorer my browser opens with a message “This page can’t be displayed.”

Here is my smb.conf configuration file:

osmc@osmc:~$ sudo nano /etc/samba/smb.conf
GNU nano 2.2.6 File: /etc/samba/smb.conf Modified

read only = no

browsable = yes
read only = no
#guest ok = yes
valid users = osmc
path = /media
force user = root
comment = HDD
path = /media/HDD/shares
valid users = @users
force group = users
create mask = 0660
directory mask = 0771

Thanks for any help.

To be honest it will be not easy to troubleshoot this. I suggest you reverse all the steps you have done including deleting your smb.conf and use the Samba Server from the App Store.

1 Like

As a side note it should be \\

Geez, how embarrassing. \ \ it is. That works.

I’ve been in computer IT since 1981. Guess I never learned to look at the obvious.

Let me throw this out there. When I accessed it from Windows it asked my user name and password - both osmc. Got in OK and shows devices, hdd and osmc. I can click on devices and osmc OK and see what’s in those folders. However, clicking on hdd asks for user name and password again and osmc does not work - Access is denied.


As @fzinken said:


The trouble is you’ve now potentially got all sorts of issues, some of which will surface now (some of which probably won’t immediately …).
In this case, I’d personally suspect you’ve manually mounted the external drive by editing “/etc/fstab” and creating a mount point for the drive? OSMC (if using the Samba Server from the App Store) takes care of all that automagically for you; the drive will be mounted under “/media/...” and will be visible via Samba - I see you’ve got the drive mounted under “/media/...”, but if you manually set up that mount point then you could get into all sorts of unintended arguments with the automounter. You could also have incorrect ownership/permissions on the mounted filesystem, … all sorts of potential issues - all introduced by trying manually to set things up from a general purpose (not OSMC specific) Internet guide.

It will, almost without a doubt, be much quicker and simpler for you to go back to the beginning and use the App Store version - should then all just work for you.

Thanks. I will do that. Might even do another clean install. Compared to Windows it’s no big deal.

1 Like

Had a similar problem recently and it all boiled down to ‘permissions’.

Assume the external HD is mounted under ‘media’, that file needs to have the x flag set otherwise that folder wont get opened.

If no security issues just try sudo chmod 777 media - this of course gives read, write, execute (Or open directory) to everyone.

Maybe better use 775 which allows owner/group to read, write and open and others to read and open.


sudo chmod 777 media gets:

chmod: cannot access ‘media’: No such file or directory

That should be sudo chmod 777 /media

but you should not need to do that. Instead, check the permission on the files under /media:

$ ls -l /media