[SOLVED] Why is usb flash drive so slow when unmounting?
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.)
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.
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.
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
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.)
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.