Solved

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

Posted on 2010-09-07
9
811 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
Comment Utility
Have you tried it on another nix box?
0
 
LVL 61

Accepted Solution

by:
gheist earned 167 total points
Comment Utility
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 39

Expert Comment

by:noci
Comment Utility
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
 

Author Comment

by:sunhux
Comment Utility


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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

Author Comment

by:sunhux
Comment Utility

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

Assisted Solution

by:noci
noci earned 333 total points
Comment Utility
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
Comment Utility

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 39

Assisted Solution

by:noci
noci earned 333 total points
Comment Utility
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
Comment Utility

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now