Automounted External Drive Owned By Root
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Automounted External Drive Owned By Root
I have an external, USB, SSD hard drive in the EXT4 file system.
When I plug it into my computer Mint has it as owned by root.
How do I get Mint/Cinnamon to automount USB drives with myself as the owner?
When I plug it into my computer Mint has it as owned by root.
How do I get Mint/Cinnamon to automount USB drives with myself as the owner?
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.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Mint 21.2 Victoria
Cinnamon 5.8
Intel© Core™ i7-8700K CPU @ 3.70GHz × 6
Graphics Card: NVIDIA Corporation GP107 [GeForce GTX 1050]
Mother board: ASUSTeK COMPUTER INC. PRIME Z370-P Rev X.0x
Cinnamon 5.8
Intel© Core™ i7-8700K CPU @ 3.70GHz × 6
Graphics Card: NVIDIA Corporation GP107 [GeForce GTX 1050]
Mother board: ASUSTeK COMPUTER INC. PRIME Z370-P Rev X.0x
Re: Automounted External Drive Owned By Root
Hi Tinker.
The person who answers this (probably not me) will want the output of each of these commands:
Plug in the drive before running those commands.
Also run this command to backup fstab. There will be no response if it works.
The person who answers this (probably not me) will want the output of each of these commands:
Code: Select all
blkid
df -Th
cat /etc/fstab
Also run this command to backup fstab. There will be no response if it works.
Code: Select all
sudo cp /etc/fstab /etc/fstab.bak
Re: Automounted External Drive Owned By Root
Fair enough!mikeflan wrote: ⤴Wed Mar 10, 2021 4:37 pm Hi Tinker.
The person who answers this (probably not me) will want the output of each of these commands:Code: Select all
blkid df -Th cat /etc/fstab
The last line is odd as I formatted the drive ( via the file manager ) this morning to be ext4 and changed the label to something else.
Code: Select all
Mint20UlyanaCinnamon4.6.7> blkid
/dev/sda1: UUID="5FkZP2-Ktpo-UBJ6-xjpo-vIBW-kl5E-5pBcKr" TYPE="LVM2_member" PARTUUID="7c398459-01"
/dev/mapper/mint--vg-root: UUID="2b8f311f-04ff-4a08-a236-7804a18ad5cb" TYPE="ext4"
/dev/mapper/mint--vg-swap_1: UUID="29291e62-cd4b-4bfb-a757-22f02f84052b" TYPE="swap"
/dev/sdb1: LABEL_FATBOOT="FAT32USBSTK" LABEL="FAT32USBSTK" UUID="84CE-0298" TYPE="vfat" PARTUUID="837e3546-01"
Mint20UlyanaCinnamon4.6.7>
Code: Select all
Mint20UlyanaCinnamon4.6.7> df -Th
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs tmpfs 1.6G 1.6M 1.6G 1% /run
/dev/mapper/mint--vg-root ext4 213G 136G 67G 68% /
tmpfs tmpfs 7.8G 172K 7.8G 1% /dev/shm
tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
tmpfs tmpfs 1.6G 28K 1.6G 1% /run/user/1000
/dev/sdb1 ext4 916G 77M 870G 1% /mnt/wwn-0x5000c500450f95eb-part1
Mint20UlyanaCinnamon4.6.7>
Code: Select all
Mint20UlyanaCinnamon4.6.7> cat /etc/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>
/dev/mapper/mint--vg-root / ext4 errors=remount-ro 0 1
/dev/mapper/mint--vg-swap_1 none swap sw 0 0
/dev/disk/by-id/wwn-0x5000c500450f95eb-part1 /mnt/wwn-0x5000c500450f95eb-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
Mint20UlyanaCinnamon4.6.7>
Last edited by karlchen on Sat Mar 13, 2021 2:31 pm, edited 1 time in total.
Reason: replaced [quote] tags by [code] tags
Reason: replaced [quote] tags by [code] tags
Mint 21.2 Victoria
Cinnamon 5.8
Intel© Core™ i7-8700K CPU @ 3.70GHz × 6
Graphics Card: NVIDIA Corporation GP107 [GeForce GTX 1050]
Mother board: ASUSTeK COMPUTER INC. PRIME Z370-P Rev X.0x
Cinnamon 5.8
Intel© Core™ i7-8700K CPU @ 3.70GHz × 6
Graphics Card: NVIDIA Corporation GP107 [GeForce GTX 1050]
Mother board: ASUSTeK COMPUTER INC. PRIME Z370-P Rev X.0x
Re: Automounted External Drive Owned By Root
Like I say - I'm not the one to fix this.
I see this page:
https://askubuntu.com/questions/769460/ ... ly-as-root
but I don't know what to do.
I see this page:
https://askubuntu.com/questions/769460/ ... ly-as-root
but I don't know what to do.
Re: Automounted External Drive Owned By Root
Try adding sdd2 to fstab with the same options as sdd1, e.g.
personally I prefer to specify the filesystem and identify it by UUID not device reference
works for me (above asks for pwd to unmount which is okay by me, if you want to allow user unmount then put
Code: Select all
/dev/sdd2 /media/intel/somewhere_else auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
Code: Select all
#mount point for HDD in ultrabay
UUID=5cdf25ee-93ed-41a0-96f5-31ff2f85862c /media/ultrabay ext4 defaults,nofail 0 2
users
in the options).Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Automounted External Drive Owned By Root
To clarify, what I am talking about I am referring to the feature that when you plug a USB drive into the computer, Mint will mount it for you, without you having to do anything.
When I do this with my USB hard drive, in the EXT file system, it gets mounted as root rather than as me.
Below is a copy of my fstab.
Would someone care to post a full example of that line or another line that will make mint mount USB drives for me, and mount it as me rather than root, even EXT4 file systems?
When I do this with my USB hard drive, in the EXT file system, it gets mounted as root rather than as me.
Below is a copy of my fstab.
Code: Select all
Mint20UlyanaCinnamon4.6.7> cat /etc/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>
/dev/mapper/mint--vg-root / ext4 errors=remount-ro 0 1
/dev/mapper/mint--vg-swap_1 none swap sw 0 0
/dev/disk/by-id/wwn-0x5000c500450f95eb-part1 /mnt/wwn-0x5000c500450f95eb-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
Mint20UlyanaCinnamon4.6.7> [/quote]
Was the 3rd line created by Mint to mount whatever is plugged in?
People have mentioned adding UID into the options to mount EXT4 file systems as myself rather than root.
I tried that, but only made it so I couldn't mount the drive at all
[quote]/dev/disk/by-id/wwn-0x5000c500450f95eb-part1 /mnt/wwn-0x5000c500450f95eb-part1 auto uid=1000,gid=1000,nodev,nofail,x-gvfs-show 0 0
Last edited by karlchen on Sat Mar 13, 2021 2:34 pm, edited 1 time in total.
Reason: replaced [quote] tags by [code] tags
Reason: replaced [quote] tags by [code] tags
Mint 21.2 Victoria
Cinnamon 5.8
Intel© Core™ i7-8700K CPU @ 3.70GHz × 6
Graphics Card: NVIDIA Corporation GP107 [GeForce GTX 1050]
Mother board: ASUSTeK COMPUTER INC. PRIME Z370-P Rev X.0x
Cinnamon 5.8
Intel© Core™ i7-8700K CPU @ 3.70GHz × 6
Graphics Card: NVIDIA Corporation GP107 [GeForce GTX 1050]
Mother board: ASUSTeK COMPUTER INC. PRIME Z370-P Rev X.0x
Re: Automounted External Drive Owned By Root
I note that you are using encryption.
The reason is that you have it mounting as root is that it is mounting in /mnt, which is owned by root. Don't like disks for various reasons, one being that it creates messy entries in fstab:
compare to:
which mounts an ext4 partition on an external drive in
You have choices:
that will change ownership back to you.
You get the UUID by running
The reason is that you have it mounting as root is that it is mounting in /mnt, which is owned by root. Don't like disks for various reasons, one being that it creates messy entries in fstab:
Code: Select all
/dev/disk/by-id/wwn-0x5000c500450f95eb-part1 /mnt/wwn-0x5000c500450f95eb-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
Code: Select all
#mount point for HDD in ultrabay
UUID=5cdf25ee-93ed-41a0-96f5-31ff2f85862c /media/ultrabay ext4 defaults,nofail 0 2
/media/ultrabay
. I assume from what you've said that the partition you are talking about is ext4. If ntfs the options are slightly different.You have choices:
- remove the fstab entry and udisks will mount it automatically when you plug it in at
/media/you/labelname
or/media/you/UUID
. Good practice to assign a label to a partition, much more user friendly than using the UUID.
- change the fstab entry. You can mount it wherever you like, but if you mount it outside home or
/media/you
it will be owned by root. If you do that, with the drive plugged in:
Code: Select all
sudo chown -R $USER:$USER /wherever_you_mounted_it
You get the UUID by running
blkid
in a terminal. Don't try to retype, copy/paste. You need to edit fstab as root.Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Automounted External Drive Owned By Root
Still confused:
blkid says this:
blkid says this:
df -Th says this:/dev/sdb1: LABEL_FATBOOT="FAT32USBSTK" LABEL="FAT32USBSTK" UUID="84CE-0298" TYPE="vfat" PARTUUID="837e3546-01"
Could you please run blkid again this way:/dev/sdb1 ext4 916G 77M 870G 1% /mnt/wwn-0x5000c500450f95eb-part1
Code: Select all
sudo blkid -c /dev/null
Last edited by altair4 on Sat Mar 13, 2021 1:37 pm, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Re: Automounted External Drive Owned By Root
That worked!remove the fstab entry and udisks will mount it automatically when you plug it in at /media/you/labelname or /media/you/UUID. Good practice to assign a label to a partition, much more user friendly than using the UUID.
I commented out that line in my /etc/fstab and now it all works smoothly.
Thank you.
Mint 21.2 Victoria
Cinnamon 5.8
Intel© Core™ i7-8700K CPU @ 3.70GHz × 6
Graphics Card: NVIDIA Corporation GP107 [GeForce GTX 1050]
Mother board: ASUSTeK COMPUTER INC. PRIME Z370-P Rev X.0x
Cinnamon 5.8
Intel© Core™ i7-8700K CPU @ 3.70GHz × 6
Graphics Card: NVIDIA Corporation GP107 [GeForce GTX 1050]
Mother board: ASUSTeK COMPUTER INC. PRIME Z370-P Rev X.0x
Re: Automounted External Drive Owned By Root
<mod>
Questions by jvaes and replies to jvaes split off from this thread and turned into a dedicated thread here: viewtopic.php?f=50&t=344921.
Thread hijacking is not appreciated and it is counter-productive.
</mod>
Questions by jvaes and replies to jvaes split off from this thread and turned into a dedicated thread here: viewtopic.php?f=50&t=344921.
Thread hijacking is not appreciated and it is counter-productive.
</mod>
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline