LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-19-2004, 05:18 PM   #1
os2
Member
 
Registered: Dec 2003
Location: Canada
Distribution: openSUSE Tumbleweed
Posts: 209

Rep: Reputation: 30
dd command...


hi
i want to create a 2gig image file...

i tried

dd of=hd.img bs=2048 seek=1000000 count=0

i get a 1,9gig

with

dd of=hd.img bs=2048 seek=2000000 count=0

i get a 3,8gig


i checked the man page... but i don't really understant bs, seek and count....



thanks
 
Old 09-19-2004, 05:57 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Are you purposely trying to create a sparse file (aka a file with holes in it)? Because that's what you appear to be doing. You're telling dd to skip 1000000 size 2048 blocks and then add 0 count blocks at the end. Why not try:

dd if=/dev/zero of=img bs=2048 count=1000000

That creates a zeroed out file with 1 million 2 KB blocks, which is 2 million KB or roughly 2 GB. Remember, a kilobyte is 1024 bytes (not 1000), i.e. it's based on base 2, not base 10, and so on with megabytes, gigabyes, etc. This is why the number can look slightly off of what you expect.
 
Old 09-19-2004, 07:06 PM   #3
os2
Member
 
Registered: Dec 2003
Location: Canada
Distribution: openSUSE Tumbleweed
Posts: 209

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by btmiller
Are you purposely trying to create a sparse file (aka a file with holes in it)? Because that's what you appear to be doing. You're telling dd to skip 1000000 size 2048 blocks and then add 0 count blocks at the end. Why not try:

dd if=/dev/zero of=img bs=2048 count=1000000

That creates a zeroed out file with 1 million 2 KB blocks, which is 2 million KB or roughly 2 GB. Remember, a kilobyte is 1024 bytes (not 1000), i.e. it's based on base 2, not base 10, and so on with megabytes, gigabyes, etc. This is why the number can look slightly off of what you expect.
i read
http://64.233.179.104/search?q=cache...hl=fr&ie=UTF-8

a qemu tutorial...

it said to use

dd of=hd.img bs=1024 seek=1000000 count=0

to create a 1 gig image file.....

but me i want to do a 2 gig image file....

don't know if i need to change bs and seek... or only seek
 
Old 09-19-2004, 07:53 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Which would be a RATHER nasty way of doing it,
the person suggesting that should be shot.

Just go with what btmiller sugested.


Warp4,
Tink :)
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 02:23 AM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 07:14 PM
Command to display whole filestructure hierarchy f/ command line? mjewell Linux - Newbie 10 01-19-2004 10:48 AM
Where is Command line utility for Cups and command tutorial mossy Linux - Software 8 01-16-2004 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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