Len Lawrence wrote:
> I have a tiny USB flash drive with 32Gb of storage, originally
> formatted as FAT32 (probably). This was used regularly for backups
> which included some large files, ~100Mb or more, all of which seem to
> have been corrupted. My guess was that the drive or the file system
> could not cope with large files so tried to reformat it as ext3, not
> realising that the "other" option in diskdrake lets you choose Linux
> native (ext2). To cut a long story short I eventually managed to set
> up a clean ext2 system on the drive but then found that only root
> could write to it. The only way to get round that was to change the
> ownership on the mount point, something which seems to have been
> necessary for another drive at some time:
>
> ls -l /media -->
>
> drwxr-xr-x 2 root root 4096 2008-05-18 06:27 cdrom/
> drwxr-xr-x 16 root root 4096 2008-09-07 21:18 disk/
> drwxr-xr-x 3 lcl root 4096 2009-08-02 19:04 disk-3/
> drwxr-xr-x 22 lcl root 6144 1970-01-01 01:00 LaCie/
>
> Extract from mtab:
>
> /dev/sdb1 /media/disk ext3 rw,nosuid,nodev,uhelper=hal 0 0
> /dev/sdh1 /media/disk-3 ext2 rw,nosuid,nodev,uhelper=hal 0 0
>
> disk-3 is the reformatted flash disk with exactly the same mount
> attributes as disk which is accessible to users even though root owns
> the mount point. What gives? While it contained a FAT system the
> flash disk presented no such problem.
>
It is working as expected now after three days tinkering. No real
idea which action enabled it but now hal mounts it as a user
accessible storage device and hal dismounts work. I had tried
diskdrake, fdisk and finally mkfs.ext2. Somewhere along the line I
gave the device a label so it now mounts on /media/<label>
automagically. It did not work properly on my 2008.1 system until I
plugged it into a 2009.1 laptop (no problem there at all). When it
came back to the 2008.1 system all was well. None of this stumbling
about illuminates this issue for anybody else. It seems to be purely
a random thing whether a reformatted disk is properly set up or not.
Other devices have rarely given me any problems.
ls -l /media
drwxr-xr-x 16 root root 4096 2008-09-07 21:18 disk
drwxr-xr-x 2 root root 4096 2009-02-24 07:36 disk-1
drwxr-xr-x 2 root root 4096 2009-02-24 07:49 disk-2
drwxr-xr-x 3 lcl root 4096 2009-08-04 12:11 flash
drwxr-xr-x 22 lcl root 6144 1970-01-01 01:00 LaCie
Note here that the flash and LaCie mount points are volatile and are
owned by lcl. /media/disk is also volatile but owned by root and
maintains its permissions through a hal dismount and remount. Is that
a bell ringing? That particular device is always plugged in at boot
time so I guess it must be mounted before user login. Maybe the mount
point gets assigned to root by default because there is no other user
on the system at that time. That deserves an experiment.
OK, checked the 2009.1 laptop with an external USB drive connected at
boot time. Nope. The mount point has user permissions, so that
theory is wrong. Does anybody have any explanation for all this?