Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-12-29 18:39:47

Friedrich
Member
Registered: 2016-09-18
Posts: 140

Unmounting USB flash drive needs a long time when writing with Thunar

Hi,

when i write files to a mounted usb flash drive with thunar unmounting needs a lot of time, sometimes 30 minutes. This happens when i mount the drive using Thunar or when i mount it using 'sudo mount'. When i don't start Thunar and using only the terminal for mounting, writing files and unmounting its no problems. Happens with all file systems (ntfs, ntrfs, ext4). When i check

lsof -t /dev/sd*

there is no process doing anything with the flash drive. There is also no problem when i use the Nemo file manager.

What is the problem?

Offline

#2 2019-12-29 22:24:47

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 862

Re: Unmounting USB flash drive needs a long time when writing with Thunar

is it plugged into a USB 1.0 only port?  at USB 1.0 speeds a huge buffer of storage device writes could take that long.  try reading the whole device, which would be even longer (but safely killable).  in a terminal, if this is /dev/sdz:

time dd bs=1024 of=/dev/null if=/dev/sdz

this could take all day for a 64GB device in a USB 1.0 only port.  then compare in a 3.0 port (if you have one with a blue tab).  or limit the command like:

time dd bs=1024 count=1024 of=/dev/null if=/dev/sdz

Offline

#3 2019-12-30 18:30:07

Friedrich
Member
Registered: 2016-09-18
Posts: 140

Re: Unmounting USB flash drive needs a long time when writing with Thunar

No, its USB 2.0 or USB 3.0. Its not a problem with the flash drive, i've tested multiple devices. It works when i mount the drive with nemo or when i try it on ubuntu mate with caja file manager.

try reading the whole device

What is that supposed to help? As i said, the problem is not the flash drive.

Offline

#4 2019-12-30 18:50:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Unmounting USB flash drive needs a long time when writing with Thunar

@Friedrich, interesting that you are getting the same delay with thunar as well as the mount command.

Try to see if you can get any log files for the time the drive is unmounting. Look at either:

  1. Your journal:

    journalctl -f

    ...then start the unmount process
    .

  2. In ~/.xsession-errors
    .

  3. Quit the thunar daemon and run thunar from the command line:

    thunar -q && thunar

    ...and start the unmount process.

As you are probably aware, there might be a short delay if a lot of data is being written, but it should never be 30 minutes of delay.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2019-12-31 23:20:05

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 862

Re: Unmounting USB flash drive needs a long time when writing with Thunar

if you have a drive with an activity light, using it may help show what is happening.  things you have described are very much like a lot of write output (or modified memory mapped pages) is buffered in memory.  file system writes sometimes get buffered while the drive goes inactive.  but they will get written during sync which a kernel umount() call will do.  the very long times could be explained by a very slow device that has accumulated a large buffer.  i would try the command "time sync;time sync;time sync" to see how long that takes, before unmounting.  reading a large amount of data from the device could also show if speed is an issue.

that all said, there could be some other issue.  but speed is the more obvious suspect (it really happens a lot though 30 minutes is extreme) and needs to be ruled out before other things can be revealed. a lot of this gets tested with commands.  having a 2nd terminal open in the same workspace (because switching workspace involves a lot of things happening that could freeze up) can help by being able try other commands while one (such as umount) is frozen.

possibilities include a high USB error rate due to bad or dirty contacts.  and if you are a CBer or ham radio operator, be sure all nearby transmitters are off (a USB dongle is also a UHF antenna).  Thunar is just an app that can cause a lot of writing, typically to update inode metadata for times a file was last read (try the "noatime" option if you doing mount by a command, to disable this).

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 8 queries executed - Memory usage: 536.73 KiB (Peak: 537.58 KiB) ]