New IT forum Follow us on Twitter
22 May 2012, 09:26:43 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: TonidoPlug2 - Now in stock!
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: USBdrive : Write permission for user  (Read 2420 times)
Baz
Newbie
*
Posts: 15


« on: 15 February 2010, 09:37:22 pm »

As root I can mount a usb stick and read existing (windows) files, write new stuff etc.
User can read too, but not write.
I tried adding to /etc/fstab as recommended elsewhere
/dev/sda /mnt/usbstick vfat user 0 0
hoping the user can write if it does the mount, but I get 'mount: only root can do that'.
I have tried various combinations in the options like rw or mode=1777 but the permissions for user stay as r-x.

I tried getting the uuid for the drive with ls /dev/disk/by-uuid and putting that instead of /dev/sda.

The only thing I haven't done is remove the stick inbetween attempts.
Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #1 on: 15 February 2010, 09:55:20 pm »

What are the permissions for /mnt/usbstick ?
Logged
Baz
Newbie
*
Posts: 15


« Reply #2 on: 16 February 2010, 12:43:26 am »

drwxr-xr-x 7 root root 16384 Jan  1  1970 usbstick

All the files are the same.
chmod and chown don't do anything either.
Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #3 on: 16 February 2010, 08:33:29 am »

Baz -

It would help if you explicitly provide the commands that you are typing and their results. I bet chown myuser:myuser /mnt/usbstick does something. I bet it produces the following output:

Code:
chown: changing ownership of `/mnt/test': Operation not permitted

In this case you need to use sudo again:

Code:
sudo chown myuser:myuser /mnt/usbstick
Logged
kesey
Newbie
*
Posts: 16


« Reply #4 on: 16 February 2010, 08:48:26 am »

You might try the following.

NOTE: For Webmin/Others/File Manager to work, you must first have Java installed on your laptop/desktop.

1: Install Webmin on your Sheevaplug.
apt-get install webmin

2: Log into Webmin from your laptop/desktop using address <sheeva_ip_address>:10000
(enter your  Sheeva's ip address without the brackets).



You can easily allow changing of File Permissions by setting check boxes in Webmin (from your laptop), if you have it installed on your Sheeva. When you have done your writing/file transfer etc, you can uncheck the boxes and so stop your music files getting changed by mistake. Then again you may choose to allow yourself full time write permission if you wish by leaving the boxes checked.
Re Webmin: To change file permissions, go into Others, File Manager and then select the directory in which you store your Music. In my case, this is ext3_tunes. Click on "Info" in the menu bar of Webmin, and this will allow you change file permissions.
« Last Edit: 16 February 2010, 08:53:13 am by kesey » Logged
Baz
Newbie
*
Posts: 15


« Reply #5 on: 16 February 2010, 04:55:32 pm »

Thanks Martin, l wonder if I got the syntax wrong.
Kesey I tried your suggestion and it pretended to change the permissions but it was just the java local memory showing it had changed. When I went out and back in they had not changed. When I tried to change the ownership it said 'chown: action not permitted'.

I have been able to try webmin from work (luckily got a stand alone modem as the corporate network is blocked) but I forgot to enable SSH on my firewall at home so can't do that. Is it just port 22 I need to open?
Logged
KeithS
Newbie
*
Posts: 20


« Reply #6 on: 16 February 2010, 05:13:25 pm »

I tried to replicate the fault, but its fine for me using the same mountpoint as you.

I assume you arebehind a NAT? If so, then just redirect port 22 traffic on your router to the plug. If the plug is connected direct to the internet, then it can get a little more complicated getting firewall rules correct, but webmin is a godsend for firewall stuff.
Logged
Baz
Newbie
*
Posts: 15


« Reply #7 on: 16 February 2010, 11:42:23 pm »

I tried mounting a different stick but still no joy:

root@Beeshed:~# sudo chown baz:baz /mnt/usbstick
chown: changing ownership of `/mnt/usbstick': Operation not permitted
root@Beeshed:~# sudo chmod u+w /mnt
drwxrwxrwx 2 root root    0 Jan  1  2000 tmp
drwxr-xr-x 5 root root 4096 Jan  1  1970 usbstick

with or without sudo surely root shouldn't be disallowed from doing anything.

Have to try the IT favourite 'reboot it'.
Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #8 on: 17 February 2010, 12:01:55 am »

http://www.linuxforums.org/forum/debian-linux-help/58375-chown-chmod-operation-not-permitted.html
Logged
Baz
Newbie
*
Posts: 15


« Reply #9 on: 17 February 2010, 01:43:16 am »

I found something that works
http://www.linuxquestions.org/questions/slackware-14/chmod-external-usb-vfat-cant-chmod-a-directory-431058/

apparently Vfat drives can't be changed after mounting, so the entry in fstab has to be just right.
/dev/sda1 /mnt/usbstick vfat rw,umask=0000 0 0
/dev/sda /mnt/usb vfat rw,umask=0000 0 0

Thanks for the help. It probably only arises with ex windows drives.
Logged
kesey
Newbie
*
Posts: 16


« Reply #10 on: 17 February 2010, 12:58:08 pm »

Nice find Baz. I'll have a look to see if this applies to NTFS files on USB also.
Logged
KeithS
Newbie
*
Posts: 20


« Reply #11 on: 17 February 2010, 01:10:23 pm »

fdisk shows the following for my stick, so it would appear that this is ok if it helps anyone

Code:
System
W95 FAT32 (LBA)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!