LinuxQuestions.org
Visit Jeremy's Blog.
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 12-13-2005, 03:04 AM   #1
ohovus
LQ Newbie
 
Registered: Nov 2005
Posts: 10

Rep: Reputation: 0
Please explain how dd works and what it does


Hello All,

dd if=/dev/zero of=/dev/hda bs=446 count=1;reboot
I know above command wipe out MBR, but how it works?
dd if=/dev/zero of=myfile bs=1M count=5
This creates 1mb file but then how it works please
explain, I am a newbie who want to learn.
Thanks,
Ohovus
 
Old 12-13-2005, 07:34 AM   #2
[NL]_Target
Member
 
Registered: Aug 2003
Distribution: Arch Linux 0.7
Posts: 81

Rep: Reputation: 15
dd if=/dev/zero of=/dev/hda bs=446 count=1

To my understanding (I'm not 100% sure) this writes out exactly as much data as the MBR is large, so effectively wiping it out. /dev/hda means the 'disc' A. This is different than for example /dev/hda1, which would be the partition. /dev/hda is the raw disk, and when you write this ammount of data to it it wipes out the MBR, cause these are the first couple of blocks on that file. /dev/zero is, as the name suggests, a file that contains only 0's :-).

I hope this helps you out, if anyone has a better explanation, I'd be very interested to learn about it.

Greets, Target
 
Old 12-13-2005, 09:19 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Have you read the man page on dd? In particular, understand the count, seek and skip commands.
Does anyone know for a fact that /dev/zero makes all "0"s? I've never seen this before.

Generically, dd moves blocks of data from point a to point b without regard for filesystems and formatting. Powerful, but dangerous.

i will post an excellent tutorial if I can find it.
 
Old 12-13-2005, 09:45 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
Code:
dd if=/dev/zero of=/dev/hda bs=446 count=1;reboot
This is a dangerous command!!

Yes /dev/zero is outputing zeros. See
Code:
cat /dev/zero > u
Interrupt the command just after pressing enter, otherwise your disk can be full very quickly

And display the file in hex:
Code:
od -x u
There is a very good tutorial by a poster on linuxquestions, use the search.
 
Old 12-13-2005, 09:48 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by nx5000
There is a very good tutorial by a poster on linuxquestions, use the search.
I just posted a link to it
 
  


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 me understand what this is saying. Distorted.Clarity Linux - Newbie 11 12-13-2005 08:31 PM
Need help to understand C4bo Debian 2 06-13-2005 07:53 AM
Help me Understand what I have to do... cjkeeme Linux - Networking 5 05-15-2005 03:05 PM
understand 1.4 mAineAc Linux - Software 6 01-06-2005 02:59 AM
i don't understand... humanveal Linux - Software 17 05-20-2003 04:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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