LinuxQuestions.org
Visit Jeremy's Blog.
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 10-26-2020, 09:43 AM   #1
debianlearner
Member
 
Registered: May 2019
Posts: 80
Blog Entries: 1

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, 08:10 PM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Rep: Reputation: 271Reputation: 271Reputation: 271
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.
 
  


Reply

Tags
usb



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 11:16 AM
slackware 14.1 copying data to usb drives results data loss corruption TuxDork Slackware 7 02-17-2015 11:10 AM
[SOLVED] Compiz-Fusion 0.8.4 Causes Text Corruption in Aterm on Slackware 13.1 rmjohnso Slackware 2 06-06-2010 07:24 PM
Kernel bug causes EXT3 FS corruption? Gralgrathor Linux - General 6 10-24-2008 11:34 PM
File System Corruption - Causes and Consequences? Ingla Linux - General 3 10-10-2006 11:59 AM

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

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