This has been asked before (I could link to 3 other posts I've seen here), but none of them have been answered.

I've followed this tutorial on how to set up a NAS using Samba with a Raspberry Pi. Everything works okay, the drive and files show up, I can log in fine (though only once, Windows apparently keeps me logged in after that?). The only problem I'm having is that I can't write to it. I can't create a folder or copy a file to it or anything.

I've never used any sort of Linux code, so while I'll try to help you help me in any way I can, I'd really appreciate examples of any code you'd like me to run. In general though, almost everything is set up like in the tutorial, apart from a file name, username, and one or two numbers I've tried changing that other guides have suggested (to no avail).

User and group info (id command):

uid=1001(Connor) gid=100(users) groups=100(users)

Contents of /etc/fstab:

proc /proc proc defaults 0 0 
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1 
/dev/sda /media/pi auto defaults,noatime 0 0


Destination folder access denied.

Any help appreciated.

  • what permissions have you set on the NAS share? who owns the share folder you are trying to write to. You mention logging in with Windows is this a real NAS or a windows share? What version of windows are you using? If using windows does the same user exist on both sides of the connection? Can you read from the NAS? Commented Dec 17, 2015 at 4:23
  • I'm pretty sure read, write and execute permission has been granted everywhere I can. Anywhere where the numbers are involved, I used 0777. I should own the file, but I'm not sure. I'm using windows 7, and I don't know what windows share is, but shouldn't it not work with a Pi anyway, as they don't run windows? I'm logged in as the user and have permission to read and browse the folders.
    – Pihelp
    Commented Dec 17, 2015 at 16:04
  • running id gives: uid=1001(Connor) gid=100(users) groups=100(users) /etc/fstab is: proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults 0 2 /dev/mmcblk0p2 / ext4 defaults,noatime 0 1 /dev/sda /media/pi auto defaults,noatime 0 0
    – Pihelp
    Commented Dec 17, 2015 at 16:05
  • It's a USB stick formated as FAT32. Apologies for the format of the code I posted above, this site seems to put everything on the same line, ignoring how it was typed.
    – Pihelp
    Commented Dec 18, 2015 at 17:50

1 Answer 1


Make a quick test - change permissions to the root folder of USB disk:

sudo chown -R your_samba_user /you_usb_disk_mount_path

and restart samba:

sudo /etc/init.d/samba restart

If that helped it means the write permissions of mount folder were wrong. That might be helpfull: https://askubuntu.com/a/229427

  • First of all, thanks. But chown isn't working. It says changing ownership of '/media/pi': operation not permitted. Could it be because it's currently still mounted? Or does it being FAT32 change anything? I'm the only user, with root privallages and can use the sudo command with everything else (from editing the sudo file) and the default user 'pi' has been deleted.
    – Pihelp
    Commented Dec 17, 2015 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.