Dynamically mounted ext3 file systems are not writable by users

Bug #382074 reported by Ricardo Pérez López
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
NULL Project
Invalid
Undecided
Unassigned
hal (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: hal

A friend of mine (an average Ubuntu Jaunty user) recently bought a new internal SATA hard disk. After installing and formatting it with ext3 filesystem, he complains about Ubuntu mounts it with read-only permissions, so he can't write anything on it.

Steps to reproduce:

1. Install a new internal SATA hard disk into the computer.
2. Use Gparted to create a new ext3 partition into it.
3. Restart hal or reboot. The new drive is displayed in Places->Computer.
4. Click on the drive to mount it.

Result:

- The drive is mounted read-only. You can't create any folder or file on it.
- The mount point is /media/disk, with "root" owner, "root" group and "rwxr-xr-x" permissions.

WORKAROUNDS:
==========

1) Change the default permissions to 777:

  $ sudo chmod 777 /media/disk

Since then, you have full write access to the new drive, and hal "remembers" the new permissions, so the write access is granted every time you reboot, and you don't need to retype the chmod command every time.

2) Change the default owner to $USER:

  $ sudo chown $USER /media/disk

This is what hal already does when you insert a FAT32 volume (i.e. an USB pen drive or an SD card).

Therefore, I think hal should do any of the above by default on the mountpoint of any new hard disk drive, like /media/disk and so. Without that, an average user will not have full read/write access to the new drive, minimizing his/her user experience and maximizing his/her frustration.

Revision history for this message
Alexander Gabriel (einalex) wrote :

I can see the same behavior here.

Since you need a special permission to mount devices (you get asked for that the first time you try to mount sth and have to give a password to sudo or get root). These mounted devices should be mounted with user:usergroup rights. This is also consistent with the handling of USB mass storage devices.

Revision history for this message
Martin Pitt (pitti) wrote :

This is not a problem in hal/devicekit/etc., but an inherent property of ext3. Unix file systems like ext[234], jfs, etc. all assign owners and groups to files. If you use ext3, you need to create a folder on it which belongs to you.

For a lot of foreign file systems, in particular the ones which don't have a concept of owners (vfat, iso9660, etc.) we can mount them with the uid/gid options, but these do not exist for ext3.

Changed in hal (Ubuntu):
status: New → Invalid
Revision history for this message
Martin Pitt (pitti) wrote :

BTW, this is totally independent of fixed vs. removable drives. It just happens that the latter often use vfat.

summary: - New hard disk drive mounted read-only by default
+ Mounted ext3 file systems are not writable by users
Revision history for this message
Ricardo Pérez López (ricardo) wrote : Re: Mounted ext3 file systems are not writable by users

Martin, although you're right about this Unix filesystems nature, hal is now automounting them in a dynamic mountpoint (like /media/disk), and so it is the responsible of assigning the right permissions on that mountpoint. The problem is that the permissions are too strong, so anybody except root couldn't write on the filesystem.

The workaround could be to fix hal so it assigns 777 permissions BY DEFAULT in the mountpoint, so the filesystem have read/write permissions *by default* into the filesystem to anybody. Later, if the sysadmin wants, he could do chmod, chown or even touch the /etc/fstab file if he wants to fine-tune the mount permissions & options, weakening the default permissions.

Mat Tomaszewski (mat.t.)
Changed in hundredpapercuts:
status: New → Invalid
Revision history for this message
Ricardo Pérez López (ricardo) wrote :

Another workaround could be to fix hal so it changes mountpoint owner dynamically to the user's UID, keeping the 755 permissions.

description: updated
summary: - Mounted ext3 file systems are not writable by users
+ Dynamically mounted ext3 file systems are not writable by users
Revision history for this message
Bartek Celary (karaphka) wrote :

I wonder why this bug is marked invalid? (I might be missing something about status meanings though...)

I just had my sister complain to me that she is not able to backup her photos to the external hard drive she just bought and formatted with gparted. I'm afraid this needs to be addressed and fixed for the average user to just work like expected - that is full write access to dynamically connected USB drive (no matter which file system is used). Another thing is that there should be a way to format an external unformatted media when inserted (which is a different story obviously)...

Revision history for this message
Sergei Andreev (seajey) wrote :

>I wonder why this bug is marked invalid?

+1
It' seems to be true usability bug, maybe making it one of the hundred pappercuts will help to resolve it?

Vish (vish)
affects: hundredpapercuts → null
Revision history for this message
ZhengPeng Hou (zhengpeng-hou) wrote :

http://lists.freedesktop.org/archives/hal/2009-April/013166.html

for desktop usage, this kind of scenario is very common, should have a workaround . at least its not a matter to hfs/hfs+ under OS X.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.