LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-22-2018, 04:50 AM   #1
Bonsi
LQ Newbie
 
Registered: Nov 2018
Posts: 2

Rep: Reputation: Disabled
Additional Reads on USB device after sending write command via dd


I traced the traffic to a usb stick via wireshark.
I tried using different ways to write and read to and from the device.
Whenever i used dd to write directly to the device i saw a number of additional read commands a few moments after my write command was completed.
When i formatted the device with fat32, mounted it and copied files over, i did not see these read commands.
They are mostly to the first few sectors and what look like the last sectors of the device.

Can anyone tell me what these reads are? And maybe where in the kernel code i can find the code responsible for them?
Or any idea what could have caused them would be appreciated.

Bonsi
 
Old 11-22-2018, 05:07 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Welcome to LinuxQuestions.

Writing to disk is not synchronous by default. Since writing to disk is much slower the data is buffered and the write operations are performed in the background. Although you will see the next command prompt in a few moments it does not always indicate the previous command actually completed in the case of disk writes.

It depends on how much data you are writing. Formatting FAT32 does not write much data to disk i.e. two FAT tables, one at the beginning and a spare at the end as you have posted.
 
Old 11-22-2018, 05:21 AM   #3
Bonsi
LQ Newbie
 
Registered: Nov 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you.

The read commands sent to the device seem to come as a reaction to the write command that i sent.
The writing via FAT32 filesystem is after the formating. I copy a couple MB to the mounted device.
 
  


Reply



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
Difference between buffered disk reads and cached reads? pinga123 Linux - Newbie 1 07-13-2011 11:40 AM
Process crash while it reads write on the USB HDD and USB is plugged out. nitinarora Linux - Kernel 4 05-18-2009 03:37 AM
process crash while it reads write on the USB HDD and it is plugs out. nitinarora Linux - Software 1 05-07-2009 04:05 PM
USB Stick reads but won't write jaws_tas Linux - Hardware 3 09-23-2005 12:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:51 PM.

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