Hard Drive Permissions, I want to use it in different accounts, on one computer.
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!?
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.
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:
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.