Iomega drive mounted with root priveledges

Hi, my Iomega drive is being mounted as root so I’m unable to write to it as my user. I tried a 4G usb stick and that mounts as my user. Why isn’t the Iomega drive being mounted the same way? Is there a setup I’m missing?

% ll /media/
total 20K
drwxr-xr-x 3 timothy root  16K 1969-12-31 16:00 disk/
drwxr-xr-x 3 root    root 4.0K 2010-01-28 09:16 Iomega HDD/

I had an issue like this with an encrypted external USB-HDD. It would decrypt correctly but mount as root with me as user being able to see what was on it but unable to write.
Problem, it was on 11.1 and the responsible software was HAL. If you have this asset, you can solve as follows. You go to start, open a session of “file-manager” with superuser rights (do NOT log in as root into the GUI) and you go into media. There you choose properties of your Iomega and grant to you as user right access. After reboot HAL will remember this. This for KDE 3.5 and 11.1. I have heard that in 11.2 it is not HAL any more managing external devices. In this case somebody else may help you out.
Have fun.

On 1/28/2010 11:56 AM, stakanov was rumored to have said:
>
> I had an issue like this with an encrypted external USB-HDD. It would
> decrypt correctly but mount as root with me as user being able to see
> what was on it but unable to write.
> Problem, it was on 11.1 and the responsible software was HAL. If you
> have this asset, you can solve as follows. You go to start, open a
> session of “file-manager” with superuser rights (do NOT log in as root
> into the GUI) and you go into media. There you choose properties of your
> Iomega and grant to you as user right access. After reboot HAL will
> remember this. This for KDE 3.5 and 11.1. I have heard that in 11.2 it
> is not HAL any more managing external devices. In this case somebody
> else may help you out.
> Have fun.

I’m running 11.2 and KDE 4.3 and I’m not sure what app is responsible. I
fear your correct and it’s not HAL. Maybe I need to fiddle around the
the fstab file. Not sure, so I’m hoping someone will respond with the
solution.

I do not have the definite answer. In 11.2 it is DeviceKit that does the mount and not HAL (as @stakanov correctly explained).

I can also add that using /etc/fstab and HAL (and I may hope also DeviceKit) are mutualy exclusive. To be more precise: When HAL finds that a device has an entry in /etc/fstab, it decides that it should keep its fingers off. I hope DeviceKit does likewise.

This could be a bypass for you. Define the device in /etc/fstab (preferable by using a /dev/disk/by-label/ device file or one of its brothers). Add a *noauto *option to avoid mounting during boot (when the device is not there). You can then, after the device is connected, use (as root, but a appropriate *sudo *configuration can make this available to the enduser) mount.

On 1/28/2010 1:16 PM, hcvv was rumored to have said:
>
> I do not have the definite answer. In 11.2 it is DeviceKit that does the
> mount and not HAL (as @stakanov correctly explained).
>
> I can also add that using -/etc/fstab- and HAL (and I may hope also
> DeviceKit) are mutualy exclusive. To be more precise: When HAL finds
> that a device has an entry in -/etc/fstab-, it decides that it should
> keep its fingers off. I hope DeviceKit does likewise.
>
> This could be a bypass for you. Define the device in -/etc/fstab-
> (preferable by using a -/dev/disk/by-label/- device file or one of its
> brothers). Add a -noauto -option to avoid mounting during boot (when the
> device is not there). You can then, after the device is connected, use
> (as root, but a appropriate -sudo -configuration can make this available
> to the enduser) -mount.-
>
>
Can you provide an example fstab file that shows this? Thanks.

So I’ve been trying a few things.

a. I created a directory in /media

% mkdir /media/Iomega_eGo

b. then I changed owner to myself

% chown -R timothy /media/Iomega_eGo

c. edited the /etc/fstab file and added the following line:

/dev/disk/by-id/usb-ST310005_20AS_5080FFFFFFFF-0:0-part1 /media/Iomega_eGo    auto       noauto,user           0 0

d. then I typed mount -av and I get the following:

% mount -av
mount: proc already mounted on /proc
mount: devpts already mounted on /dev/pts
mount: /dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1EP926650-part4 already mounted on /home
mount: /dev/disk/by-id/ata-Maxtor_6Y060L0_Y2T65RWE-part1 already mounted on /data1
nothing was mounted

I didn’t get mounted. I’m guessing because I used noauto. So I removed that and try again and it mounts it… as root! Once I umount the ownership goes back to timothy. If I manually mount I get the same behavior. This is frustrating! For the love of God, is there any way to have this HDD mount so I can write to it as regular user!

What filesystem is on it, FAT? Try adding uid=timothy,gid=users to the options field in that fstab line.

The users options doesn’t mean mount it as a user (which one?). It means that a user can initiate the mount. It should work if you issued the mount as yourself instead of root. But uid= and gid= should force the user id.

No, it’s ext4. I tried you suggestion and now I can mount as root by doing:

% mount /dev/sdc1 /media/Iomega_eGo

That works. But now dolphin cannot mount it. I get the following from dmesg:

 4386.645790] kjournald2 starting: pid 6654, dev sdc1:8, commit interval 5 seconds
 4386.646431] EXT4-fs (sdc1): internal journal on sdc1:8
 4386.646472] EXT4-fs (sdc1): delayed allocation enabled
 4386.646491] EXT4-fs: file extents enabled
 4386.881590] EXT4-fs: mballoc enabled
 4386.881622] EXT4-fs (sdc1): mounted filesystem with ordered data mode
 4449.214387] EXT4-fs: mballoc: 0 blocks 0 reqs (0 success)
 4449.214423] EXT4-fs: mballoc: 0 extents scanned, 0 goal hits, 0 2^N hits, 0 breaks, 0 lost
 4449.214444] EXT4-fs: mballoc: 0 generated and it took 0
 4449.214460] EXT4-fs: mballoc: 0 preallocated, 0 discarded
 4461.333091] EXT4-fs (sdc1): Unrecognized mount option "uid=1000" or missing value
 4468.846713] EXT4-fs (sdc1): Unrecognized mount option "uid=1000" or missing value

So why would it work from the cli, but not from the file manager (dolphin).

If it’s ext4 (or any Linux filesystem), the rules are completely different.

FAT has no ownership info, so the file ownership is faked from a combination of the mounter’s id and any uid= and gid= options.

Linux filesystems contain real-to-goodness ownership information, and so objects in it belong to the owner specified for that object in the filesystem. The uid= and gid= options are not valid, hence the warning. So take the uid= and gid= options out.

If you want the top directory to be owned by you, do a chown timothy:users /media/Iomega_eGo after the mount. You could also create subdirectories and give the ownership to yourself and then you can do what you want underneath. And it will persist.

Sorry I can’t explain the difference between CLI mounting and dolphin, I don’t use dolphin so I don’t know what it is doing.

I think I have it right now. I missed a key step: when I changed owner of the mount point the drive has to be mounted! Here’s part b updated:

% mount /dev/sdc1 /media/Iomega_eGo
% chown -R timothy /media/Iomega_eGo
% ghgrp -R users /media/Iomega_eGo

I’ve tested this and it mounts for both the cli (manually) and thru the file manager (dolphin).

Thanks.

You and I were posting at the same time. But thanks for posting; you’ve confirmed what I stated.