LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 02: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, 03:12 PM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
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, 03: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, 03:20 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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



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

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

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