LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Not able to set write permissions on external hard drive. (https://www.linuxquestions.org/questions/linux-hardware-18/not-able-to-set-write-permissions-on-external-hard-drive-212135/)

jpen8560 08-01-2004 10:20 AM

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
:newbie:

slackMeUp 08-01-2004 11:34 AM

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. . .

jpen8560 08-01-2004 06:49 PM

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.

jpen8560 08-01-2004 06:53 PM

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
:newbie:

slackMeUp 08-02-2004 02:38 AM

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. . .

jpen8560 08-02-2004 02:07 PM

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. :o

John
:newbie:

bbmak 08-02-2004 02:37 PM

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

Electro 08-02-2004 03:48 PM

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.

slackMeUp 08-02-2004 06:23 PM

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. :rolleyes:

bbmak 08-02-2004 06:59 PM

yes
umask=0
i just tell my experience.

jschiwal 08-02-2004 07:40 PM

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.

jpen8560 08-02-2004 11:51 PM

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. :p

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

slackMeUp:
Why the ext2 recommendation?


John

peruvianllama 08-03-2004 01:39 AM

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

slackMeUp 08-03-2004 02:22 AM

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.

jpen8560 08-03-2004 08:44 AM

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:


All times are GMT -5. The time now is 02:56 PM.