?
Solved

Redhat Linux USB port can't mount thumb drive anymore after an error

Posted on 2010-09-07
9
Medium Priority
?
820 Views
Last Modified: 2013-12-16

I was copying dozens of log files totalling about 4GB to a thumb drive mounted on
my Linux RHES 4.x box using "cp /etc/httpd/NSC_logs/* /usb/folder/ &"  & after
the background copying is completed (a message popped up to say the backgrd
job is done), I issued "umount /usb"  but I guess just before the umount completes,
I pulled out the thumb drive & on the console, some error messages popped up,
saying "FAT . . . bread . . . IO ..... "

Now, if I plug any thumb drive into the port, dmesg would not show any messages
to say a USB device is detected.

How can I resolve this without rebooting the Linux box?

Let me know if more info is needed
0
Comment
Question by:sunhux
9 Comments
 
LVL 3

Expert Comment

by:csalaski
ID: 33624913
Have you tried it on another nix box?
0
 
LVL 62

Accepted Solution

by:
gheist earned 668 total points
ID: 33625217
read error sounds bad.
tru fsck first
if it does not fix rewrite drive with zeroes and re-format
if it does not help you were succesful at bricking your USB drive.
0
 
LVL 41

Expert Comment

by:noci
ID: 33626658
A good practice is to use "sync; sync; sync" before unmounting a disk manualy.
Most desktop software allready does that. But do wait with the removal of the drive until the desktop software says so or the umount has been completed after sync...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:sunhux
ID: 33634825


This thumb drive is still working on my other Redhat Linux boxes.  So problem is
with the USB port on the Linux box, not the thumb drive

The full error from dmesg  :

scsi195 (0:0): rejecting I/O to device being removed
scsi195 (0:0): rejecting I/O to device being removed
scsi195 (0:0): rejecting I/O to device being removed
FAT bread failed in fat_clusters_flush
usb 1-5: new high speed USB device using address 79
scsi196 : SCSI emulation for USB Mass Storage devices



Anything I can do to fix this without rebooting as it's a Prod server?
0
 

Author Comment

by:sunhux
ID: 33634882

Is there sort of daemon or service for USB in RHES Linux that I can restart?
0
 
LVL 41

Assisted Solution

by:noci
noci earned 1332 total points
ID: 33634915
No there is no daemon for USB.

The udev daemon monitors insertions & removal of devices and handles the userland part of it.
The problem might be that there are still dirty buffers kept around and those are blocking the other IO. (I not that deep inthose parts of the kernel though).

Another problem might be a structural damage in the filesystem on the stick that prevents it from being accessible.
Did you try to fsck it on another Unix/Linux system, of CHKDSK it on an Windows system?
0
 

Author Comment

by:sunhux
ID: 33635009

But the FAT32 thumb drive is accessible on other Redhat linux USB ports & my Windows.

Anyway chkdsk gave:
The type of the file system is FAT32.
Volume Serial Number is C031-EDAC
Windows is verifying files and folders...
The size of the \ss\access-xxxxxx_log_20100829.log entry is not valid.
\ss\access-xxxxxxx_log_20100830.log  first allocation unit is not valid. The e
ntry will be truncated.
\ss\access-xxxxxxt_log_20100831.log  first allocation unit is not valid. The e
ntry will be truncated.


& I've just run "chkdsk/F thumbdrv:" & finished the corrections but still got the same
error on that server's USB port.  With other RHES USB port, it's Ok
0
 
LVL 41

Assisted Solution

by:noci
noci earned 1332 total points
ID: 33635274
As I said before it might me possible that the kernel still attempts to write buffers to an (now) non existing device. That might also prevent udev on taking the right actions for that USB controller./port.
or even system. To answer that i need to gather much more knowlegde on the inner workings of the kernel w.r.t. USB, UDEV, flushing buffers after a device went away.

If a different USB stick (which has a different serial number) or the same stick in a different port doesn't work you might need to plan a reboot for that server.
0
 

Assisted Solution

by:sunhux
sunhux earned 0 total points
ID: 33673708

Ok, looks like the only option is reboot - going to be end of this month
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question