You are not logged in.

#1 2010-10-08 10:52:53

vikrang
Member
Registered: 2010-10-07
Posts: 67

Test Disk - Repairs Partition ,MBR?

I had a tri boot of Win 7 /XP and Mint...I was using EasyBCD 2.0 as a boot manager...I booted Mint by configuring the NeoGrub option in Easy BCD..I wanted to uninstall Win 7 and so what I did was the following

1. Edited BCD bootloader settings ...Marked XP as my default and deleted Win 7 entry...
2. Logged out and wiped my Win 7 partition

With my fingers crossed , i rebooted but Easy BCD booted flawlessly with 2 choices XP and Mint(GRUB)...As Easy BCD is not meant for XP, I thought of restoring original NTLDR of XP so that things would be in place and thinking that this cud avoid problems of detection by other Linux OS

I deleted manually the Easy BCD menu.lst file and NeoGrub.mbr in my root...That was it , after I rebooted,

I got boot screen of EasyBCD but whichever option I select , I got an error message that address not Valid-NTLDR not found or something like that

I booted my XP live CD and like many times before ran

1.Fixmbr
2.Fixboot
3.bootcfg /rebuild

After that , now when I reboot , I am getting "Invalid Partition Table"

On booting from a linux CD , I can see the files are in place..I have to get boot sector and partition table fixed...Any ideas- perhaps I should use test disk? But the manual talks about recovering LOST partitions..I want to repair existing one...

Offline

#2 2010-10-08 14:08:02

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: Test Disk - Repairs Partition ,MBR?

If you burn a CD copy of the Ultimate Boot CD it includes "Parted Magic" which in turn includes "testdisk" with which you might be able to recover your partition table. http://www.ultimatebootcd.comhttp://www.cgsecurity.org/wiki/TestDisk


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#3 2010-10-11 03:41:03

vikrang
Member
Registered: 2010-10-07
Posts: 67

Re: Test Disk - Repairs Partition ,MBR?

Thanks... I booted off a Sidux Live CD and it had trest disk..Somehow, it got screwed up..I had to re format sad

Offline

#4 2010-10-11 04:42:40

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Test Disk - Repairs Partition ,MBR?

I never trust windows tools. Bottom line is you should never mix a windows tool with a linux tool. They will mess with each other.
I didn't read too carefully, but why use the bootmgr/BCD in the first place? I mean, grub is a lot simpler and it can boot windows XP and 7.

On booting from a linux CD , I can see the files are in place...

Yeah, that is always the case. Linux sees everything and Windows fails like shit. tongue
Anyway, I think all you needed to do is install GRUB to MBR, configure menu.lst, and possibly... run bootsect.exe (or something) for windows (although very unlikely you have to do this, whoever knows whatever the heck windows has been doing?)

Last edited by lolilolicon (2010-10-11 04:46:18)


This silver ladybug at line 28...

Offline

#5 2010-10-12 07:48:44

vikrang
Member
Registered: 2010-10-07
Posts: 67

Re: Test Disk - Repairs Partition ,MBR?

Thanks...Actually I am forced (by everyone in the family!) that I dont tamper any of the Windows Stuff...So I am compelled not to touch / disturb Windows in any way and do my experiments somewhere else..So I thought the best option would be to use a tool like Easy BCD which gives a facility of Adding a Linux at boot....Also I have this very basic doubt ...Suppose I install a distro on top of a WIN installation .I choose to install GRUB in MBR...The GRUB chainloads WIN on boot ..So far so good...

But suppose I want to delete the distro which installed GRUB ...On deletion of partition , GRUB also goes off and system is unbootable...Then I may have to resort to Fix MBR and other Win tools to restore my NTLDR....So I am hesitant to install GRUB or other Linux loaders...Should I install GRUB4DOS....Should I create an entry for Windows...Will it load Windows 7....There are so many risks and I dont want to take a chance!

Offline

#6 2010-10-12 07:53:54

vikrang
Member
Registered: 2010-10-07
Posts: 67

Re: Test Disk - Repairs Partition ,MBR?

Thanks...Actually I am forced (by everyone in the family!) that I dont tamper any of the Windows Stuff...So I am compelled not to touch / disturb Windows in any way and do my experiments somewhere else..So I thought the best option would be to use a tool like Easy BCD which gives a facility of Adding a Linux at boot....Also I have this very basic doubt ...Suppose I install a distro on top of a WIN installation .I choose to install GRUB in MBR...The GRUB chainloads WIN on boot ..So far so good...

But suppose I want to delete the distro which installed GRUB ...On deletion of partition , GRUB also goes off and system is unbootable...Then I may have to resort to Fix MBR and other Win tools to restore my NTLDR....So I am hesitant to install GRUB or other Linux loaders...Should I install GRUB4DOS....Should I create an entry for Windows...Will it load Windows 7....There are so many risks and I dont want to take a chance!

Offline

#7 2010-10-12 09:31:15

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Test Disk - Repairs Partition ,MBR?

vikrang wrote:

Thanks...Actually I am forced (by everyone in the family!) that I dont tamper any of the Windows Stuff...So I am compelled not to touch / disturb Windows in any way and do my experiments somewhere else..

This exactly why you should NOT have messed with BCD, IMO. Say, if you just install GRUB to the MBR so you can load Linux as well as Windows, all you have "tampered" of Windows, is the MBR. Everything on that Windows partition is left intact, which is good. This means anytime you have to restore the computer to its "pre-linux-experiments era", all you need to do is bootup from a Linux LiveCD, use gparted to give the space back to Windows, then restore the MBR to its "pre-linux-experiments era" status, which can be done in many ways, e.g.:

1. Use some windows tool (fixmbr? bootrec?) just to fix the MBR to make Windows happy.
2. Or, before you install linux, back up your MBR:
   

dd if=/dev/sda of=mbr.bin bs=512 count=1

    Time to restore? Issue this:
   

dd if=mbr.bin of=/dev/sda bs=512 count=1

    Note that you must make sure the partitions layout are restored identical to when you back up the MBR.
    I haven't tried such an approach, so there might be some blind spot I'm not aware of. And it's probably "dangerous"/"bad practice" some'd say.

The reason why I insist on using GRUB (and other linux tools) while you have Linux on your harddirve, is that it's much simpler and you will very unlikely mysteriously mess up your partition table or anything like that. GRUB handles Windows elegantly by "chainload" so Windows will not complain anything is different. On the other hand, if you let any Windows tool to handel your Linux partition, they probably will suck, saying "something is wrong, i don't know what, but something is wrong!! do you want me to fix this?". Say yes and then get your ass messed up. The only time you can be sure enough to let Windows tools do the job, is when you don't have Linux on your harddirve anymore.

On the other hand, I'm biased. If one is really familiar with Windows tools, he can just do his magic no matter what.

Last edited by lolilolicon (2010-10-12 09:32:47)


This silver ladybug at line 28...

Offline

#8 2010-10-12 10:56:37

vikrang
Member
Registered: 2010-10-07
Posts: 67

Re: Test Disk - Repairs Partition ,MBR?

Thanks for your time lolilolicon...That is a great tip that I will remember....

Offline

#9 2010-10-12 11:01:24

vikrang
Member
Registered: 2010-10-07
Posts: 67

Re: Test Disk - Repairs Partition ,MBR?

Thanks for your time lolilolicon...That is a great tip that I will remember....

Offline

#10 2010-10-12 11:02:40

vikrang
Member
Registered: 2010-10-07
Posts: 67

Re: Test Disk - Repairs Partition ,MBR?

All my posts getting populated 2 times...I pressed submit only once!!!

Offline

#11 2010-10-12 11:03:28

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Test Disk - Repairs Partition ,MBR?

lol... Check your X config?
Edit: Now, that's a paradox...

Last edited by lolilolicon (2010-10-12 11:04:53)


This silver ladybug at line 28...

Offline

#12 2010-10-13 14:08:54

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Test Disk - Repairs Partition ,MBR?

May I just add/clearify lolilolicon's post - because what he is saying is very, very good advice.
My little addition would be that you make absolutely sure that you are using "legacy grub" and not grub2!!
legacy grub can stand on its own two feet (personally, I make a small - 30 megs or so - partiton that I call a grub-partition). This partition will do all the neccessary booting for you - irrespective of whether or not there are any linux present. grub2 is so tightly knit to the linux distro it comes from, that it is not capable of being on its own.

A typical multi-boot scenario goes something like this, where initially you have:

/dev/sda1: windows recover
/dev/sda2: windows proper

In order to add on one or more linux distros, you first have to shrink partition #2, so there is room for your linux - this can be done in many ways (google for it!).
Then - after adding the neccessary partitions, it will/may look like this:

/dev/sda1: windows recover
/dev/sda2: windows proper
/dev/sda3: small 'grub' partition
/dev/sda4: extended
/dev/sda5: swap
/dev/sda6: linux os (I would suggest 20 gigs)
/dev/sda7: linux /home, work, common, whatever

Now, if you have a live cd (my preference is grml-2009.05 because it uses legacy grub, too many these days use grub2), then you install grub the following way:

mkfs -t ext2 /dev/sda3  # make filesystem on the 'grub' partition - no point using any journalled filesystem
mount /dev/sda3 /mnt
mkdir /mnt/grub
cp /usr/lib/grub/i386-pc/* /mnt/grub  # grml uses /usr/lib, others may use /usr/share - ymmv
grub
>root (hd0,2)
>setup (hd0)    # ie install it on the MBR
>quit
vi /mnt/grub/menu.lst

Your menu.lst should now look like this:

timeout 10
default 0   # if you want windows as default - otherwise "default 1"
title windows
  rootnoverify (hd0,1)
  chainloader +1
title archlinux
  root (hd0,5)
  kernel /boot/vmlinuz ro root=/dev/sda6
  initrd /boot/kernel26

Now - if you want to do away with your whole linux sheebang - delete partitions 5,6 and 7 and make a new partition #5 and make it type 7 (ntfs) so windows can use it as drive D:. Then remove the archlinux entry from menu.lst and set timeout to '1' - ie almost instantaneously boot into windows.
Note that if you do it this way, you DO NOT have to install grub/grub2 with archlinux, but if you do, you should install it in the first sector of partition #6 (since you allready have a grub that is able to boot anything in its way - and it is completely self-contained!!)

To _my_ simple mind, grub2 is a gigantic step backwards because
1) It is trying to be all-encompassing
2) it cannot stand on its own - it will need the distro it came from
3) if you have more than one linux distro and they both use grub2, they will fiercely compete about who will be in control!
Someone has described grub2 as "an operating system in need of a boot-loader" *lol*

Offline

Board footer

Powered by FluxBB