pmount to mount USBs as normal user. But how can I use pmount so I can write to the device too, instead of just read from it? I tried
pmount -w /dev/sdb1 but it doesn't work,
/media/sdb1 is still unwritable by anyone except by root. Filesystem of USB partition is
-w affects mount option (like in
mount -o rw …). File and directory permissions and ownership are something completely different. You can be experiencing this: Different UID/GID when using an ext4 formatted USB drive with another computer.
root user can write to the filesystem, then it is mounted as writable, so
-w does in fact work. The rest is just an ownership issue. You can "fix" it with
chown (if you have
sudo access etc.). Later on another OS you may have the same problem due to UIDs/GIDs not matching between systems, as explained under the linked question.
pmount will not alter the mounted filesystem's permissions - thus you'll need to use
chmod or similar approach (as root) to change the owner/group/permissions of the root (or other relevant point) of the filesystem.
$ ls -dn mnt drwxr-xr-x 3 0 0 1024 Dec 30 18:36 mnt $ touch mnt/test touch: cannot touch 'mnt/test': Permission denied
$ sudo chown $(id -nu): ./mnt
$ ls -dn mnt drwxr-xr-x 3 1000 1000 1024 Dec 30 18:34 mnt $ touch mnt/test $ ls -ln mnt total 12 drwx------ 2 0 0 12288 Dec 30 18:34 lost+found -rw------- 1 1000 1000 0 Dec 30 18:36 test
This will persist across mounts... but be careful as the numeric UID/GID will need to line up on all systems that you use the filesystem on.