3
mount -o uid=1000 /dev/sdb1 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
   missing codepage or helper program, or other error

   In some cases useful info is found in syslog - try
   dmesg | tail or so.

it used to work, i don't know what i am missing.

uname -r
3.19.0-21-generic
mount -V
mount from util-linux 2.25.2 (libmount 2.25.0: selinux, assert, debug)

help is appreciated. thanks.

edit : filesystem on sdb1 is ext4 edit :

journalctl | tail -1
EXT4-fs (sdb1): Unrecognized mount option "uid=1000" or missing value

edit : when "it used to work" i had vfat on the usb

2
  • 1
    Isn't it obvious from the output of journalctl? Unrecognized mount option "uid=1000". You should look up the man, sometimes: linux.die.net/man/8/mount, it helps, really. – MariusMatutiae Jun 25 '15 at 18:15
  • the man says 'Mount options for adfs', could not figure out what adfs is. though you are right, looking at manual pages really helps, thank for the advice. – Baroudi Safwen Jun 25 '15 at 18:21
9

The man page does not list uid or gid options for ext2, 3 and 4 filesystems. On these filesystems the file permissions don't depend on who mounted the filesystem or on mount options, only on the metadata stored within the filesystem.

0
1

so i was looking for a way to mount a usb device and give an unprivileged user the right to create files and manipulate them, since it is impossible to change uid on a linux partition, the solution here is to use bindfs
bindfs allow us to mount a directory to another location and alter permission bits

sudo mount /dev/sdb1 /mnt

here only root can create / modify files in /mnt but after
bindfs -u bob /mnt ~/usb
bob is able to modify/create files in /mnt through ~/usb , but he is still not able to create/modify files directly in /mnt.



edited upon request of clarification.

2
  • 2
    It might be helpful to add some commentary so that readers can learn. – Julian Knight Jun 25 '15 at 18:53
  • While this may answer the question, it would be a better answer if you could provide some explanation why it does so. – DavidPostill Jun 25 '15 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.