Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-05-2011, 10:48 PM   #1
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
dd command help needed.

Hi I m creating a file which will serve as a virtual harddisk .

I m using following command to create a file.

#dd if=/dev/zero of=/tmp/Sample.dat bs=1M count=1024
I have following doubts regarding the operation.
1) In above example i m creating a file with byte size of 1M .However in windows O/S (Not sure about linux here) whenever a new partition is formatted the default size will be 4096 bytes.

2) According to my assumption it doesn't make any difference as OS is anyway going to format it using mkfs.(whatever filesystem we specify).
Correct me if i m wrong.

3)Will it make any performance issue ?

Last edited by pinga123; 05-05-2011 at 10:50 PM.
Old 05-05-2011, 10:57 PM   #2
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,134
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
1. bs stands not for byte size, but for block size. It is only there for making it easier to calculate the resulting size of the file (at least in this case). It doesn't make any difference if you choose the standard size (512 bytes), 4096 bytes or 1 MB, as long as you choose the appropriate count-value to come to a gigabyte. This has nothing to do with the blocksize of the file-system.

2. Exactly.

3. The only performance issue you will see is when creating that file. With a blocksize of 1MB you should get a decreased creation time for that image file as when choosing 4KB. I usually choose 1MB when creating image-files (for easier calculation) and 16MB when copying from disk to disk or from image to disk (or disk to image) for better performance while copying. After the file is created you will not notice any difference in performance.
1 members found this post helpful.


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
Help needed for sed command. pinga123 Linux - Newbie 2 11-06-2009 01:57 AM
dd command help needed here neocontrol Linux - General 3 10-12-2008 10:18 AM
Help needed 1 command line. turalo Linux - Newbie 5 05-08-2007 02:27 AM
linux Command needed cherupop Linux - Newbie 4 07-05-2005 11:33 PM
command line help needed mykrob Linux - Software 5 10-08-2004 12:10 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration