You are not logged in.

#1 2010-07-02 21:09:18

willl
Member
Registered: 2009-03-27
Posts: 4

USB Hard drive, permission issue on one partition

Hi,

I have an issue with my USB hard drive, when I pluged it the 3 partitions are mounted, and 2 of them grant access to the users group:

mount 
/dev/sdc6 on /media/usbhd-sdc6 type ext2 (rw,relatime)
/dev/sdc1 on /media/usbhd-sdc1 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdc5 on /media/usbhd-sdc5 type vfat (rw,relatime,utf8,gid=100,umask=002)
ls -l /media/
drwxrwxr-x  1 root users  4096 Jun 29 22:21 usbhd-sdc1
drwxrwxr-x 18 root users 16384 Dec 31  1969 usbhd-sdc5
drwxr-xr-x  3 root root   4096 Jun 29 22:21 usbhd-sdc6

I read the wiki page about udev, but I can not solve this issue.

PS : HAL is removed from my daemons list.

Offline

#2 2010-07-02 21:33:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: USB Hard drive, permission issue on one partition

http://wiki.archlinux.org/index.php/USB … with_mount
/mnt/usb is mounted w/ 'sudo mount -o rw,noauto,async,user,umask=1000 /dev/sdb1 /mnt/usb' - normal user can write w/o a problem.

[karol@black test]$ ls -l /mnt
total 12
drwxrwxrwx 11 root root 8192 1970-01-01  usb
drwxr-xr-x  2 root root 4096 2009-09-14  usb2

Last edited by karol (2010-07-02 21:35:05)

Offline

#3 2010-07-02 22:18:24

willl
Member
Registered: 2009-03-27
Posts: 4

Re: USB Hard drive, permission issue on one partition

Hi,
thank you for your answer,
unfortunately it does not solve the issue :

sudo mount -t ext2 -o rw,noauto,async,user,umask=1000 /dev/sdc6 /mnt/test
cp LICENSE.txt /mnt/test/
cp: cannot create regular file `/mnt/test/LICENSE.txt': Permission denied

And I belong to the users group :

groups
lp wheel dbus hal video audio optical storage power users vboxusers will

PS :
I just test with an USB stick and :

ls -l /media/
drwxrwxr-x  5 root users 16384 Jul  2 18:06 FLASH 512

It also belongs to the users group.
You can write on "usb" because the right are : drwxrwxrwx

Last edited by willl (2010-07-02 22:20:07)

Offline

#4 2010-07-02 22:45:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: USB Hard drive, permission issue on one partition

> You can write on "usb" because the right are : drwxrwxrwx
They appear only when I use 'sudo mount -o rw,noauto,async,user,umask=1000' instead of plain 'sudo mount /dev/sdb1 /mnt/usb2'.
I use vfat for that USB stick, so maybe that's why it works for me. The first two listings in your first post show the drives in different order, but of course the mountpoints show that the offending drive is ext2 not vfat, my bad.

Edit: This is how my ext3 USB stick behaves like:

[karol@black test]$ sudo mount /dev/sdb1 /mnt/usb
[karol@black test]$ mount | grep sdb1
/dev/sdb1 on /mnt/usb type ext3 (rw)
[karol@black test]$ ls -l /mnt
total 8
drwxr-xr-x 2 karol users 4096 07-03 01:08 usb
drwxr-xr-x 2 root  root  4096 2009-09-14  usb2

This time /mnt/usb is an ext3. As you can see, there's no root, I (karol) an the owner, so I can rw to my heart's content. Maybe you should change the ownership - 'chown' (man chown if you're not familiar w/ that command).

Last edited by karol (2010-07-02 23:05:52)

Offline

#5 2010-07-03 14:13:30

willl
Member
Registered: 2009-03-27
Posts: 4

Re: USB Hard drive, permission issue on one partition

Hi.

yes I "manually" solved my issue with : generating a random UUID with tune2fs, and add a rule in /etc/fstab (and fixed access right for the users group),
but that was not the way I excepted to solve the problem, is there any way to solve it for all the ext2 and ext3 (I did a test yesterday, and I have the same issue) partitions ?

Thank you.

Last edited by willl (2010-07-03 14:13:42)

Offline

#6 2010-07-03 14:26:30

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: USB Hard drive, permission issue on one partition

As you can see in my previous post I don't have problems w/ ext2/3 at all. vfat filesystem is a bit tricky since it's not a linux fs, but I don't have a problem w/ it either.

> is there any way to solve it for all the ext2 and ext3
Format partitions and create the dir structure w/ the correct permissions and you'll be fine.

> and add a rule in /etc/fstab
Using fstab for removable devices is considered The Wrong Way (but yeah, it should work).

Offline

Board footer

Powered by FluxBB