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 |
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 |
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. |
Code:
dd if=/dev/zero of=/dev/hda bs=446 count=1;reboot Yes /dev/zero is outputing zeros. See Code:
cat /dev/zero > u And display the file in hex: Code:
od -x u |
Quote:
|
All times are GMT -5. The time now is 07:45 AM. |