USB disk automount - permissions?

Asked by EricDHH

9.04 amd64 / i386 and before versions

If a handy, camera, usb-stick are plugged, a folder /media/disk appears and give automatically write permissions to the user. Now i plug a usb harddisk and the folder has only root:root permissions and the user cannot write to the disk. The disk seems to be mounted properly on /media/disk and i did not give a partition label to break this feature. It's formatted with ext3.

[ 7264.678094] scsi 13:0:0:0: Direct-Access MAXTOR S TM3320620A 0811 PQ: 0 ANSI: 0
[ 7264.680443] sd 13:0:0:0: [sdc] 625142448 512-byte hardware sectors: (320 GB/298 GiB)
[ 7264.696996] sd 13:0:0:0: [sdc] Test WP failed, assume Write Enabled
[ 7264.697001] sd 13:0:0:0: [sdc] Assuming drive cache: write through
[ 7264.697949] sd 13:0:0:0: [sdc] 625142448 512-byte hardware sectors: (320 GB/298 GiB)
[ 7264.699195] sd 13:0:0:0: [sdc] Test WP failed, assume Write Enabled
[ 7264.699198] sd 13:0:0:0: [sdc] Assuming drive cache: write through
[ 7264.699205] sdc: sdc1
[ 7264.723540] sd 13:0:0:0: [sdc] Attached SCSI disk
[ 7264.723637] sd 13:0:0:0: Attached scsi generic sg4 type 0
[ 7265.340553] kjournald starting. Commit interval 5 seconds
[ 7265.341232] EXT3 FS on sdc1, internal journal
[ 7265.341237] EXT3-fs: mounted filesystem with ordered data mode.

Found tips to give other permissions to /media/disk, but this folder is autocreated while hotplug. If a disk folder is created by user and set to right permissions, the automounter create disk-1 instead........

Any ideas to get this properly working? Whats the difference between handy, camera. usb-stick and this external drive?

Eric

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dominik (domfi) said :
#1

Hi Tuxzoologie,

common handys, cameras and usb-sticks use FAT as the filesystem. This filesystem does not understand the
concept of different users / groups and file permissions to these. So Ubuntu is configured to make such filesystems
owned by the user currently logged in. This is done deep down there in HAL with .fdi files, etc.

But your extaernal drive uses ext3. ext3 knows user and group permissions on files. So if an ext3 filesystem is
recognized, it gets mounted "as it is".

If you want to make the disk writable for your user do this:

- plug in the usbdisk
- let it be mounted -> a folder /media/disk is automatically created
- THEN change the owner (or permissions) of /media/disk (you must do this as root / via sudo)

After that the disk is writable for your user on your computer (even after removing and reattaching this device).

You might get trouble, if you want use your disk on another computer (maybe to exchange files with friends).
But you can handle this with adequate set of permissions. To simply use this disk to exchange files between
two or many LINUX computers (Windoze will not work with EXT3!), try this:

  sudo chmod 777 /media/disk

This will allow any user to read / write / execute all files on this disk.

Cheers,
Dominik

Can you help with this problem?

Provide an answer of your own, or ask EricDHH for more information if necessary.

To post a message you must log in.