LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-21-2008, 03:53 AM   #1
srihariv
LQ Newbie
 
Registered: Jan 2008
Posts: 19

Rep: Reputation: 0
Help me out !!! dd command failed


Hello all,

iam trying to perform a dd command on a already partition hard drive.

i gave the following command dd if=/dev/zero of=/dev/sda bs=512 count=1
but iam not able to zero out the MBR record present in sda. Iam not able to copy zero bytes to my sda partition , so that i can reinstall.

Do let me know if there is something missing here..

Regards,
Srihari.
 
Old 01-21-2008, 05:50 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
The MBR is just 512 bytes at the start of the disk. So, if your disk is sda, then
"dd if=/dev/zero of=/dev/sda bs=512 count=1" will put zeroes on those first 512 bytes.

Same goes for a partition:
"dd if=/dev/zero of=/dev/sda1 bs=1024"
will overwrite partition sda1 with zeroes.

You'll need to boot with a Live CD such as Knoppix or even Tom's RTB. Or, as I would do, boot with the Slackware install CD1 and when you login as root, issue the command(s).
 
Old 01-21-2008, 07:30 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by srihariv View Post
Hello all,

iam trying to perform a dd command on a already partition hard drive.

i gave the following command dd if=/dev/zero of=/dev/sda bs=512 count=1
but iam not able to zero out the MBR record present in sda. Iam not able to copy zero bytes to my sda partition , so that i can reinstall.

Do let me know if there is something missing here..

Regards,
Srihari.
What happended when you ran the command? How do you know that it did not write the zeros?

Note: It's not a good idea to run dd on a drive that is in use. Much better to run from a live CD, or another disk.

Also, If you just want to install GRUB to the mbr, it's not necesary to erase it first.
 
Old 02-18-2008, 07:31 AM   #4
srihariv
LQ Newbie
 
Registered: Jan 2008
Posts: 19

Original Poster
Rep: Reputation: 0
Got the root cause

The actual problem here was the /dev/sda1 files where not proper,i mean they were all corrupted. stat command on each of those files failed which meant the files were either corrupt or not created properly.

So whenever i create the new partition setup i end up doing a
/dev/sda* . i remove all the sda files and then create the file as

mknod /dev/sda1 b 0 8 a block file

and similarly for all the other sda files.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind9: NDC command failed : rndc: connect failed: connection refused Boudewijn Linux - Networking 19 01-02-2014 07:19 AM
How To Resume Failed copy ( cp command ) where it left off? fortezza Linux - Newbie 9 12-23-2011 01:34 PM
mount command failed to apply journal lotuseclat79 Linux - Software 4 09-07-2007 02:27 PM
cryptsetup - command failed: invalid argument Captain Harlock Debian 2 05-09-2006 12:18 AM
Bash command $? failed to execute. Linh Programming 7 05-14-2004 11:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:41 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
Open Source Consulting | Domain Registration