LinuxQuestions.org
Review your favorite Linux distribution.
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 08-01-2004, 11:20 AM   #1
jpen8560
LQ Newbie
 
Registered: Jul 2004
Location: Memphis, TN
Distribution: RH 9, AS 2.1
Posts: 8

Rep: Reputation: 0
Not able to set write permissions on external hard drive.


I am a newbie to Linux (somewhat) and forum use, so please bear with me if I violate the ways of doing things. Here it goes.


I just purchased a Maxtor 160GB External Hard Drive and I am using a Fire Wire to access it.

As "root" I can mount, read, and write just fine, but when I try to use it as another user I can only read and execute. Viewing the permissions, of course, I see the following.

drwxr-xr-x 3 root root 32768 Dec 31 1969 fire0

As root, I have tried issuing chmod 777 and I get this message:

[root@cinnamon root]# chmod 777 /mnt/fire0/
chmod: changing permissions of `/mnt/fire0/' (requested: 0777, actual: 0755): Operation not permitted

I have a line in my fstab to auto mount on boot, which works.

/dev/sda1 /mnt/fire0 auto auto,user,owner,rwx 0 0

Has anyone had this challenge and conquered it? How do I allow other users to use this device? Your expert advise and experience is appreciated.


John
 
Old 08-01-2004, 12:34 PM   #2
slackMeUp
Member
 
Registered: Nov 2003
Distribution: Slack-where?
Posts: 654

Rep: Reputation: 30
What file system is it?

I use vfat for my external drive. . . so I can access it on any windows box and Mac OS box.

With vfat. . . I use this fstab line:

Code:
/dev/sda1  /mnt/usb1 vfat  umask=0,defaults  0  0

The umask=0 option is what lets me read/write as any user.

So for you to test this out. . .
Do this as root to mount the drive.

Code:
mount -t vfat -o umask=0 /dev/sda1 /mnt/fire0
Now that would only work if you are using a vfat filesystem on the drive. . .
 
Old 08-01-2004, 07:49 PM   #3
jpen8560
LQ Newbie
 
Registered: Jul 2004
Location: Memphis, TN
Distribution: RH 9, AS 2.1
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you shackMeUp! That worked. As a regular user, I issued the command;

touch /mnt/fire0/mywife and here is the result.

-rwxrwxrwx 1 root root 0 Jul 29 21:41 mywife

As you can see, the owner is root.root. Although this allows me to write, I do not want root to be the owner. Can you lead me further?

Thanks again.
 
Old 08-01-2004, 07:53 PM   #4
jpen8560
LQ Newbie
 
Registered: Jul 2004
Location: Memphis, TN
Distribution: RH 9, AS 2.1
Posts: 8

Original Poster
Rep: Reputation: 0
Oooops! sorry. The fs is Win95 FAT (out of the box).

After I get this thread topic resolved, I want to format the drive for ext3. I have read horror stories online about using it on both, Windows and Linux. It seems that windows will handle using it, but it does something to the files that make them unreadable when you come back to Linux. Have you experienced otherwise?

John

Last edited by jpen8560; 08-01-2004 at 10:06 PM.
 
Old 08-02-2004, 03:38 AM   #5
slackMeUp
Member
 
Registered: Nov 2003
Distribution: Slack-where?
Posts: 654

Rep: Reputation: 30
I have not had a problem at all. . . vfat works just fine.

I'm a computer tech. . . and I take my external drive along to all of my jobs. It has seen Win98, Win2k, WinME, WinXP, Linux-2.4.x, Linux-2.6.x, MacOS8.6, MacOS9, MacOSX, and a few others. And after all that it mounts fine on my box without any filesystem change, or anything different.

The trick it to mount it with vfat set as the filesystem type. . . using auto might load not load vfat to take care of the fat partition and make the file names appear malformed.

And you will only be able to mount under root as the owner. The fat filesystem does not support user/owner data so you can't set it. And you need to be root to mount the drive, so the drive will be in root's name. If you use ext2 for the drive then you could set user based data like ownership and whatnot. .. but good luck getting it to work on Windows. . .
 
Old 08-02-2004, 03:07 PM   #6
jpen8560
LQ Newbie
 
Registered: Jul 2004
Location: Memphis, TN
Distribution: RH 9, AS 2.1
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks again. I apreciate the follow up. I will not be using it on any windows machines, just Linux. Forgive me if this idea sounds ignorant, becasue I am, but I was thinking about formatting it for ext3. Is there any reason not to do that? I would not ask if I had a clue.

John
 
Old 08-02-2004, 03:37 PM   #7
bbmak
Member
 
Registered: May 2004
Posts: 178

Rep: Reputation: 31
i had experience this before when i try to mount an internal 120 hd as vfat 32.

this is my mount command:
mount -t vfat 32 /dev/hdc1 /eddie

I try to set it 0777 but same error message happen to me too
chmod: changing permissions of `/eddie' (requested: 0777, actual: 0755): Operation not permitted
that drive me crazy, i don't know what to do also
 
Old 08-02-2004, 04:48 PM   #8
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
jpen8560:
You can format a hard drive with any filesystem.

bbmak:
Include the option argument in the mount command.
mount -t vfat -o umask=0,fat=32 /dev/hdc1 /eddie

You do not need fat=32 because vfat will automatically detect the fat size.
 
Old 08-02-2004, 07:23 PM   #9
slackMeUp
Member
 
Registered: Nov 2003
Distribution: Slack-where?
Posts: 654

Rep: Reputation: 30
jpen8560:

I would go with ext2 for a Linux native filesystem on external storage media. . .like hard drives.

bbmak:

Read the thread over again. . . the answer was given.
 
Old 08-02-2004, 07:59 PM   #10
bbmak
Member
 
Registered: May 2004
Posts: 178

Rep: Reputation: 31
yes
umask=0
i just tell my experience.
 
Old 08-02-2004, 08:40 PM   #11
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You can change the owner of an external (vfat) partition in the mount command using the uid= or gid= options. This may be more secure than simply allowing any user full access to the drive. You could for example make a new group for yourself and your wife. For the sake of including an example, suppose the name of this group is called 'parents' and when you created the group, it has the group id of 503. Now in the /etc/fstab entry, you could add the option gid=503 or even gid=parents would work. Make yourself and your wife members of the group. You may want to remove the user option and change the umask value to mask out the other permissions (umask=007).

Now the kids would not have access to the drive using their accounts.
( Unless they plug the drive into another computer or can access the root account )

For more information look in the mount man-page.

Last edited by jschiwal; 08-02-2004 at 08:45 PM.
 
Old 08-03-2004, 12:51 AM   #12
jpen8560
LQ Newbie
 
Registered: Jul 2004
Location: Memphis, TN
Distribution: RH 9, AS 2.1
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you all for your input. By the looks of this thread, more people than I have learned a couple more tid-bits in the new world of Linux.

Electro:
Earlier, trying to brave it myself, I formated the drive as ext3.

As root, I issued:

1. mkfs -t ext3 -v /dev/sda1
2. mount /dev/sda1 /mnt/fire0
3. chmod 777 /dev/sda1
4. changed the line in my fstab to: /dev/sda1 /mnt/fire0 ext3 auto,user,owner,rw 0 0

I can now write as a standard user and it is owned by that user. I will make note of your advise. I realize that will not be able to use this drive on a M$ box, but that's quite alright with me. Oracle runs a lot better on Linux, and that is the real reason for purchasing this drive so i could expand my laptop's capacity. I am preparing for my OCP Exams. Sorry Bill G.

jschiwal:
Thanks for your reply. I will look at your advise.

slackMeUp:
Why the ext2 recommendation?


John
 
Old 08-03-2004, 02:39 AM   #13
peruvianllama
LQ Newbie
 
Registered: Jan 2004
Location: Canada
Distribution: RedHat / Ubuntu
Posts: 9

Rep: Reputation: 0
Glad to see your problem resolved, jpen - I've been having a similar problem recently, and seeing as your issue appears to be resolved, I hope you don't object to me temporarily hijacking your thread.

I'm running RH7.3, and have a second internal IDE drive, hdb1. I actually tried your four steps above, exactly as given - making the ext3 file system, mounting as root, chomd'ing, and editing /etc/fstab appropriately. I still have the same issue though - when logged in as root, I have full r/w permissions, but not as an ordinary user. I've tried chmod'ing the directory where the fs is mounted, both prior to and after giving the mount command, neither of which has an effect, and I can't chown the directory either. Chmod'ing or chown'ing /dev/hdb1 doesn't seem to help either.

I checked through man mount and Google'd around, both to no avail. I'm wondering if you, or any of the kind folk who offered you advice, might have some thoughts or suggestions? Anything would be appreciated!

Cheers,
- Ross
 
Old 08-03-2004, 03:22 AM   #14
slackMeUp
Member
 
Registered: Nov 2003
Distribution: Slack-where?
Posts: 654

Rep: Reputation: 30
Quote:
Originally posted by jpen8560

slackMeUp:
Why the ext2 recommendation?


John
Well what does ext3 have that ext2 does not?

Journaling. And what good is journaling on a removeable drive? Not much unless you are putting a linux system on the external drive.

Journaling is useful, but unnecessary for portable media. . . IMO that is.
 
Old 08-03-2004, 09:44 AM   #15
jpen8560
LQ Newbie
 
Registered: Jul 2004
Location: Memphis, TN
Distribution: RH 9, AS 2.1
Posts: 8

Original Poster
Rep: Reputation: 0
slackMeUp:

Thanks. I will read up o that. I have no idea what journaling is for. Perhaps I will reformat it to ext2. This is all learing anyway.

John newbie:
 
  


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
no permissions to external hard drive Maxtor OneTouche II roler Linux - Hardware 4 11-08-2005 09:04 AM
Write permissions for external hard drive kg4ysy Linux - Hardware 1 05-19-2005 06:36 AM
external hard drive permissions djljjm Linux - Hardware 12 04-06-2005 02:23 PM
Setting permissions on an external USB hard drive so that all users can read from it? Pi Man Linux - Hardware 2 09-07-2004 10:50 PM
Write to external USB hard drive Rob Roye Linux - Software 6 07-06-2004 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration