LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "dd" doesn't zero out the MBR?? (https://www.linuxquestions.org/questions/linux-newbie-8/dd-doesnt-zero-out-the-mbr-681126/)

alirezan1 11-04-2008 02:49 PM

"dd" doesn't zero out the MBR??
 
hi guys,

I want to create a DRBD disk with external meta data. The underlying disk for DRBD is /dev/md0.
Whenever I want to create the disk, it shows:
Quote:

# drbdadm create-md drbd0
v08 Magic number not found
md_offset 0
al_offset 4096
bm_offset 36864

Found ext2 filesystem
This would corrupt existing data.
If you want me to do this, you need to zero out the first part
of the device (destroy the content).
You should be very sure that you mean it.
Operation refused.

Command 'drbdmeta /dev/drbd0 v08 /dev/sdb1 0 create-md' terminated with exit code 40
drbdadm aborting
So, I figured I had to use dd to zero out the first part of the disk. So, I did:

Quote:

# dd if=/dev/zero of=/dev/md0 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.0304664 s, 16.8 kB/s
but then again when I try to create the disk I get the same error:

Quote:

# drbdadm create-md drbd0
v08 Magic number not found
md_offset 0
al_offset 4096
bm_offset 36864

Found ext2 filesystem
This would corrupt existing data.
If you want me to do this, you need to zero out the first part
of the device (destroy the content).
You should be very sure that you mean it.
Operation refused.

Command 'drbdmeta /dev/drbd0 v08 /dev/sdb1 0 create-md' terminated with exit code 40
drbdadm aborting
Can someone help me figure out what I'm doing wrong?

Thanks

Disillusionist 11-04-2008 03:12 PM

Wouldn't the Ext2 filesystem be after the master boot record?

Does /dev/md0 contain any data that you want to keep? if not try increasing the count to 2.

Remember dd is referred to as "Data Destroyer" for good reasons. Always make sure you have a verified backup.

alirezan1 11-04-2008 03:15 PM

Quote:

Originally Posted by Disillusionist (Post 3331699)
Wouldn't the Ext2 filesystem be after the master boot record?

Does /dev/md0 contain any data that you want to keep? if not try increasing the count to 2.

Remember dd is referred to as "Data Destroyer" for good reasons. Always make sure you have a verified backup.

Yes I know! No, MD0 is not even formatted! It's a test computer and nothing important on it...

Thanks

syg00 11-04-2008 03:20 PM

When I have problems reformatting with real disks (it happens), I use count=200. This ensures you "get" both the (emulated these days) cylinder zero (for the MBR) and cylinder one (for the filesystem metadata).


All times are GMT -5. The time now is 12:15 PM.