LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-30-2011, 06:59 AM   #1
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Rep: Reputation: 15
How do I make USB drive non-write ahead.


I'm running Ubuntu 10.04 Lucid Lynx and when I write to a USB pen drive, there is no indication that the file(s) have been completely written, even though the copy bar reaches 100% and vanishes, it seems that Linux uses a write ahead buffer to store the file(s) then sends the buffer contents to the pen drive, is there a way to disable USB write ahead so that the data is written on-the-fly?
 
Old 08-31-2011, 02:05 AM   #2
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
Put the "sync" option in /etc/fstab, at the line of your USB pen drive
 
Old 08-31-2011, 02:36 AM   #3
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Stéphane Ascoët View Post
Put the "sync" option in /etc/fstab, at the line of your USB pen drive
I looked in fstab there is no entry for the usb pen drive, but in the file mtab it does show the drive (/dev/sdb1 /media/Data\040Backup\0402 ext2 rw,nosuid,nodev,uhelper=udisks 0 0), but, the device and mount point changes when different pen drives are inserted, thus adding 'sync' would not work, because the mount point line in mtab would vanish, and defaults return when another pen drive is inserted.

Windoze uses direct write to USB, and in theory Linux should also have that capability, for all USB mass storage devices.

Last edited by Usalabs; 08-31-2011 at 02:40 AM.
 
Old 08-31-2011, 02:45 AM   #4
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
Post Direct writing on flash memory

Direct writing on flash memory isn't a very good thing for durability... You can add the line in fstab and mount it manually...
 
Old 08-31-2011, 02:59 AM   #5
Usalabs
Member
 
Registered: Jan 2004
Distribution: OpenSUSE 42.1 Server
Posts: 158

Original Poster
Rep: Reputation: 15
Pen drives auto mount with no problem. Oh well, looks like I'll have to sit and wait and just keep right clicking the drive icon and selecting 'Safely remove device' until it doesn't show the warning, then I can pull out the pen drive, and on some drives I have (16GB) the wait can be as long at 30 minutes after the copy bar as finished and disappeared.

I thought the idea was to plug in a pen drive, write to it, and pull it out, simple?, right?, wrong, with Linux it's a case of, plug in the drive, write to it, wait up to 30 minutes (depending on file size), then pull it out,, but with windoze, plug it in, copy a file, pull it out, done.

A 4GB ISO copied to a 16GB USB 2.0 pen drive, in windoze takes up to 5 minutes or less, the same file in Linux takes 15 minutes or more.
 
Old 08-31-2011, 03:05 AM   #6
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
Thumbs down Removing pen drive

Whatever the sync option is on any OS, force remove a storage unit is dangerous! When you ask for ejection, the cache will be flushed and the drive unmounted
 
Old 08-31-2011, 06:29 AM   #7
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Suggestion: Open a terminal window and execute the sync command as root. When the shell prompt returns, your USB device should be fully written to. A bit of a pain, but I find it very useful when writing large files to slow USB flash drives
 
Old 09-01-2011, 06:25 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
A 4GB ISO copied to a 16GB USB 2.0 pen drive, in windoze takes up to 5 minutes or less, the same file in Linux takes 15 minutes or more.
Windows and linux usb-2.0 run at ~12 MB/S or a little above, in most cases. USB-1.x runs at 1 or 2 MB/S. 15Mins for a 4G iso implies attempts at usb-2.0, and dropping back to 1.0 on errors. Check the drive, and physical connection on the port. USB plugs age like everything else.
 
  


Reply



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
[SOLVED] can't write on my WD usb drive aihaike Slackware 1 01-13-2010 08:23 PM
Cant write to usb drive casino_boy Linux - Hardware 5 08-21-2009 12:10 AM
Cannot write to USB flash drive leisa Linux - Hardware 7 01-02-2008 09:30 AM
How to write to usb tape drive? neocontrol Linux - Software 2 11-02-2007 10:12 AM
External hard-drive - readonly, can't make it read/write mooseman Linux - Hardware 3 05-18-2007 02:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:09 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