Score:3

Use 1.0 TB volume device owned by root, how to add files and folders?

aq flag

I have a formatted (was windows) 2 TB SSD with Ubuntu 22.04 installed. No Windows on this drive. There was a formatted 1 TB drive on the PC when Ubuntu was installed. No windows on this drive. I don't want to use Windows on this Ubuntu PC. The 1 TB drive is owned by root, so I, normal user, can't add folders or files. No other users will ever be added to this PC. What is the recommended way to make the 1 TB drive (listed in Other Locations) a device I can add folders and files to? No error messages during install or use of Ubuntu.Both drives are one partition.

Score:1
jp flag

The 1 TB drive is owned by root, so I, normal user, can't add folders or files. No other users will ever be added to this PC. What is the recommended way to make the 1 TB drive (listed in Other Locations) a device I can add folders and files to?

Assuming the filesystem on the 1TB drive's partition is a Unix/Linux filesystem that supports Unix/Linux type permissions ...

Mount it with like:

mkdir ~/my_mnt

then:

sudo mount /dev/sdyx ~/my_mnt

changing sdyx to the actual partition name on the 1TB drive e.g. sdb1.

That is if it’s not already mounted, or otherwise use its current mount-point instead of ~/my_mnt below.

Then change the ownership of the mount-point(while the partition/block device is mounted) to the user:group of your choice like so:

sudo chown user:group ~/my_mnt

or to your current logged-in user:primary_group like so:

sudo chown "$(id -un):$(id -gn)" ~/my_mnt

This will permanently change the ownership of the top-level(AKA root) directory of the mounted filesystem at ~/my_mnt i.e. the filesystem on the 1TB drive's mounted partition to the supplied user:group giving them full permissions to create directories/files under it.

Notice:

This is the normal situation for data storage disks/partitions like e.g. external USB disks, when you format them to a Unix/Linux filesystem, the invoking user i.e. your user becomes the owner of that filesystem’s top-level directory and it’s even the normal behavior for non-Unix/Linux filesystems when you mount them their top-level directory becomes owned by the invoking user as well AKA user-space virtual filesystem mounts.

HolyBlackCat avatar
cn flag
Why should a specific user be the owner? Shouldn't the root own it, with other users having read/write permissions?
Raffa avatar
jp flag
@HolyBlackCat OP says there are no other users "*No other users will ever be added to this PC*" ... Also, the top-level directory i.e. `/` on the target filesystem is just a directory ... And changing ownership in this case IMO is the shortest "user friendly" solution and the most secure one.
Raffa avatar
jp flag
@HolyBlackCat Also "*Shouldn't the root own it*"? ... No, the reason it's already owned by `root` is, as the OP mentioned, Ubuntu was previously installed on it which is understandable and necessary, but now that it's used as an additional user storage disk, it doesn't realy need to be owned by `root` or follow the previously set directory permissions hierarchy but rather needs to be secure data-wise.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.