LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-14-2009, 07:49 PM   #1
toldu17butilied
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Rep: Reputation: 0
Hard Drive Permissions, I want to use it in different accounts, on one computer.


OK, I've found tons of similar questions, but so far the answers have been useless to me. Normally I just barrel on ahead until I figure something out, but I've really had it up to here with this one.

It seems simple: I have an external hard drive. I have a small internal hard drive. Music takes up a lot of space, so I put it on the external. Now my girlfriend and I have different accounts, but we use the same computer, sometimes we need to keep our accounts logged in if we're working on something or downloading a torrent. The problem is if the other person logs on they have no access to the external drive, and hence the music and photos. I just want to make it so we can both have full access. Owner privileges regardless of who logged in first.

I've tried doing the file share, it tells me it's going to do what I want, then I check and it's exactly the same. I've tried going in as root and changing permissions, and it goes right back to normal immediately. I'm pulling out my hair, it's so stupid and so simple, why won't it work!?
 
Old 01-14-2009, 08:03 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Presumably what is happening is that it is being mounted as whoever logged in when the drive was turned on/plugged in, and they are becoming the owner. Because of this, nobody else can access the files on the drive.

There are two obvious ways to get around this. First, if the device is formatted to a filesystem that understands advanced permissions (I.E. not FAT or NTFS), you could set the group ownership to the drive and files to something like "music", and add both your girlfriend's and your own accounts into this group; then elevate that group's rights to full. That way, even though the other person might be the owner, you would still have full rights because you are in the proper group.

The other way (and possibly the only choice if the drive is using a Windows filesystem), is to mount the drive system-wide rather than per user. To do this you would put an entry for the drive in your /etc/fstab file, and give it appropriate permissions so that everyone on the computer has full access to it.
 
Old 01-14-2009, 08:08 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
EDIT: Posted late, but left the fstab info in case it's helpful.

If you can't change permissions as root, then it sounds like it's not a Linux file system on the external drive. Is it fat32/vfat? If so, you can use something like this in /etc/fstab:
Code:
/dev/sdb1  /mnt/external  vfat  defaults,umask=0000  0  0
The umask setting gives everyone read/write access to the drive.
 
Old 01-14-2009, 08:08 PM   #4
toldu17butilied
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Original Poster
Rep: Reputation: 0
System wide sounds perfect. I've already tried changing the group and it wouldn't let me. So I added everyone else to the group "root" and it still didn't work. (Root is the default group)

Do you think you could give me a step by step thing on how to do it? Whenever I have to put entries into files it backfires on me.
 
Old 01-14-2009, 08:15 PM   #5
toldu17butilied
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Original Poster
Rep: Reputation: 0
I have no idea what fat32/vfat means nor how to find out. If you tell me I can give it a try.
 
Old 01-14-2009, 08:18 PM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Another option

You can also just take the drive out of the external enclosure and install it directly into the computer. You can also exchange them, put the smaller one in the external enclosure and have operating systems and data on one drive.
Unless you value the portability of this data, where you would prefer to leave it on an external.
 
Old 01-14-2009, 08:25 PM   #7
toldu17butilied
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Original Poster
Rep: Reputation: 0
I've thought about switching the drives before, but it seems like a bit of a hassle, plus when I get a little extra money I'm buying a new computer anyway, so I figure I can just copy everything onto the big one and inject it into the hypothetical new one.
 
Old 01-14-2009, 09:07 PM   #8
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
You can tell what filesystem the drive is currently using by running the "mount" command while the external drive is mounted. It will give you an output of all of the mounted devices and their filesystems.

If I plug in a USB flash drive I see:

Code:
/dev/sde1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,shortname=winnt,uid=1000)
The important part is the type, vfat. This means it is formatted FAT32, which was the old Windows default (and what is almost always used on small flash drives). On the other hand, external HDDs are often formatted to NTFS because it handles large volumes and errors better (relatively speaking). Linux has no problem working with FAT32, but NTFS write support is not officially supported yet. Ideally, if you are going to use this drive only on the Linux machine you should format it to one of the Linux filesystems for the best performance. But of course you would have to backup everything on the drive before formatting, which sounds like it would be a problem in your current setup.

You can also just put "auto" in the fstab line and let the system figure it out.

Last edited by MS3FGX; 01-14-2009 at 09:09 PM.
 
  


Reply



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
load Linux onto a hard drive on one computer then move the hard drive to another Ark9 Linux - Newbie 2 10-06-2008 06:56 PM
can I take a hard drive from one computer and implant it in another computer michaelbenton Linux - Hardware 5 09-26-2008 09:39 PM
Removed bad hard drive from computer, now flash drive won't mount. checkmate3001 Linux - Hardware 6 08-15-2008 12:03 AM
Hard Drive Permissions yusuo Mandriva 5 05-16-2007 07:34 AM
Hard Drive Permissions djljjm Linux - Newbie 1 04-18-2005 11:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:19 PM.

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
Open Source Consulting | Domain Registration