Sample Header Ad - 728x90

Changing Filemodes of Mounts in Linux

0 votes
1 answer
37 views
I was trying to use an USB-stick in Linux and it didn't go as expected: I had already created a mountpoint (/mnt), found the device of the newly inserted USB-stick (/dev/sdb1) and mounted it: # ls -l /dev/sdb1 brw-rw---- 1 root disk 8, 17 Aug 7 16:05 /dev/sdb1 # ls -ld /mnt drwxrwxrwx 2 root root 4096 Jul 31 2020 /mnt # mount /dev/sdb1 /mnt # mount | grep sdb /dev/sdb1 on /mnt type exfat(rw,relatime,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro) # ls -ld mnt drwxr-xr-x 2 root root 131072 Aug 7 16:23 mnt The problem was now that the stick was writable only for root. So I changed the filemode of the directory - which didn't work at all, although no error was issued: # chmod -R 777 /mnt # ls -ld mnt drwxr-xr-x 2 root root 131072 Aug 7 16:23 mnt (I also tried "0777" instead of "777" - no difference.) Not being all too familiar with Linux I suspected the problem being that I tried to do something in the root directory. So I created a subdirectory "/mnt/usb1" and repeated above procedure - with the same result. The chmod command came back without an error but the filemode wasn't changed. As a last resort I tried changing the ownership - which lead to an error ("user" is an existing user/group on this system): # chown user:user /mnt chown: changing ownership of '/mnt': Operation not permitted My system uses kernel 5.15.0-97-generic, if you need more/other information please ask and I will edit it in. Can someone shed light on what I did wrong? Both commands (chown as well as chmod) are standard UNIX commands and the system I usually work with (AIX) would have done exactly what I intended to do. As A bonus: if someone could also answer why the chown was "not permitted" I'd be glad.
Asked by bakunin (683 rep)
Aug 7, 2024, 02:42 PM
Last activity: Aug 7, 2024, 03:45 PM