LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 02-15-2006, 06:53 PM   #1
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Rep: Reputation: 15
ext3 partition on external USB hard drive mounted, but only root access allowed


Hi all,

I apologise if I am repeating questions already asked, but after trawling other posts I can't quite get a straight answer to this question.

My problem is as follows.

I have a 200GB Seagate external USB hard drive, that I plan to use as a backup disk. I want to keep two partitions on this disk, one formatted as VFAT (where I can keep zip files that I could recover under windows), and a second formatted as ext3 (so that I can use something like rsync to keep an exact copy of my data that can be updated incrementally).

I have managed to create and format the two partitions using fdisk. I have created the ext3 file system on the ext3 partition using mke2fs.

As I am running Fedora Core 4, HAL detects when I hook up the drive, and now creates two directories in /media; one called /SEAGATE, where it mounts the VFAT partition (/dev/sda1), and a second, /usbdisk, where it mounts the ext3 partition (/dev/sda2).

That is great, except that only the VFAT partition is mounted to allow normal users write permission. The ext3 partition is owned by root, and normal users are only given read and execute permission. What I would like to happen is that the ext3 partition would be assigned to the owner and group corresponding to the current user, and that user given full read, write and execute permission.

I have considered playing with the fstab, but the entries for this disk are automatically generated by fstab-sync, and so I expect any modifications I make will be lost during the next bootup.

So, is this a problem with the way HAL detects my second partition? Should I add a manual entry to the fstab, and if I do, will this mess with the way HAL detects other USB devices, especially if I want to use them at the same time as the hard drive?

I am running FC4 with the standard kernel.

Thanks in advance,
 
Old 02-15-2006, 08:28 PM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
Have you tried manually changing the permissions on /usbdisk? As root, just
Code:
chmod 777 /usbdisk
For more info on chmod, see the man pages, but the "777" corresponds to the "rwx" settings for each of the 3 permission levels. r = 4, w = 2, and x = 1 and thus 777 equates to rwxrwxrwx. (For illustration purposes, 744 would correspond to rwxr--r--, 666 would correspond to rw-rw-rw-, and so forth)
 
Old 02-15-2006, 08:31 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
You can change the ownership and/or group ownership on the ext3 partition using the chown command. You can also use the chmod command. If all users are members of "users" for example, you can "chgrp users /USBDISK" and give full permissions to the "users" group. You can also have distinct permissions on the directories and files inside. The fat32 partition can only have permissions set globally when it is mounted.

I think that the changes you made to the /USBDISK partition will be retained provided that it was mounted on the mount point before you made them.
 
Old 02-15-2006, 11:13 PM   #4
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Original Poster
Rep: Reputation: 15
Thanks guys,

Yes, manually changing the ownership and group allow me to write to the drive. While that is a solution, I thought that it should be possible to change the permissions that HAL sets these partitions when they are mounted. It seems to default mount everything (including my VFAT partition) with root ownership and group (which is fine), and sets the permissions to 755 (which is bad). I guess this is not an issue with the VFAT partition due to the fact that it does not recognise linux permissions anyway.

So, is thee a way to modify the behaviour of HAL to get it to mount my ext3 partition with permissions of 777 automatically? Any guidance here would be appreciated.

Thanks,

EDIT:
Sorry people, if I leave something written on the disk that was written under the modified group and ownership that I set manually, HAL seems to automatically retain those permissions when the drive is remounted at a later time. So, it seems that the problem is resolved. Thanks for all your efforts.

Last edited by leontini; 02-15-2006 at 11:19 PM.
 
Old 02-17-2006, 02:54 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
I think that you may be confusing the terms HAL and udev, unless your system is different. Although they are related, and
Take a look at the *.rules files in: /etc/udev/rules.d/

It may be better to make yourself a member of the group that the device uses rather than editing the file.

For example, suppose you plug in a usb cdrom burner. Running k3b, it doesn't show up, while it does for the root user. After making yourself a member of the "cdrom" group, it should show up.

This isn't a complete explanation. I still have a lot to learn about udev. I just tried a little experiment while typing this message. I plugged in a usb key drive. It was auto-mounted under /media/usbdisk. The /media/usbdisk was mounted with a root owner and root group owner with permissions of 'drwxrwxrwx'. Cd'ing in, the long listing indicates that I am the owner, and my default group is the group owner. I switched to vt/2 and logged in as root; then switched to vt/3 and logged in as a different normal user. For all three users, the contents of the key-drive had the user/group identical to that of the user accessing the drive. Yes, I mean simultaneously.

Last edited by jschiwal; 02-17-2006 at 03:00 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can only access USB external drive when in ROOT user bytebull Mandriva 15 01-06-2007 01:02 PM
Mounting root filesystem from an external USB hard drive? ChrisHart Linux - Laptop and Netbook 6 04-02-2005 11:49 PM
External Hard Drive --No Access as USER only ROOT (10.1) 1kyle Mandriva 1 10-31-2004 10:09 AM
External usb 2 hard drive access hangs !!! alxp Linux - Hardware 0 09-30-2004 08:44 AM
r/w permissions on a mounted ext3 hard drive harperonline Linux - Hardware 1 03-19-2003 06:22 PM


All times are GMT -5. The time now is 04:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration