How do I write files to a USB without being root?

You formatted the sdb1 partition using an ext* file system (either ext2, ext3, or ext4; I cannot recall the default). This is the default file system on Linux systems, and uses Unix file permissions to determine who can modify files or directories. Fresh filesystems always start off with the root (/media/usb0 in this case) being owned by root:root, and usually with permissions only allowing modification by the owner.

To see this for yoruself, mount the filesystem, then run ls -ld /media/usb0 to see the current ownership/perms. My guess is:

drwx------ 2 root root 16384 Mar   2 20:08 /media/usb0

A simple fix would be to a) chown the mounted file system to your own Linux account, or b) to give everyone write permission with chmod.

However, in the end, this wouldn't be a good solution, since the files created would become owned by your UID, not the username; this would quickly result in account mismatches when the USB drive is connected to a different system. Assuming you can connect it at all, that is – Windows does not support ext3 without extra trickery, so NTFS (mkfs.ntfs) or FAT32 (mkfs.vfat) would be a much better choice for the file system.


This happens on later Debian systems (e.g. jessie) as well with certain fat32 or ext3,4 formatted USB flash drives. You need to remove (or comment out) the following line from your /etc/fstab:

/dev/sdb1    /media/usb0    auto    rw,user,noauto    0    0

After this you'll have your USB drive mounted automatically under your regular user account's permission and not root. See detailed info on Debian forums on this link.

After that your USB drive will mount smoothly with your user write permission :)


Use sudo and change permissions with chmod command.

See my answer in that question to see how to use chmod:

  • What is the meaning of "chmod 666"?

I suggest you to use chmod 777 to allow all (using ls -l it will show drwxrwxrwx).