Help! Mounting USB Hard Drive Permission

1 view
Skip to first unread message

Maleeq

unread,
Feb 17, 2009, 4:35:28 PM2/17/09
to ubuntunigeria
I just got an external HDD drive. The issue is that it always get
mounted as root. Thus, I just have only read access to the drive. The
file system on the drive is ext3.

I read on the ubuntuforum that I should use the chmod command to
change ownership, but must I always do that every time I connect/
disconnect the drive?

I would like to know if there is a way I can get my drive to always
get mounted as the currently logged on user.

...hope my problem statement is clear enough!! :)

Thanks

Bobby

unread,
Feb 18, 2009, 3:45:46 AM2/18/09
to ubuntu...@googlegroups.com
I tried recreating this to see what the problem is and i can confirm
that indeed an external device formatted as ext3 gives only the root
user write permission.. It seems that Hal
<http://en.wikipedia.org/wiki/Hardware_abstraction_layer> by default
mount everything with root ownership and group and sets the permissions
to 755 so that only root has permission to write. the reason you dont
get the same problem on fat32 drives (used by most usb sticks) is
because vfat does not recognise linux permissions. so even though hal
<http://en.wikipedia.org/wiki/Hardware_abstraction_layer> sets ownership
as root with 755 u wouldnt notice anything on a vfat because it would
just disregard it.. anyway the way i was able to solve the problem was
by changing the owner of the device to me

sudo chown bigbrovar /media/bigbrovar
in your case it should be
sudo chown yourusername /media/the name of the external hard drive (or
its mount point)

most external drives are always mounted as disk in /media

so it could be

sudo chown yourusername /media/disk

by doing it this way i was able to have read right permission on the usb
drive.. even when i unmounted and remounted it.

am not sure if this is the ideal way to go about it. but it does works
for me.. try it and let us know if it works.


Fanen Ahua

unread,
Feb 18, 2009, 3:58:17 AM2/18/09
to ubuntu...@googlegroups.com
In my experience, it is best to use NTFS and FAT32 for removable storage. The linux filesystem's access control measures tend to be severe annoyances on removable storage.

So, the best thing to do is to format your Huge hard drives as NTFS, and small flash drives as FAT32.

There is a FAT64 in the making, and that should pretty much solve the issue of filesystem type for removable storage devices (if microsoft will be kind enough to publish the documentation).


picFanen Ahua
Random quote: If opportunity came disguised as temptation, one knock would be enough.


> sets ownership 
as root with 755 u wouldnt notice anything on a vfat because it would 
just disregard it.. anyway the way i was able to solve the problem was 
by changing the owner of the device to me

sudo chown bigbrovar /media/bigbrovar
 in your case it should be
sudo  chown yourusername /media/the name of the external hard drive (or 
its mount point)

most external drives are always mounted as disk in /media

so it could be

sudo chown yourusername /media/disk

by doing it this way i was able to have read right permission on the usb 
drive.. even when i unmounted and remounted it.

am not sure if this is the ideal way to go about it. but it does works 
for me.. try it and let us know if it works.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ubuntunigeria" group.
To post to this group, send email to ubuntu...@googlegroups.com
To unsubscribe from this group, send email to ubuntunigeri...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/ubuntunigeria?hl=en
-~----------~----~----~----~------~----~------~--~---

signature.asc

Maleeq

unread,
Feb 18, 2009, 7:00:54 AM2/18/09
to ubuntunigeria
Hmmm, now I can modify(delete/change) files already existing on the
drive. I copied this file onto the drive through nautilus as root. But
I still cant create new files as my user.


I chose the ext3 partition cause in my work place, alot of dudes like
asking for my drive to copy files across windows machines...at least
now I can genuinely tell them their machines cant read my drive
without sounding rude! :)

--
What I did now, I dont know if its the best, is to create an entry in
the /etc/fstab with the UUID of my external drive and have it
mounted as my user all the time! Everything looks fine to me: I can
create, delete, modify files now!

Bobby

unread,
Feb 18, 2009, 7:18:24 AM2/18/09
to ubuntu...@googlegroups.com
am trying to get you .. did it work for you .. after changing ownership
of /media/yourexternaldrive did it work? were you able to add files to
the external drive as a normal user .. ?

Maleeq

unread,
Feb 18, 2009, 7:33:18 AM2/18/09
to ubuntunigeria
After changing ownership, I could only modify existing files on the
drive but could not create new folder on the root of the drive.

Creating an entry for the drive in the fstab with my userid specified
for mount took care of that. I can no create folders/files on the root
of the drive.

Further googling and I came up with another solution that seems to
work ok too:
http://techreport.com/forums/viewtopic.php?f=7&t=63072#p895059

Bobby

unread,
Feb 18, 2009, 8:02:40 AM2/18/09
to ubuntu...@googlegroups.com
one thing you could do is put an -R infront of your chown command so
that it applies changes recursively .. so the cmd would be like this
sudo chown yourusername -R /media/externalharddrive
that way everything in the drive would be owned by you..

Maleeq

unread,
Feb 18, 2009, 8:15:23 AM2/18/09
to ubuntunigeria
Yeah, I noticed you omitted the -R switch in your initial post, but I
included it and still could not create files on the root of the drive
but had full control within the existing folders...I could create new
directories in the existing ones.

Bobby

unread,
Feb 18, 2009, 10:10:07 AM2/18/09
to ubuntu...@googlegroups.com
hmm i remember now having that problem .. i think its a delay issue ..
it went away when i refreshed nautilus .. you could refresh nautilus ..
or try creating a file from cli
Reply all
Reply to author
Forward
0 new messages