New SATA drive - chown is obvious but gibberish to me

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
elmarts
Level 4
Level 4
Posts: 245
Joined: Mon Aug 08, 2016 6:46 pm

New SATA drive - chown is obvious but gibberish to me

Post by elmarts »

Just added a new drive, and its owner is root, so I can do nothing with it. I have partitioned it and formatted it with gparted, and changed its displayed labels with the disks tool. But I do not see any graphical way to grab ownership of the disks. here is my fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=71e07b8c-a134-479d-8d1b-438da18ff997 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=982d2a42-9c69-4262-b5cf-82af5b8ec70e none swap sw 0 0

/dev/disk/by-uuid/2E809C1A809BE71D /mnt/2E809C1A809BE71D auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/5B282A5803110126 /mnt/5B282A5803110126 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/56F01CF1F01CD957 /mnt/56F01CF1F01CD957 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-id/wwn-0x50014ee6aecee175-part1 /mnt/wwn-0x50014ee6aecee175-part1 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
/dev/disk/by-id/wwn-0x50014ee6aecee175-part2 /mnt/wwn-0x50014ee6aecee175-part2 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
/dev/disk/by-uuid/20EB30C04E7D01B4 /mnt/20EB30C04E7D01B4 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/363D179A5F47C759 /mnt/363D179A5F47C759 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/105462331816116C /mnt/105462331816116C auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/b25ddf96-5606-44a0-8a01-9fdcc846a5cf /mnt/b25ddf96-5606-44a0-8a01-9fdcc846a5cf auto nosuid,nodev,nofail,x-gvfs-show 0 0

where do I go from here?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- Elmar
Dual boot win 10 & Linux Mint
Release Linux Mint 21.3 Virginia 64-bit
Kernel Linux 5.15.0-91-generic x86_64
MATE 1.26.0
gittiest personITW
Level 12
Level 12
Posts: 4285
Joined: Tue May 28, 2019 4:27 pm

Re: New SATA drive - chown is obvious but gibberish to me

Post by gittiest personITW »

You could try adding
gid=1000
which would give your group access.
for instance
/dev/disk/by-uuid/2E809C1A809BE71D /mnt/2E809C1A809BE71D auto nosuid,nodev,nofail,x-gvfs-show,gid=1000 0 0
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: New SATA drive - chown is obvious but gibberish to me

Post by all41 »

You need to take ownership of the mountpoint which is in /mnt
If it is the last drive listed in fstab then:
Copy/Paste the following into a terminal:

Code: Select all

sudo chown -R $USER:$USER /mnt/b25ddf96-5606-44a0-8a01-9fdcc846a5cf
Don't substitute your user name for $USER:$USER, leave that as is
Everything in life was difficult before it became easy.
elmarts
Level 4
Level 4
Posts: 245
Joined: Mon Aug 08, 2016 6:46 pm

Solved! Re: New SATA drive - chown is obvious but gibberish to me

Post by elmarts »

thank you - that did it. Magical incantations for linux!
- Elmar
Dual boot win 10 & Linux Mint
Release Linux Mint 21.3 Virginia 64-bit
Kernel Linux 5.15.0-91-generic x86_64
MATE 1.26.0
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: New SATA drive - chown is obvious but gibberish to me

Post by all41 »

Here is how it unfolds:
sudo - allows you to execute actions with root priviledge
chown - is the action=change owner and group
-R - apply the changes recursively to all directories/files contained
$USER:$USER - the new owner will be the currently logged-in owner/group
/mnt/b25ddf96-5606-44a0-8a01-9fdcc846a5cf This is the location and file-name in which to apply the changes.
This info was contained in your fstab file shown in your first post--kudos
Everything in life was difficult before it became easy.
User avatar
AndyMH
Level 21
Level 21
Posts: 13716
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: New SATA drive - chown is obvious but gibberish to me

Post by AndyMH »

And you can simplify your fstab by replacing entries like

Code: Select all

/dev/disk/by-uuid/2E809C1A809BE71D
with

Code: Select all

UUID=2E809C1A809BE71D
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
elmarts
Level 4
Level 4
Posts: 245
Joined: Mon Aug 08, 2016 6:46 pm

Re: New SATA drive - chown is obvious but gibberish to me

Post by elmarts »

all41 wrote: Sat Jun 22, 2019 5:17 pm You need to take ownership of the mountpoint which is in /mnt
If it is the last drive listed in fstab then:
Copy/Paste the following into a terminal:

Code: Select all

sudo chown -R $USER:$USER /mnt/b25ddf96-5606-44a0-8a01-9fdcc846a5cf
Don't substitute your user name for $USER:$USER, leave that as is
As noted, that worked on the new drive, but in followup, and I don't know how this changed, my previous drive, which I resized some partitions on, now has everything owned by root! So I tried the same incantation

Code: Select all

sudo chown -R $USER:$USER /mnt/363D179A5F47C759
and after a lot of disk activity, no error returned, but it didn't work. Everything is STILL owned by root, even after a reboot. Nevertheless, I can still read/write document files OK, even though the permissions tab says that root is the owner. On the new drive, it says I am the owner, as expected, but the older drive (2 partitions), each mnt partition is owned now by root! I'm lost ...
- Elmar
Dual boot win 10 & Linux Mint
Release Linux Mint 21.3 Virginia 64-bit
Kernel Linux 5.15.0-91-generic x86_64
MATE 1.26.0
User avatar
AndyMH
Level 21
Level 21
Posts: 13716
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: New SATA drive - chown is obvious but gibberish to me

Post by AndyMH »

I would remove all those 'messy' entries in fstab, presumably created by disks and do it manually. This also means that you can define more useful or meaningful mount points.

If it is an ext4 partition then the entry would be of the form

Code: Select all

UUID=xxx /where_you_want_to_mount ext4 defaults 0 0
where xxx is the UUID of the partition which you find from the output of blkid. Meaningful names - as an example, I used to have an ntfs partition which I shared with win7 in dual boot, in win it was D:, in linux I mounted it as /home/me/data.

If it is an ntfs partition, try the above replacing ext4 with ntfs, but if you find it is read only then use:

Code: Select all

UUID=whatever_it_is /your_mnt_pt ntfs windows_names,uid=1000,gid=1000,defaults 0 0
windows_names just stops linux writing filenames to the partition that windows doesn't understand, the uid and gid bit is assigning ownership of the partition to you.

If your drives are removable you an add the nofail option. This stops linux trying to find the partition if not present (and incurring a 90 second delay in boot). You can choose whether to automount at boot or not (noauto option). The normal convention is that fixed drives/partitions are normally mounted in /mnt and removable drives in /media, but you don't have to. If you do use the 'default' folders you can still use meaningful names like /mnt/mydata instead of /mnt/b25ddf96-5606-44a0-8a01-9fdcc846a5cf.

Suggest you do it one-by-one and check each works instead of changing them all at once.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: New SATA drive - chown is obvious but gibberish to me

Post by Flemur »

AndyMH wrote: Sun Jun 23, 2019 5:31 am And you can simplify your fstab by replacing entries like

Code: Select all

/dev/disk/by-uuid/2E809C1A809BE71D
with

Code: Select all

UUID=2E809C1A809BE71D
And you can make everything considerably more user-friendly by giving the partitions LABELs (w/gparted, on unmounted partitions). My fstab looks like:

Code: Select all

LABEL=MINT    /          ext4    errors=remount-ro          0 1
LABEL=DATA    /mnt/DATA  ext4    defaults,user,exec,noatime 0 2
LABEL=MANO    /mnt/MANO  ext4    defaults,noauto,user,noatime   0 2
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
elmarts
Level 4
Level 4
Posts: 245
Joined: Mon Aug 08, 2016 6:46 pm

Re: New SATA drive - chown is obvious but gibberish to me

Post by elmarts »

Wow - that is a lot to digest :) The drive in question is formatted NTFS, and has 2 partitions (D & E). My fstab (as noted above) has a bunch of entries that don't seem to correspond to anything physical. Physically, I have 3 SATA drives:
the first is the boot drive partitioned in half, with one half being the win 7 boot (ntfs), and the other being the mint boot (ext4). The second drive now has 2 partitions, both NTFS, in windows they are D: (Games) and E: (data). The third disk is likewise partitioned into 2, one being NTFS (drive F:), and the other EXT4. Now I know that there are tiny bits at the various ends of partitions, but why they end up in /mnt is beyond me. What data can I post that will help me "simplify" my fstab? Thanks all, btw.
- Elmar
Dual boot win 10 & Linux Mint
Release Linux Mint 21.3 Virginia 64-bit
Kernel Linux 5.15.0-91-generic x86_64
MATE 1.26.0
User avatar
slipstick
Level 6
Level 6
Posts: 1071
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: New SATA drive - chown is obvious but gibberish to me

Post by slipstick »

In theory, theory and practice are the same. In practice, they ain't.
User avatar
ricardogroetaers
Level 6
Level 6
Posts: 1372
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: New SATA drive - chown is obvious but gibberish to me

Post by ricardogroetaers »

elmarts wrote: Sat Jun 22, 2019 3:10 pm Just added a new drive, and its owner is root, so I can do nothing with it. I have partitioned it and formatted it with gparted .......... here is my fstab
where do I go from here? .......Wow - that is a lot to digest ....... What data can I post that will help me "simplify" my fstab?....
Do not complicate!

To start organizing, post output the commands:
lsblk -f
sudo parted -l
elmarts
Level 4
Level 4
Posts: 245
Joined: Mon Aug 08, 2016 6:46 pm

Re: New SATA drive - chown is obvious but gibberish to me

Post by elmarts »

OK - as follows, although I read that ntfs disks always show root as owner, and don't allow you to change this. Am I just barking up the wrong tree?

sudo parted -l
[sudo] password for ets:
Model: ATA ADATA SP550 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 32.8kB 120GB 120GB primary ntfs boot
2 120GB 240GB 120GB extended
5 120GB 223GB 103GB logical ext4
6 223GB 240GB 17.1GB logical linux-swap(v1)


Model: ATA WDC WD1001FALS-0 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
3 1049kB 370GB 370GB primary ntfs
2 370GB 1000GB 630GB primary ntfs


Model: ATA Hitachi HUA72107 (scsi)
Disk /dev/sdc: 750GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 411GB 411GB primary ntfs
2 411GB 750GB 339GB primary ext4

lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 ntfs Windows 64 bit A0A8882AA88800D0
├─sda2
├─sda5 ext4 71e07b8c-a134-479d-8d1b-438da18ff997 /
└─sda6 swap 982d2a42-9c69-4262-b5cf-82af5b8ec70e [SWAP]
sdb
├─sdb2 ntfs Games 5B282A5803110126 /mnt/5B282A580
└─sdb3 ntfs Data 363D179A5F47C759 /mnt/363D179A5
sdc
├─sdc1 ntfs Drive_F 105462331816116C /mnt/105462331
└─sdc2 ext4 Linux b25ddf96-5606-44a0-8a01-9fdcc846a5cf /mnt/b25ddf96-
sr0
- Elmar
Dual boot win 10 & Linux Mint
Release Linux Mint 21.3 Virginia 64-bit
Kernel Linux 5.15.0-91-generic x86_64
MATE 1.26.0
User avatar
ricardogroetaers
Level 6
Level 6
Posts: 1372
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: New SATA drive - chown is obvious but gibberish to me

Post by ricardogroetaers »

Excuse me. I forgot to ask for the output of the command:
id
Locked

Return to “Beginner Questions”