LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-17-2015, 08:11 AM   #1
TuxDork
LQ Newbie
 
Registered: Dec 2011
Posts: 21

Rep: Reputation: Disabled
slackware 14.1 copying data to usb drives results data loss corruption


anytime i try to copy data to
-usb thumbdrives
-SD cards
i am getting strange errors where random chunks of data are unexplainable missing or corrupted

*as well i am starting to see such behavior on externalized hard-drives formatted to EXT4

this happens using just started copy/paste, as well as using rsync to copy move data,

usb thumbdrives especially are causing me problems where even if i format the drives to ext3 they STILL cause freezes and hangs,

my computer can read these devices fine, yet if goto copy data to them results in data loss and corruption
 
Old 02-17-2015, 09:30 AM   #2
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 14.2 64 Multi-Lib
Posts: 558

Rep: Reputation: 229Reputation: 229Reputation: 229
After copying the files, do you just "pull out" the drive, like you do on Windows ?

Or you do a proper umount via command-line, or "eject" via some desktop function ?
And if the latter, do you wait until it says you can remove the drive ?
 
Old 02-17-2015, 09:38 AM   #3
slacktroll
Member
 
Registered: May 2011
Distribution: Slackware 14.2
Posts: 140

Rep: Reputation: 24
you should probably try sync before unmounting the device and try eject (some usb devices really support the ioctl command eject uses)
 
Old 02-17-2015, 09:44 AM   #4
TuxDork
LQ Newbie
 
Registered: Dec 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
yes i use the safely remove drive feature, if the safely remove drive feature is when you right click on a drive in dolphin file manger and tells you that is safe to remove the drive at least

for example yesterday i used rysnc to copy data onto an externalized drive where i did a checksum of the data before i copied it, then once the data was on the drive the checksum told me that files where missing and few files where corrupted,

this makes sound like the externalized harddrive is failing yet i also have such a problem with SD cards and thumbdrives... where even if format the thumbdrive to EXT3 i get amazing errors all the same to the that will cause programs to freeze up

*i am using a slackware 14.1 install without much configuration from a fresh install,

i have a hotswap bay where the drives in the hotswap never have such a problem, seems to only be USB storage devices,

Last edited by TuxDork; 02-17-2015 at 10:21 AM.
 
Old 02-17-2015, 10:20 AM   #5
TuxDork
LQ Newbie
 
Registered: Dec 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
i just tore open that externalized harddrive that was giving me the errors...

i tossed it into my hotwswap bay... and ran some tests like
smartctl -d ata -l error /dev/sdc
smartctl -d ata -Hc /dev/sdc

and the tests passed

as well i was able to copy data to the drive and the it copied perfectly and checksums passed suggesting it is a USB problem
 
Old 02-17-2015, 10:46 AM   #6
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
I have noticed (for a long time) that writing to both disk drives and flash drives does not always complete when you "get the prompt back." File writes are buffered and usually will get written when the buffer is full and, I'm pretty sure, will just sit there for a while until enough additional data enters the buffer to flush it to the target media.

What I do when writing to flash drives is, when I "get the prompt back," I enter
Code:
sync;sync;sync
and watch the activity light flash for a while as the last buffer is flushed.

You can demonstrate this at any time on an active system by simply opening a terminal and enter
Code:
synce
Watch how long it takes to get the return prompt -- then repeat that and notice that the prompt is immediate. The system buffers are flushed when you "sync;sync;sync."

It's weird, it's been then forever (not just in Slackware or any other Linux but Solaris and Unix systems too) and, with removable media, it can be a pain in the hiney.

Hope this helps some.
 
Old 02-17-2015, 11:02 AM   #7
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,244
Blog Entries: 4

Rep: Reputation: 192Reputation: 192
I've seen the USB adapters (the USB to IDE/SATA board in the external case) go bad as well so it could be the adapter your plugging the drive into.
I've been making backups this way for years now and haven't had an issue. I do a second rysnc after the first so if something didn't write the second rsync would spot it.
 
Old 02-17-2015, 11:10 AM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 9,431

Rep: Reputation: Disabled
Just a reminder: for FAT file system mount has the flush option since Linux 2.6.19 IIRC - though it took some time to be documented.
 
  


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
Data loss while copying . . . yashsaxena Linux - Newbie 1 01-27-2011 12:32 AM
OSX Snow Leopard bug results in data loss Jeebizz Linux - News 1 10-13-2009 03:55 PM
Best way to simulate data loss, corruption, partition wiping, etc & then "rescue" it? linus72 Linux - General 8 06-28-2009 06:26 PM
RAID5 data rebuilding by mdadm results in corrupted data! rtyagi Linux - Newbie 0 03-26-2008 01:59 AM
Resizing ReiserFS without data loss in Slackware 9.1.. ??? crystalmethboy Slackware 2 01-20-2004 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:29 AM.

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