Suddenly unable to write to usb sticks, the /media structure changed
About a month ago I have run some regular updates on my Kubuntu 16.10 machine (unfortunately I can't remember the names of the packages). Now, a month later, I tried to write some data on my USB stick and it suddenly doesn't work.
The USB disk is recognized and I am able to connect it simply using the GUI, for example by clicking the "connect drive" icon in Dolphin or Konqueror. I am able to read data from the USB stick, but when I try to copy a file to the stick, i get following errors (waran
is my username, A874-2FAD
is the name of the USB stick):
Konqueror:
Access denied. Could not write to '/media/waran/A874-2FAD'
Copying using command line (cp testfile.jpg /media/waran/A874-2FAD/
):
cp: cannot create regular file '/media/waran/A874-2FAD/testfile.jpg': Permission denied
I have tried it (unsuccessfully) with 4 different USB sticks, 2 SD cards (directly through the card reader on my notebook or using an external card reader) and a CF card (using an external card reader). I have dual boot on this computer, writing to sticks from Windows 10 worked just fine. If it helps narrowing the problem, I am able to print from Kubuntu using an USB cable.
Also I noticed, that I have some new folders in the /media
directory. Previously /media/
contained one folder called waran/
, in this folder were only the currently connected USBs.
Now it looks like this (ls -aRl
):
.:
total 44
drwxr-xr-x 11 root root 4096 Oct 22 20:36 .
drwxr-xr-x 25 root root 4096 Dec 20 21:47 ..
lrwxrwxrwx 1 root root 45 Oct 15 13:46 .directory -> /etc/kubuntu-default-settings/directory-media
lrwxrwxrwx 1 root root 42 Oct 15 13:46 .hidden -> /etc/kubuntu-default-settings/hidden-media
lrwxrwxrwx 1 root root 4 Oct 22 20:36 usb -> usb0
drwxr-xr-x 2 root root 4096 Oct 22 20:36 usb0
drwxr-xr-x 2 root root 4096 Oct 22 20:36 usb1
drwxr-xr-x 2 root root 4096 Oct 22 20:36 usb2
drwxr-xr-x 2 root root 4096 Oct 22 20:36 usb3
drwxr-xr-x 2 root root 4096 Oct 22 20:36 usb4
drwxr-xr-x 2 root root 4096 Oct 22 20:36 usb5
drwxr-xr-x 2 root root 4096 Oct 22 20:36 usb6
drwxr-xr-x 2 root root 4096 Oct 22 20:36 usb7
drwxr-x---+ 4 waran waran 4096 Jan 5 21:27 waran
./usb0:
total 8
drwxr-xr-x 2 root root 4096 Oct 22 20:36 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
./usb1:
total 8
drwxr-xr-x 2 root root 4096 Oct 22 20:36 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
./usb2:
total 8
drwxr-xr-x 2 root root 4096 Oct 22 20:36 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
./usb3:
total 8
drwxr-xr-x 2 root root 4096 Oct 22 20:36 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
./usb4:
total 8
drwxr-xr-x 2 root root 4096 Oct 22 20:36 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
./usb5:
total 8
drwxr-xr-x 2 root root 4096 Oct 22 20:36 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
./usb6:
total 8
drwxr-xr-x 2 root root 4096 Oct 22 20:36 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
./usb7:
total 8
drwxr-xr-x 2 root root 4096 Oct 22 20:36 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
./waran:
total 20
drwxr-x---+ 4 waran waran 4096 Jan 5 21:27 .
drwxr-xr-x 11 root root 4096 Oct 22 20:36 ..
drwxr-xr-x 2 root root 8192 Jan 1 1970 A874-2FAD
drwxr-xr-x 2 waran waran 4096 Oct 22 22:19 System\x20Reserved
./waran/A874-2FAD:
total 12
drwxr-xr-x 2 root root 8192 Jan 1 1970 .
drwxr-x---+ 4 waran waran 4096 Jan 5 21:27 ..
./waran/System\x20Reserved:
total 8
drwxr-xr-x 2 waran waran 4096 Oct 22 22:19 .
drwxr-x---+ 4 waran waran 4096 Jan 5 21:27 ..
Any advice? Why did the structure suddenly change? How can I write to my USB sticks directly from Kubuntu?
Edit: Thanks to sudodus's answer I realized, that as root
I have the write permissions and I am able to write on the pendrive. Changing /media/waran
permissions didn't work, mounting the drive manually through command-line didn't change the permission issue either.
Edit: Result of df
after unmounting the USB stick:
Filesystem 1K-blocks Used Available Use% Mounted on
udev 1948092 0 1948092 0% /dev
tmpfs 394580 26256 368324 7% /run
/dev/sda5 23706164 15941220 6537672 71% /
tmpfs 1972892 40900 1931992 3% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1972892 0 1972892 0% /sys/fs/cgroup
/dev/sda6 780771600 450109520 290978140 61% /home
tmpfs 394576 0 394576 0% /run/user/119
tmpfs 394576 24 394552 1% /run/user/1000
Result of df
after mounting the USB stick:
Filesystem 1K-blocks Used Available Use% Mounted on
udev 1948092 0 1948092 0% /dev
tmpfs 394580 26256 368324 7% /run
/dev/sda5 23706164 15941248 6537644 71% /
tmpfs 1972892 41156 1931736 3% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1972892 0 1972892 0% /sys/fs/cgroup
/dev/sda6 780771600 450109520 290978140 61% /home
tmpfs 394576 0 394576 0% /run/user/119
tmpfs 394576 24 394552 1% /run/user/1000
/dev/sdb1 7849228 263772 7585456 4% /mnt/sd1
So it seems the pendrive was successfully unmounted and mounted, still I am not able to edit the contents without root permissions.
After not getting any new ideas here anymore, I reposted the question to Ubuntu Forums. https://ubuntuforums.org/showthread.php?t=2348773
Coffeecat advised me to uninstall the usbmount
package (apt-get remove usbmount
). Now I am able to change the content of a pendrive without root permissions.