You are not logged in.

#1 2020-08-25 14:36:35

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

[SOLVED] Enabling writing to external storage media as a regular user

Any command I pass to my flash drives from mount/umount to mkdir requires a sudo before it. Is there a way for regular users to have full access with all the permissions to storage devices?

Last edited by Flavoured-Goo (2020-08-25 20:38:40)

Offline

#2 2020-08-25 14:54:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: [SOLVED] Enabling writing to external storage media as a regular user

There are many ways.  Have you done any search or reading of the wiki?  What have you tried so far?  What is the filesystem?  Where are you mounting it?  How are you mounting it?  Just manually with `mount`?  Is it listed in your fstab?

Last edited by Trilby (2020-08-25 14:55:17)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-08-25 15:23:48

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Enabling writing to external storage media as a regular user

Trilby wrote:

There are many ways.  Have you done any search or reading of the wiki?  What have you tried so far?  What is the filesystem?  Where are you mounting it?  How are you mounting it?  Just manually with `mount`?  Is it listed in your fstab?

I did try "mount -o gid=users,fmask=113,dmask=002 /dev/sda1 /mnt/usbstick" as the wiki suggested but I was wondering if there was a more permanent solution, so far I've tried chown which doesn't work as well as just using root or sudo to write which does work, it's a FAT32 filesystem, I've tried mounting it to "/mnt/usbstick" as well as in the user's home directory at "/home/user/mnt/usb" I mount it manually with "mount". Okay I'm still learning this stuff so I could be wrong but isn't the fstab file for drives that will be permanently present and have a fixed path unlike removable drives?

Last edited by Flavoured-Goo (2020-08-25 15:24:58)

Offline

#4 2020-08-25 15:29:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: [SOLVED] Enabling writing to external storage media as a regular user


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2020-08-25 15:50:10

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Enabling writing to external storage media as a regular user

The fstab method would require me to make entries for every possible combination of "dev/sdXY"? plus the kind of filesystem it would be? I don't really have usb devices plugged in at boot for the fstab file either plus there are often more than one flash drive being used and in different combinations of /dev/sdXY with varying filesystems.

Offline

#6 2020-08-25 16:17:40

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] Enabling writing to external storage media as a regular user

Fstab also allows UUID, LABEL, PARTUUID, PARTLABEL and such that helps to identify your usb...

You just use the usb fs label or uuid with noauto,nofail,user and you’re done...

No need to make a gazillion fstab entries tongue

Do I need to provide a working example?
If so, do blkid on your usb and post the output...

Reading the wiki and the fstab manpage should cover any questions...


My reposSome snippets

Heisenberg might have been here.

Offline

#7 2020-08-25 16:33:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,372

Re: [SOLVED] Enabling writing to external storage media as a regular user

It sounds like what you actually want is to have a mount helper daemon: https://wiki.archlinux.org/index.php/Udisks

Offline

#8 2020-08-25 16:33:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: [SOLVED] Enabling writing to external storage media as a regular user

This is why I asked about your use case.  There are countless ways to mount and or automount external media so that they are accessible by a normal user.  RTFW to find what'll work best for you, it's clear you've made zero effort, and even when pointed in the right direction you don't bother to follow through with learning about the options.

The only thing worse than a help vampire is a beligerant help vampire.  Go install ubuntu.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2020-08-25 16:34:38

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Enabling writing to external storage media as a regular user

GaKu999 wrote:

Do I need to provide a working example?
If so, do blkid on your usb and post the output...

Okay here's the output of blkid "/dev/sdb: UUID="EEE5-40C5" BLOCK_SIZE="512" TYPE="vfat"". I did read the wiki and still learning a lot tongue
Would this cover new USBs and additional ones too? the UUID varies right?

Offline

#10 2020-08-25 16:39:26

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [SOLVED] Enabling writing to external storage media as a regular user

Looking at your needs you need to follow @V1del advice, an fstab entry it’s for something more stable and predictable, like an external backup HDD...

Udisks should do the trick.


My reposSome snippets

Heisenberg might have been here.

Offline

#11 2020-08-25 20:38:09

Flavoured-Goo
Member
Registered: 2020-08-17
Posts: 31

Re: [SOLVED] Enabling writing to external storage media as a regular user

Aha thanks a ton @GaKu999 and @V1del. I read the wiki and heard about udisks but thought there would be another way, thanks for letting me know, I'm still learning my way around Arch and not having everything preinstalled  and already set up. Love Arch! <3

big_smile

Solved!

Offline

Board footer

Powered by FluxBB