LinuxQuestions.org
Review your favorite Linux distribution.
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 11-04-2008, 03:49 PM   #1
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Rep: Reputation: 15
"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
 
Old 11-04-2008, 04:12 PM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,036

Rep: Reputation: 96
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.
 
Old 11-04-2008, 04:15 PM   #3
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Disillusionist View Post
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
 
Old 11-04-2008, 04:20 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,834

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
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).
 
  


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
TripleBoot - how to "move" grub from MBR to BootSector Dekker Linux - Newbie 12 01-24-2010 09:59 AM
How do I restore my MBR aka "Oops I messed up my Grub" codeape Debian 4 04-13-2007 12:14 AM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 09:31 AM
"Disk boot failure..." after lilo writes to the MBR alexko Linux - Hardware 6 11-16-2004 10:43 AM
Will "grub-install /dev/hda" kill Windows XP MBR? Zullocrit Linux - Newbie 3 09-25-2004 10:50 AM


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