LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices



Reply
 
Search this Thread
Old 05-05-2011, 11:48 PM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 676
Blog Entries: 2

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

Code:
#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 11:50 PM.
 
Old 05-05-2011, 11:57 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

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


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed for sed command. pinga123 Linux - Newbie 2 11-06-2009 02:57 AM
dd command help needed here neocontrol Linux - General 3 10-12-2008 11:18 AM
Help needed 1 command line. turalo Linux - Newbie 5 05-08-2007 03:27 AM
linux Command needed cherupop Linux - Newbie 4 07-06-2005 12:33 AM
command line help needed mykrob Linux - Software 5 10-08-2004 01:10 AM


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