Hello forum

How can I get my USB external hard drive to mount as non root? I am using diskdrake to mount it (me being the owner) and this drive has a NTFS file system. The only way I can view the contents of this hard drive is to log on as root, which is a big inconvience.

This drive's folder in /mnt also has a padlock on it and I get a "permission denied" message when I try to access it.

I can, however, access this external USB hard drive as non root by putting "unmask=0022" in the corresponding line in fstab, but when I reboot, HAL and fstab-sync will auto generate a new line in its place, putting me back where I first started. (More about how this feature works can be found by typing "man fstab-sync" in a terminal window). Unmask=0022 allows ordinary users to view the contents of this drive.

I have another USB external hard drive with a fat32 file system and it mounts as non root with no problem.

I have tried using the chmod command, the chown command, and I have tried creating a custom rule using msec (making me the owner) for this hard drive's folder in the mnt directory but none of this worked.

It is my understanding that I can write a custom fdi rule in the /usr/share/hal/fdi/95userpolicy folder to correct this problem but I don't know how to do that.


Can anybody here please help me mount this USB external hard drive (ntfs) as non root? I am using Mandriva 2006.

Any help would be most appreciated.

Roy S. Smith

alc6379 commented: excellent work! +6

SUPPLIMENT -

In summary, my main desire is to be able to change the owner of this drive from root to myself. If I could do this, I wouldn't have to insert "unmask=0022 in fstab because it would be readable anyway.

If I can't change ownership of this drive to myself instead of root, then I want to be able to insert "unmask=0022" in fstab so that it will stay after a reboot. HAL keeps changing it back.

SUPPLIMENT -

In summary, my main desire is to be able to change the owner of this drive from root to myself. If I could do this, I wouldn't have to insert "unmask=0022 in fstab because it would be readable anyway.

If I can't change ownership of this drive to myself instead of root, then I want to be able to insert "unmask=0022" in fstab so that it will stay after a reboot. HAL keeps changing it back.

Update

I finally fixed my problem and did not have to disable HAL. I simply edited the /usr/share/hal/fdi/90defaultpolicy/storage-policy.fdi file by adding a few lines. I added umask=0022, owner, and user, each with its own line. Now HAL will automatically add these three entries in fstab after each reboot. Now the computer boots up with the problem drive already mounted and accessable as non-root.

They don't recommend editing the storage-policy.fdi file because it will be overwritten by any software updates. You are supposed to create your own custom fdi rule and put it in the /usr/share/hal/fdi/95userpolicy directory. But since I don't know how to write my own custom fdi rule, I just edited the storae-policy.fdi file instead.

I hope this will help anybody else who can not access a USB ntfs external hard drive as non root due to HAL kicking out any changes made in fstab.

PS - I had been spelling umask wrong. I was spelling it unmask when it should have been umask.

Roy S. Smith

Excellent job!

I've never used Mandriva before, so I was unaware of their policies on changing things like fstab entries. What ever happened to just "Keep it Simple, Stupid"? /etc/fstab has worked for years, no need to go mucking about with it now, IMHO.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.