LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-11-2007, 05:31 PM   #1
Vegetaman
LQ Newbie
 
Registered: Oct 2007
Posts: 15

Rep: Reputation: 0
Exclamation Is it safe for me to delete the MBR on my HDD?


Windows XP SP 2 just crashed brutally on me and it keeps saying my MBR is corrupt. Well I tried installing linux over it, but it doesn't seem to want to take, and I think that I need to delete my MBR and then just install Linux. And /fixmbr didn't really do the trick...

I don't have any data on this drive that I am in fear of losing, it is pretty much just a blank 160GB Western Digital 7200 Caviar SE hard drive. If I delete the MBR, will I be borking my drive permanently (like actual damage to it), or will installing Windows XP or whatever distro of Linux put something back into the MBR and my drive should work again?

Also, I was going to use DBAN to do this, as I assume it will delete my MBR?

I intend to do this over the next day or two, because I really want to get my computer back up and running again.

Last edited by Vegetaman; 10-11-2007 at 05:32 PM.
 
Old 10-11-2007, 05:34 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
1) Boot into Windows Installation Disc
2) When It asks you what kind of installation you want type "R"
3) When you are in the recovery console type: "fixmbr" then "fixboot"
4) Reboot and take out the Installation disc
 
Old 10-11-2007, 05:39 PM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
As I understand it, when you try to install Linux, if you install a boot loader into the MBR, any existing data there will be over-written, effectively erasing it and installing what is necessary to boot Linux. Many installers at least check if you want to do this, and some offer other options like making a boot floppy.

If that part of the drive is so corrupt that data written to it cannot be later read, then you will not be able to boot from the hard disc. Any corruption like this is not a good sign for the drive, and it's generally good advice to replace it (since failures can cascade across the disc over time, spreading from the bad parts to corrupt fresh data, and ALWAYS at the worst possible moment).

You could write your boot loader files to a floppy, and boot with that in the machine, which then instructs the boot to continue from the partition rather than the MBR... this way the floppy/USB key will be necessary to boot but if the rest of the disc is OK you should be able to use it.
 
Old 10-11-2007, 06:27 PM   #4
Vegetaman
LQ Newbie
 
Registered: Oct 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Okay, now I went back to try and reinstall Windows via XP SP 2 and it tells me that it cannot format my drive because it may be damaged and then some blah-blah about SCSI devices...

I suppose my hard drive is probably dying, then, and I should get a new one? D:
 
Old 10-11-2007, 06:35 PM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
It doesn't sound very good. Unless you made some sort of hardware change which might cause the BIOS to mis-identify the drive, I think it sounds like it is dying. Try booting from a live CD and see if you can recover anything that way.
 
Old 10-11-2007, 07:33 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,265

Rep: Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027
When I have issues like that, and I can't get at the disk from a liveCD, I take the disk out and try it in another box. Eliminates issues like bad cable, controller chip dying, that sort of thing.
If you can get the data off, go ahead and scrub the disk - if not, toss it in the bin.

Scrubbing the MBR is "safe" - I have successfully re-installed both Windoze XP and recent Linux after testing a zeroed MBR. Older versions may or may not work.
 
Old 10-11-2007, 09:08 PM   #7
Vegetaman
LQ Newbie
 
Registered: Oct 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Currently booting and nuking and then will delete MBR and try one last reinstall. I don't know what happened but I think my hard drive is giving up the ghost. I have an alternate hard drive I am going to try in this box, since I don't have another computer to try it in.
 
Old 10-12-2007, 08:36 AM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I would say it may not be safe to delete a MBR but it is safe to let another or the same boot loader overwriting it.

Reason : The MBR has the partition table embedded in the last 66 bytes (4 partitions each 16 bytes + 2 spare bytes). Unless one knows how to delete the correct portion of the MBR the accidental removal of the partition table can render the disk unusable, at least temporarily. I have not come across any standard command to delete the MBR too.

Observed practice : Every PC boot loader can restore its MBR and always keeps the partition table intact. Thus it is safe to let one MBR overwrite the other using the system's own command.

Finally the MBR, less the partition table, is replaceable. It is the interior of the partitions that is of value and should be protected and should have a back-up. The MBR is the first sector of the hard disk and is only 512 byte large. If a user keeps a copy of the partition table then the entire MBR is dispensible. The destruction of the partition table only destroys 64 bytes but the partitions' interior is not touched. Therefore the MBR can be retored and the partition table can be rebuilt without any consequence. Done this a lot of times.

---------------------------------------------------

It is common for an operating system to reject a hard disk if it cannot cope with the error in the partition table. If an operating system reads a hard disk then unofficially it implies that the integrity of the data can be guaranteed. Most OS opt for not touching it than trying to solve the problem.

Linux is superior in handling hard disks because of its rich set of Bash commands. When other systems cannot cope with a hard disk with big problem in the partition table "cfdisk" could normally still be able to read it. If all others fail then Linux's last line of defence is "fdisk" . From my experience while all others refusing to touch a dodgy disk Linux's fdisk will still handle the disk, reports the problem and most importantly can be use to delete the dodgy partitions and to bring back a healthy disk again.

If Linux's fdisk refuse to read the disk then in my experience that disk is likely to have a mechanical/hardware problem and on its last leg to a junk yard.

Try this command when everything fails
Code:
fdisk -l
If you see an output then fdisk is usable for changing the partition table.

To rescue a hard disk with an accidentally delected or partially deleted a partition table use "testdisk"

Last edited by saikee; 10-12-2007 at 08:53 AM.
 
Old 10-13-2007, 06:33 PM   #9
Vegetaman
LQ Newbie
 
Registered: Oct 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Well I ran western digital's utility and it said my disk was 100% fine. I ran windows XP SP 2 reinstall and it won't touch my disk because it says it may be damaged. I ran Darik's Boot And Nuke (DBAN) and it craps out towards the very end saying "DBAN finished with non-fatal errors" and says something about bad sectors.

I will see what I can do with Linux, now.
 
Old 10-13-2007, 07:00 PM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Let's see if it is true that Linux can reach the parts that Windows can't.

Hard disk manufacturer utilities have no interest in the filing system and conduct test mainly on the hardware. Many of their utilities software are just Dos programs.

Last edited by saikee; 10-13-2007 at 07:03 PM.
 
Old 10-13-2007, 07:35 PM   #11
Vegetaman
LQ Newbie
 
Registered: Oct 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Well Linux did detect something wrong with my partition table, and it fixed it. I went on to install Slackware 12...

But when I got done and tried to boot linux, it came up and said "uncompressing linux..."

And then after a few more seconds "crc error - system halted!".

I am about ready to try a new hard drive.
 
Old 10-13-2007, 08:24 PM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,265

Rep: Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027
Maybe run badblocks over it - preferably from fsck. See the man pages.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Safe to delete these directories; v. chkrootkit Skillz Linux - Security 3 09-04-2007 12:12 PM
Is it safe to delete the contents of /tmp? tramni1980 Slackware 19 01-15-2007 02:39 PM
Safe to delete mail file? svenger Linux - General 6 12-31-2006 12:24 PM
What is safe do delete in slack9? kleptophobiac Slackware 10 08-13-2003 09:30 PM
Is it safe to delete default nobody user? dunkyb Linux - General 2 03-16-2003 12:38 PM


All times are GMT -5. The time now is 04:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration