LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-20-2006, 10:26 PM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Rep: Reputation: 30
What is blocksize?


Pretty simple question. I see people using this with dd all the time. What difference does it make when you use a block size of say 1M in comparison to 512? Thanks.
 
Old 04-21-2006, 01:14 AM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
Quote:
Originally Posted by binarybob0001
What difference does it make when you use a block size of say 1M in comparison to 512? Thanks.
Obviously dd will copy the data in larger chunks per read and write operation. This means fewer calls to read(2) and write(2), so fewer context switches. If this is the only effect, you should expect a (very slight) speedup.

However, there is probably some gain I don't know about by copying in block sizes that match those of the hardware and/or file system.

Finally, it may be affected by local variance, cosmic rays and ISO standards. So, go measure it for yourself.

hth --Jonas
 
Old 04-21-2006, 07:06 AM   #3
debasish_5849
Member
 
Registered: Jan 2006
Location: India
Distribution: fedora core 5
Posts: 42

Rep: Reputation: 15
not really related to the forum topic jonaskoelker. But would you please tell me where you found the Microsofts guilty things you mentioned in your signature?
 
Old 04-21-2006, 03:29 PM   #4
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
OK, I will test them, but first I need to figure out how to find the blocksize of my hardware. I will need to know the blocksize of my hardware though. How do I find that out?
 
Old 04-21-2006, 06:29 PM   #5
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
Quote:
Originally Posted by binarybob0001
I will need to know the blocksize of my hardware though. How do I find that out?
Don't know, but 512 bytes is a pretty sound guess.

OT: I can't recall where I find out that microsoft was indeed found guilty of anti-trust violations, but I'm sure that your favorite search engine is a good place to start.
 
Old 04-21-2006, 06:59 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by binarybob0001
OK, I will test them, but first I need to figure out how to find the blocksize of my hardware. I will need to know the blocksize of my hardware though. How do I find that out?
I don't think blocksize is a property of hardware. For example, if you are using dd to put thing on a hard disk, you can use just about any block size you want. Probably the same answer for a floppy or a usb memory stick.

Obviously, using a block size larger than the capacity of the target device would not make sense......
 
Old 04-21-2006, 07:27 PM   #7
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
pixellany: you're not wrong, but you're not completely right either. Basically, the word `block' menas something to dd, and something different to the disk, and something completely third to the file system.

As I alluded to, making the size of a dd block be the size of a disk block and/or fs block may have advantages.
 
  


Reply


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



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

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