Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
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?


  Search this Thread
Old 10-26-2020, 10:43 AM   #1
Registered: May 2019
Posts: 56

Rep: Reputation: Disabled
USB port causes data corruption

A USB memory stick has been plugged into a USB 3 port for quite a few days. The stick was left there after it was discovered that the kernel does not recognise it (e.g. fdisk - l does not show the stick).

It was decided to unplug the stick. Subsequently the command
cat* /var/log/messages was run and the messages revealed that just before the stick was unplugged, the kernel suddenly found the stick and automatically mounted it to /media/usb0. While the stick was being unplugged, the system performed a 'lazy' unmount from /media/usb0.

The stick was later plugged back into the USB 3 port and the dmesg command issued. The dmesg messages revealed that the stick was probably corrupted due to the lazy unmount.

My question is :-

Why did the kernel suddenly find the stick and automatically mount it just before the stick was unplugged ?
Old 10-26-2020, 09:10 PM   #2
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 1,488

Rep: Reputation: 242Reputation: 242Reputation: 242
If it wasn't properly plugged in, perhaps because there's a bit of corrosion on the surfaces, moving it just that little bit when taking it out made the connection work, triggered an interrupt that caused the kernel to mount it. If you turn off auto-mounting this won't happen. The kernel flushes buffers to disks regularly. If a device hasn't been written-to for a few minutes unplugging without unmounting shouldn't lose data, though it may trigger a warning. fsck it.



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
Four-port KVM switch that sends keyboard data to PS2 port and mouse data to USB port Ulysses_ Linux - Hardware 5 06-20-2015 12:16 PM
slackware 14.1 copying data to usb drives results data loss corruption TuxDork Slackware 7 02-17-2015 12:10 PM
[SOLVED] Compiz-Fusion 0.8.4 Causes Text Corruption in Aterm on Slackware 13.1 rmjohnso Slackware 2 06-06-2010 08:24 PM
Kernel bug causes EXT3 FS corruption? Gralgrathor Linux - General 6 10-25-2008 12:34 AM
File System Corruption - Causes and Consequences? Ingla Linux - General 3 10-10-2006 12:59 PM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration