Hard Drive is Only Root

In linux I run into the issue of "Oh you formatted this drive and now its root's not yours bwah" and its annoying. How do I fix this?

Specifically, I had a drive set up with all my windows files in it and, Imma be honest, its just being wasted not being XFS. So I pulled what wasn't the exact same as my home drive over and formatted and now its labeled as root's. I also have a partition on my boot drive for video project's that I just noticed is root only.

Thanks.

Have you tried sudo chown user:root -R /location?

(As an example, I'd type in sudo chown schyken:root -R /media/schyken/32GBDrive to give myself root perms to the drive)

2 Likes

"/location" as in the mountpoint?
Like /dev/sdb8

Yeah, that should work

Thank you!

1 Like

You're welcome. Glad I could help. :slight_smile:

Errrr no wait....
I tried

sudo chown adomas:root -R /dev/sdb3

but it didn't change from root in Thunar...? Do I need to reboot?

You need to do it to the mount point, not the device

Ohhhhh....

How do I find that? In mount?

OH :3 I got it. Nixcraft is amazing.

Yeah, mount | grep /dev/sdb3 should tell you where it's mounted

I did

cat /proc/mounts

That too, or /etc/mtab

1 Like

Just itterating on what @Schyken said.

@FaunCB

chown
user:group

chown -R aremis /path/to/directory | changes just the owner octect leaving group alone, with the recursive flag.
chown -R aremis:aremis /path/to/directory | changes the perms so that armeis and all who belong to group aremis have access.
chown -R :aremis /path/to/directory | changes the perms so that any who belong to group aremis have access but does not change who the owner of the file is.

This command:

Would make you the owner, while leaving the group alone, and specifiy the :root is actually redundent and not needed if root is already the owner with group permissions set. It would actually be more preferred for aremis to do a aremis:aremis if he is the only one planning on using the drive.

If we have a standard umask of 022 then the permissions are as follows: 755
7 - owner - r w x
5 - group - r x
5 - world - r x

  1. The user who owns own the file, and can modify it with their octal value, in the above example that means they have read, write, and execute.

  2. Any user who belongs to the same group has the group octal permissions of the file, in the above example, this is read and execute.

  3. Any user who does not belong into either category falls under this. In the above example, this is read and execute.

Often you will find directories as either 755 or 775.

It is quite common on most distributions to create users with a group id akin to their user name. So user aremis belongs to the aremis group, unless there's a sticky-bit somewhere. Any file he makes belongs to aremis and inherits the aremis group perm. If this is not the case, such as in multi-user systems, then for the group it may be something like users, so if we lookup which groups aremis belongs to then we will find that he is aremis and his primary group is users. User aremis can be a member of many supplementary groups as well; such as developer, wheel, admin, sudo, mycustomgroup, etc.

7 Likes

Wonderful description! Thanks for that, hopefully it sheds some light. I usually tend to leave the groups alone, though I also have no idea what his use case quite is, so thank you for adding alt scenarios! Very well organized, too. :smiley:

1 Like

This needs to be a sticky in the Linux section

1 Like

thanks! We're currently working on it.

@Dynamic_Gravity You the real MVP