Bergie5737
Posts: 17
Joined: Sun Jun 17, 2012 4:09 pm

Unable to write to USB disk

Mon Jul 09, 2012 7:30 pm

I have set-up my USB disk as NAS. I can read it with a Linux, Windows and even my Android phone on wifi as well as over internet via FTP.

Problem is I cannot do any changes to the files on the disk. I've followed the wiki to the letter and searched high and low, but I simply cannot get a solution. (I have no problems with writing to a flash disk.)

I created and mounted the disk as /media/samsungdisk. Its also in fstab, as vfat, and it does mount correctly at boot. The samba server start as expected.

The below commands does not change any permissions.
sudo chown -R root:users /media/samsungdisk
sudo chmod -R ug=rwx,o=rx /media/samsungdisk
ls -l
give rwxr-xr-x. I've also tried to change only one file's permission, but it stay the same. Plugging the USB disk into an ubuntu machine, and I can read and write.

Any help will be much appreciated.

scorp
Posts: 96
Joined: Tue May 29, 2012 6:21 pm

Re: Unable to write to USB disk

Tue Jul 10, 2012 7:36 am

sudo chmod -R 777 /media/samsungdisk
worked for me

Bergie5737
Posts: 17
Joined: Sun Jun 17, 2012 4:09 pm

Re: Unable to write to USB disk

Tue Jul 10, 2012 8:13 am

Yes, I did try that as well.
In a windows machine I found that the disk only show up half its actual size, while Linux (Gparted) see the disk as I expect. There was a bootable flag set on the disk. I've decided to reformat the disk and will try again. Will post the results if it made a difference, now to do all the back-ups first... Sigh... :(

Bergie5737
Posts: 17
Joined: Sun Jun 17, 2012 4:09 pm

Re: Unable to write to USB disk

Tue Jul 10, 2012 12:03 pm

I've formatted the disk, mounted and still unable to write to it.

I can create a directory with sudo, but even the newly created directory won't allow me to change permissions. I always get "Operation not permitted" when I do chmod. It makes no difference which method I use.

I can do file operations only via command line with sudo, obviously not what I plan to do.

Looks like I can shelve my NAS plan for the time being.

fendersk8911
Posts: 10
Joined: Mon Mar 05, 2012 7:50 pm

Re: Unable to write to USB disk

Tue Jul 10, 2012 3:11 pm

Try changing the permissions of the /media folder. I've had this problem before

Bergie5737
Posts: 17
Joined: Sun Jun 17, 2012 4:09 pm

Re: Unable to write to USB disk

Wed Jul 11, 2012 10:02 am

Thank you.
I did just that, remounted the disk, changed permissions and was able to write to the disk for a while until automount. Then all of a sudden it was gone.

I realised that my fstab must be missing something. Searching searching and eventualy I found an entry that solved my problem. I add "umask=0" and removed the "default" as per the Raspi wiki.

All is working fine now straight from boot.

Your suggestion was the nudge I needed!

I found the Raspi wiki mostly confusing and often that it is inadequate for beginners like me. I now have a list as long as my arm of things I have to do "differently" than stock set-up to get myself going.

Next up, WiFi... :idea:

fendersk8911
Posts: 10
Joined: Mon Mar 05, 2012 7:50 pm

Re: Unable to write to USB disk

Wed Jul 11, 2012 2:15 pm

Good deal, glad you were able to get it working :) Good luck with the Wifi!

Daddyfix
Posts: 52
Joined: Sun Dec 09, 2012 2:13 pm
Location: Sudbury, Ontario

Re: Unable to write to USB disk

Sun Dec 09, 2012 2:17 pm

I am having the same problem with permissions to the USB. I looked in the raspi Wiki for directions for this problem but I can't find them anywhere.

Does anyone know what exactly to change in the /etc/fstab? Please provide a link to the rasp wiki entry if you find it.

Thanks,
I Love my Rpi

stevhorn5
Posts: 116
Joined: Wed Jul 04, 2012 5:47 pm
Location: Ontario, Canada

Re: Unable to write to USB disk

Wed Dec 19, 2012 1:23 am

Install usbmount (to auto mount the drive)

Code: Select all

sudo apt-get install usbmount
Format the drive as ext4 with gparted

Code: Select all

sudo apt-get install gparted
Find the path to the drive (probably /media/usb0)

Set ownership

Code: Select all

sudo chown pi:pi /media/usb0

Daddyfix
Posts: 52
Joined: Sun Dec 09, 2012 2:13 pm
Location: Sudbury, Ontario

Re: Unable to write to USB disk

Wed Dec 19, 2012 1:26 am

Thanks. This solved my problem.

User avatar
pabile
Posts: 1
Joined: Wed Oct 17, 2012 1:45 am
Location: Philippines
Contact: Website

Re: Unable to write to USB disk

Wed Dec 26, 2012 7:42 am

I add "umask=0" and removed the "default" as per the Raspi wiki.
could you post the wiki link you mentioned here please. i could not seem to find it.

wanted to try:

Code: Select all

sudo apt-get install usbmount
but gives me a 404 error :(

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: Unable to write to USB disk

Wed Dec 26, 2012 11:29 am

pabile wrote:
I add "umask=0" and removed the "default" as per the Raspi wiki.
could you post the wiki link you mentioned here please. i could not seem to find it.

wanted to try:

Code: Select all

sudo apt-get install usbmount
but gives me a 404 error :(
You may want to try

Code: Select all

sudo apt-get update
and then try again
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

Return to “Networking and servers”