You are not logged in.
Pages: 1
Whenever i try to mount my USB stick i have to mount it using sudo prefix which means i mount it as root user. However, the problem is that, if i mount it as root, normal user will not be able to write to USB stick.
I read Arch Linux tutorial how to mount USB as normal user but next line doesn't seem to work for me.
mount -o gid=users,fmask=113,dmask=002 /dev/sda1 /mnt/usbstick"
When i run it, it mounts USB stick without errors, however, i still can't write as normal user. Can you help me out guys? Also, can somebody explain me what are all these options like gid, fmask and dmask ?
P.S. /mnt folder owner is root (root).
Last edited by filipbekic01 (2015-08-11 19:22:41)
Offline
What are the permissions for /mnt and /mnt/usbstick?
Post the commands you run and the errors you got.
When posting configs, code or command output, please use [ code ] tags https://bbs.archlinux.org/help.php#bbcode
like this
It makes the code more readable and - in case of longer listings - more convenient to scroll through.
Offline
What are the permissions for /mnt and /mnt/usbstick?
Post the commands you run and the errors you got.When posting configs, code or command output, please use [ code ] tags https://bbs.archlinux.org/help.php#bbcode
like this
It makes the code more readable and - in case of longer listings - more convenient to scroll through.
Okay i edited my post, sorry for being slipslop.
Offline
can somebody explain me what are all these options like gid, fmask and dmask ?
Since these are options for the 'mount' command, I suggest reading 'man mount'.
Offline
Alright, but still can't figure it out. I mean, how to mount as normal user?
Offline
I've asked you a few question and you answered only some of them.
Offline
What are the permissions for /mnt and /mnt/usbstick?
Post the commands you run and the errors you got.
Okay if you mean on these questions, i edited my post and i wrote up there that permissions are (root) root (drwxr-xr-x). Also i said that i do not have errors when command executes, i just can't write as normal user to my USB stick
Last edited by filipbekic01 (2015-08-11 11:07:34)
Offline
Are you writing with the mount command? If not, what command do you use? How do you know it didn't work?
Mounting as a user is one thing, writing as a user is another.
Yes, you did edit your post and answered some of my questions. Are you going to answer the other part of my question about permissions?
Offline
Please stop silently answering questions by editing your previous messages, it breaks the flow of the thread and makes it difficult to follow.
What filesystem does this USB stick have on it? Are you sure that it's sda1?
I read Arch Linux tutorial how to mount USB as normal user but next line doesn't seem to work for me.
mount -o gid=users,fmask=113,dmask=002 /dev/sda1 /mnt/usbstick"
Is this the "tutorial" you're following? If so, you have misread it. This command should be run as root, not a normal user.
Also, can somebody explain me what are all these options like gid, fmask and dmask ?
See http://www.tuxera.com/community/ntfs-3g-manual/#6
Mod note: moving to NC.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
if its ext4 it preservers ownership including root mounted drive so chown /mnt/usbstick(when mounted). if its not ext4 let us know.
Last edited by bleach (2015-08-11 12:17:50)
Offline
Okay so here is what i get when i do lsblk command (my USB stick is sdb (FAT32)):
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 500M 0 part
├─sda2 8:2 0 98.8G 0 part /mnt
├─sda3 8:3 0 19G 0 part /
└─sda4 8:4 0 1G 0 part [SWAP]
sdb 8:16 1 7.5G 0 disk
└─sdb1 8:17 1 7.5G 0 part
sr0 11:0 1 1024M 0 rom
And yes WorMzy, that's the tutorial. This is how i did it:
[filip@dell ~]$ sudo mount -o gid=users,fmask=113,dmask=002 /dev/sdb1 /mnt
[filip@dell ~]$ cd /mnt
[filip@dell mnt]$ touch testfile
touch: cannot touch ‘testfile’: Permission denied
So you see, it still says Permission denied.
Offline
I suggest you create a subdirectory in /mnt, give it proper permissions and try again.
Offline
Okay i made /mnt/usb directory and executed
chmod 777 /mnt/usb
But i still get this error
[filip@dell usb]$ ls
System Volume Information
[filip@dell usb]$ touch test.txt
touch: cannot touch ‘test.txt’: Permission denied
Offline
What's the output of
ls -l /mnt
Offline
drwxrwxr-x 3 root users 4096 Aug 11 20:40 usb
Offline
Why is it owned by root?
Offline
Sorry i am newbie. How to change it?
Offline
Are you a member of the users group?
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
$ sudo mount /dev/sdb1 /mnt/usb
$ ls -l /mnt
total 5
drwxr-xr-x 2 root root 4096 Oct 19 2014 cd
drwxr-xr-x 3 karol users 1024 Aug 11 12:49 usb
$ touch /mnt/usb/foo
$ ls -l /mnt/usb/foo
-rw-r--r-- 1 karol users 0 Aug 11 20:45 /mnt/usb/foo
Offline
No, i am member of wheel and filip groups. But if i do:
usermod -G users filip
I will overwrite wheel group. How can i append multiple groups?
Last edited by filipbekic01 (2015-08-11 18:49:35)
Offline
Why is it owned by root?
Sorry i am newbie. How to change it?
As bleach said https://bbs.archlinux.org/viewtopic.php … 2#p1552342 , using 'chown'.
Are you a member of the users group?
No, i am member of wheel and filip groups. But if i do:
usermod -G users filip
I will overwrite wheel group. How can i append multiple groups?
Read the 'usermod' man page.
Last edited by karol (2015-08-11 18:51:49)
Offline
Are you a member of the users group?
Solved! The problem was that i said gid=users and my account filip was not in that group. Now it works, thank you guys, i've been playing with Linux for a few days only, trying to figure it out, i really like organisation of system.
Offline
Great stuff. Please remember to mark your thread as solved by editing your first post and prepending "[solved]" to the title.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1