LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-09-2005, 05:03 PM   #1
JoshR
LQ Newbie
 
Registered: Jun 2005
Location: Bodfish, CA
Distribution: Debian, Ubuntu,Mepis
Posts: 26

Rep: Reputation: 15
Wiping MBR program?


Here's what I want to do:

Sometimes I just want to wipe all partitions, MBR, and start from scratch.

The reason is that I play a lot with different OS's, including Linux.

What I'm doing now is using a debug script found in Win98SE Start-up disk, and forcing int 13 to start over, thus forcing fdisk to start fresh with the MBR.

Questions:

Since Dos doesn't read a Linux partition, am I wiping those, too? (are Linux partition tools fdisk based?)

I'm now using Darik's Boot and Nuke (written in Linux), but it takes a LONG time> Any thing else out there?

Anybody steer me to a way to write the debug script in a batch file, put it on a boot disc, and have it operate on auto? Will this even work on Linux?


My MBR is corrupted right now, and I'm a bit puzzled.........(naturally I messed up and let some lilo go there, or maybe Grub, or maybe GAG

Thanks for any guidance

JR

Last edited by JoshR; 07-09-2005 at 05:06 PM.
 
Old 07-09-2005, 05:24 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
If you want to wipe the MBR, boot your favorite linux rescue disk and:

dd if=/dev/zero of=/dev/hda bs=512 count=1

Of course, replace "/dev/hda" with the drive whose MBR you want to wipe. This command will write one 512-byte block of binary zeros onto the specified drive in the first record (the MBR).
 
Old 07-09-2005, 06:05 PM   #3
JoshR
LQ Newbie
 
Registered: Jun 2005
Location: Bodfish, CA
Distribution: Debian, Ubuntu,Mepis
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks Mac!

<gulp> I actually just found out the same thing using google. Although I tried it about a zillion times on the same subject. Maybe google is putting their *paid* subscribers to the front, heh?

anyway, here's the link....

http://www.linuxgazette.com/issue63/okopnik.html

I'm going to get a copy of Tom's boot disk and try it right now! And thanks again.

BTW, appparently the debug script also works in dos.

JR
 
Old 07-09-2005, 06:10 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
If you have a Win98 start up disk, why didn't you just boot from it and run fdisk /mbr? That would have replaced the existing mbr with a clean, new one. Also, the DOS fdisk (fdisk) command will wipe Linux partitions - they will show up as non-DOS, but are still wipeable.
 
Old 07-10-2005, 01:20 AM   #5
JoshR
LQ Newbie
 
Registered: Jun 2005
Location: Bodfish, CA
Distribution: Debian, Ubuntu,Mepis
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by XavierP
If you have a Win98 start up disk, why didn't you just boot from it and run fdisk /mbr? That would have replaced the existing mbr with a clean, new one. Also, the DOS fdisk (fdisk) command will wipe Linux partitions - they will show up as non-DOS, but are still wipeable.
Well, I did investigate this a few years ago. IIRC, fdisk /mbr simply rewrites a dos/win/xp version and doesn't wipe it. I forgot the problems it didn't fix.....but I think it used another copy stored on the drive.........so, I got ANOTHER windows mbr. The problems? Well, I was re-installing XP or something from an OEM disc and it wouldn't allow it. Also some third party boot managers wouldn't work. Also, any mbr virus stays...........Plenty of reasons to want to really wipe it. What's your experience? Plenty of people I know say it won't do anything except restore what was on it. Which is what I didn't want, naturally.

JR

JR
 
Old 07-10-2005, 03:53 AM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Whenever I have used it, fdisk /mbr wiped the mbr clean and I could then start again. Many many people on LQ have used it.
 
Old 07-10-2005, 04:32 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Why does this keep coming up - don't people know how to search ???.
First up, the first sector on the primary disk (usually called the MBR) consists of exectable boot code, the partition table, *and* a 2 byte signature - it is NOT just boot code.

- MBRs rarely (if every) need wiping. A virus might be a reason.
- re-installing a boot-loader (any boot-loader) will invalidate the previous incumbent - including viruses. There is no need to erase first.
- there is no need to erase partitions - in fact generally there's probably no need to even delete them.
- formatting or mkfs will effectively erase a partition. Much quicker - unless you have security requirements to meet DoD specifications. In which case you shouldn't be asking here.
- do *NOT* use the above dd command. See this for some tests I did.
 
Old 07-10-2005, 11:51 AM   #8
JoshR
LQ Newbie
 
Registered: Jun 2005
Location: Bodfish, CA
Distribution: Debian, Ubuntu,Mepis
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by syg00
Why does this keep coming up - don't people know how to search ???.
First up, the first sector on the primary disk (usually called the MBR) consists of exectable boot code, the partition table, *and* a 2 byte signature - it is NOT just boot code.

- MBRs rarely (if every) need wiping. A virus might be a reason.
- re-installing a boot-loader (any boot-loader) will invalidate the previous incumbent - including viruses. There is no need to erase first.
- there is no need to erase partitions - in fact generally there's probably no need to even delete them.
- formatting or mkfs will effectively erase a partition. Much quicker - unless you have security requirements to meet DoD specifications. In which case you shouldn't be asking here.
- do *NOT* use the above dd command. See this for some tests I did.
Why does this keep coming up? Well, it seems obvious with your link...

You wrote "this is crap-programming. I'll submit a bug report..........."

Plus, most are generally not as expert in this area as you seem to be. There appears to be differences of opinion on what to do/why/ and how..........

I DID, however use Nuke and Boot on my other box. I have no idea if I can partition and format due to the "bug" in fdisc. has it been fixed? Also, one experiment I did last week involved formatting over a previous install (mandrake) and installing Debian. When it booted, it had Mandrake's screen in with Deb's logo ovverlayed (is this a word)? Weird stuff.

And yes, I searched this forum with all the keywords I could think of previous to the post........

JR
 
Old 07-10-2005, 12:02 PM   #9
JoshR
LQ Newbie
 
Registered: Jun 2005
Location: Bodfish, CA
Distribution: Debian, Ubuntu,Mepis
Posts: 26

Original Poster
Rep: Reputation: 15
OH, one more example...........

While trying to format previous built partitions with QTParted (found on CD rescue CD) the prog wouldn't touch other installs. That's right, it was designed to never remove any other Linux install. I think this is the reason I was looking to wipe the MBR.........(and about that 2 byte sig on the MBR) WHO use that and why? Just an identifier?

JR
 
Old 07-10-2005, 01:07 PM   #10
JoshR
LQ Newbie
 
Registered: Jun 2005
Location: Bodfish, CA
Distribution: Debian, Ubuntu,Mepis
Posts: 26

Original Poster
Rep: Reputation: 15
Update:


Since I ran "nuke and Boot" yesterday, I tried to use PqParted today to partition and reformat to better arrange my HD to my liking

So what happened? Nothing, Wouldn't work. so it indeed appears that using the dd command in Linux, or Nuke and Boot erases EVERYTHING, and some things that fdisk, etc requires in order to work.

I then tried to load my XP OEM to use fixmbr. No joy. Wouldn't load. Tried my XP start-up disk. No joy. No fdisk included apparently.

Next, I loaded the 98SE start-up and ran "fdsik /mbr". After that Qtparted worked fine (except it found an 8 gig partition (unknown format) I had to delete first)

Can anyone explain what happened here?? And maybe make it a sticky thread? That way, this topic wouldn't come up so much and everybody could leave their attitude at home

JR
 
  


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
wiping/reinstalling windows MrLizard General 7 05-30-2005 03:57 AM
Wiping MBR? orange400 Linux - General 8 06-25-2004 09:30 AM
Suggested way of wiping HD mymojo Linux - General 4 12-01-2003 01:35 PM
another NFS question (rpc: progra....) lackluster Linux - Networking 5 03-20-2003 08:32 AM
Secure Wiping X11 Linux - Security 0 01-30-2002 08:51 AM

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

All times are GMT -5. The time now is 07:51 PM.

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