I have a 4GB USB stick which I partitioned using sudo cfdisk /dev/sdb and formatted using sudo mkfs /dev/sdb1. It's currently set to ID 83 with System Linux when I run sudo fdisk -l on my Debian Squeeze.

I use pmount to mount the external USB drives. So doing a pmount /dev/sdb1 mounts it to /media/usb0 because I have the ff. line in /etc/fstab:

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

After issuing the pmount command, the USB is mounted to /media/usb0 -- doing an ls -l /media/usb0 gives me:

drwx------ 2 root root 16384 Mar   2 20:08 lost+found

So I go about my business and try to copy a file to /media/usb0 but I get the error below:

$ cp ~/foo.bar /media/usb0
cp: cannot create regular file `/media/usb0/foo.bar': Permission denied

But when I issue the same cp command with sudo, I am able to copy the file.

Why does this happen? I tried other USB drive I have and I am able to write to them without this error. Was there something wrong with the way I formatted or repartitioned the USB stick?

5 Answers 5


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.

  • I tried doing sudo mkfs.ntfs /dev/sdb1 and sudo mkfs.vfat /dev/sdb1 but I get the error sudo: mkfs.xxxx: command not found where xxxx is either ntfs and vfat. How do I get that to work on Debian Squeeze?
    – Eric
    Mar 2, 2012 at 13:09
  • @Eric: Install ntfs-3g + ntfsprogs + dosfstools. Mar 2, 2012 at 13:18
  • Ok, I installed that. Now when I try to mount, I get this error: ntfs-3g-mount: failed to open /dev/fuse: Permission denied. What do I do about this?
    – Eric
    Mar 2, 2012 at 14:11

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:

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


If your filesystem is FAT16 or FAT32 you have to use this command:

sudo mount -t vfat /dev/sdb1 /media/usb0 -o uid=1000,gid=1000,utf8,dmask=027,fmask=137

For more info visit the link https://help.ubuntu.com/community/Mount/USB#Mount_the_Drive


Go to file system media via the GUI. Right click on the USB drive you want to copy to and select - Open as Root. Type in password. Then you can copy delete, drag and drop. All Good

  • As alluded to above by @Sven, root:root in the ownership is the reason open as root at terminal or gui OR use chown to change either the owner or group to allow yourself to use that usb as expected. Jan 24, 2017 at 4:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .