LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-04-2015, 07:21 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,023

Rep: Reputation: 176Reputation: 176
Why is usb flash drive so slow when unmounting?


When I use the non-root version of Back in Time it takes the snapshot really quickly, less than ten seconds. But when I go to unmount the flash drive it writes for five or six minutes.

It never used to be so slow. What changed is I was using a Sandisk 32GB (USB 2.0) that was formatted FAT32. Then Back in Time stopped allowing FAT32. So I got a brand new drive (Kingston Data Traveler G4) and formatted it NTFS and used that as the destination drive.

There's 1.3 GB used on the flash drive and it's all for Back in Time.

Any idea why it might be so slow when I'm unmounting it? (The Sandisk drive wrote for only maybe ten seconds when it was unmounted.)

Thanks.
 
Old 12-05-2015, 09:17 AM   #2
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
How long did it take to run the backup with the old flash drive?

I've noticed a similar phenomenon when I copy a bunch of files to any of my flash drives. From what I've found, it has to do with Linux's write cache. Basically, when a program wants to write to the disk, Linux saves it in RAM and tells the program that it's done. In reality, it takes much longer for that data to actually end up on the disk. When you unmount it, Linux first needs to finish writing all of that data. Depending on what you were doing, that might take a while.

In my experience, if you're writing lots of files, wait times of around 5 minutes aren't unusual. I usually run the unmount command in a terminal, go do something else, and come back to it in a few minutes.
 
1 members found this post helpful.
Old 12-05-2015, 11:36 AM   #3
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
How are you mounting the flash drive? In fstab?
 
1 members found this post helpful.
Old 12-05-2015, 11:43 AM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,086

Rep: Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279
A lot of people seem to report this problem, with Windows as well as Linux. I do daily backups on to USB and I don't get anything like 5 minutes for 1 GB. Of course, I always format USB sticks to ext2, having had a few accidents in the days when I kept their Windows filing systems. Still, there could be a problem with the drive you bought. Could you arrange try it on a different computer? A quick solution which actually works for some people is just to use a different USB port.
 
1 members found this post helpful.
Old 12-05-2015, 10:39 PM   #5
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,023

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by maples View Post
How long did it take to run the backup with the old flash drive?
The old drive (the Sandisk) was really quick, both with the Back In Time snapshot and the writing when I unmounted it.

Quote:
Originally Posted by maples View Post
I've noticed a similar phenomenon when I copy a bunch of files to any of my flash drives. From what I've found, it has to do with Linux's write cache. Basically, when a program wants to write to the disk, Linux saves it in RAM and tells the program that it's done. In reality, it takes much longer for that data to actually end up on the disk. When you unmount it, Linux first needs to finish writing all of that data. Depending on what you were doing, that might take a while.
Thanks maples. Interesting. I just wonder why it was quick with the one usb flashdrive and slow with the other. Plus, I've never experienced things taking five minutes to write something before. And with the Back In Time it's only supposed to be writing the incremental changes and they have been minimal. (Like less than 200KB.)
 
Old 12-05-2015, 10:40 PM   #6
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,023

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by TxLonghorn View Post
How are you mounting the flash drive? In fstab?
Just right-clicking on the usb icon on the Desktop and choosing "unmount."
 
Old 12-05-2015, 10:42 PM   #7
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,023

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by DavidMcCann View Post
A lot of people seem to report this problem, with Windows as well as Linux. I do daily backups on to USB and I don't get anything like 5 minutes for 1 GB. Of course, I always format USB sticks to ext2, having had a few accidents in the days when I kept their Windows filing systems. Still, there could be a problem with the drive you bought. Could you arrange try it on a different computer? A quick solution which actually works for some people is just to use a different USB port.
Thanks David. Yeah, that's a good suggestion to try the usb drive on a different computer. And I'll try the different port too.
 
Old 12-07-2015, 09:27 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,772

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
What are the rated speeds on both?
USB 3.0 might help even if you don't have a usb 3.0 controller.
Can't it use ext4?
I've had some usb flash drives that simply stink in linux. Never figured out why. They'd do great in windows but crawl in linux. I assumed some controller to driver timing issue.

Last edited by jefro; 12-07-2015 at 09:28 PM.
 
1 members found this post helpful.
Old 12-07-2015, 09:54 PM   #9
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,023

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by jefro View Post
What are the rated speeds on both?
USB 3.0 might help even if you don't have a usb 3.0 controller.
Can't it use ext4?
I've had some usb flash drives that simply stink in linux. Never figured out why. They'd do great in windows but crawl in linux. I assumed some controller to driver timing issue.
Thanks jefro. I don't know the speeds (and I think Kingston doesn't tell the speed of that particular one). I'll be able to live with the current situation and if I get too frustrated I'll experiment with other formats.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow USB Flash Drive aikempshall Linux - Hardware 8 07-23-2015 05:38 AM
flash drive keeps unmounting - sign of failure? newbiesforever General 1 08-25-2014 12:33 AM
Writing to USB flash drive becomes extremely slow earthw0rmjim Linux - Hardware 2 06-02-2012 01:16 PM
Problems mounting/unmounting flash USB drive LordSurvivoR Linux - Hardware 1 07-12-2005 11:19 PM
Unmounting USB Flash drive alanbarnard JDS 2 02-20-2005 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration