Re: Replacing hard drive



Ray Green wrote:

In a recent thread I asked about my unstable 10.0 install and all
responses pointed to hardware. I've checked as much as I can and have now
decided to change the hard drive.

Current setup, twin drives boot using Grub.
hda Windows XP
hdb Suse 10

Is it just a case of swapping hdb and re installing from the dvd? Will it
recognise the XP installation and will it ensure that I can still boot XP,
I ask because with the current hdb unplugged the PC will not boot to XP (I
assume the original install modified hda). Or do I have to do something
grub/boot related prior to removing the old disc.

Thanks
Ray

You may be wise to rescue your XP first. I remember seeing a post not too
long ago about how to make XP do a repair from it's install disc. You boot
from it, then at some point it offers to repair the installed system.

I'm afraid I can't help more with that because I would be guessing.

As for when you come to install linux again, I will paste in a post I did
not long ago. How usefull it is depends really on how familiar you are with
Linux. But, notice the first part, where you can often use the BIOS menu to
select which OS to boot.

So, here it is (long in text, but only a few real instructions).

I don't have dual boots of my own, but because of problems with mdk on
someones machine, I always advise the following if it is possible in your
machine.

1. Install Linux on a seperate drive to your XP after disconnecting the XP
drive entirely (remembering to adjust master/slave links if necessary).
2. Go ahead with the install. There is now no risk involved, so enjoy it.
3. When you have tested it and all is well then switch off and reconnect the
XP drive (adjust master/slave links again if needed).

Most BIOS's over recent years will give a menu of bootable drives/devices,
so you can choose which to boot as the system comes up. Though I must say
that some give you very little time to decide. My Asus gave me nearly 2
seconds to choose between my normal client or the dev client.

For you Ray, assuming you have fixed the XP as I said, you might not need to
go further if your bios gives you a nice menu and time to choose. Otherwise
read on.

Alternative to the bios menu, and also a way to get rid of the risky floppy
disc as a boot device, you can have your grub on a bootable CD/DVD. Full
instructions follow, I make no claim that I came up with this myself, I
found some good notes on the internet quite a while ago, mixed them up with
some others and so I'm just copying them out of my little note book for
you. But we can be sure they is no risk to either of your OS's because
everything we do now will be actions outside of them, though Linux is
booted and is the one we work inside of for this.

The key words you are looking for if you need to search further are
'eltorito and grub'.

What happens is you make an iso of the stage2_eltorito data file in pretty
much the same way you would for other bootable cd/dvd's you want to burn.

#build our iso in an empty directory
mkdir myiso
#in your case create grub's directory using the same path as on
#the distro. In suse9.3 this is,
mkdir -p myiso/boot/grub
#copy your eltorito
cp /usr/lib/grub/stage2_eltorito myiso/boot/grub

For different versions than suse9.3 do a search to make sure of the location
of the eltorito file,
find /usr -iname *eltorito -print

Also, as with a distro iso, be carefull of using the correct one for your
architecture. If you are on a clean install they will only be one unless
you have deliberately included a second.

Now create/edit,
vi myiso/boot/grub/menu.lst
(lst = lowercase LST)

Grub's menu.lst seems complex at first, actually it seems complex later on
too, but really a lot of what goes on can either be copied off your working
grub or worked out. You also get much more control over the menu itself
than the bios tends to give.

Each section consists of a tittle followed by information grub can use to
boot or chainboot that option. Not all information options are needed for
all bootable systems.

A good starting point is your very own menu.lst

cp /boot/grub/menu.lst myiso/boot/grub/menu.lst
(or rather, the one off your floppy)

I'm going to point you to a page of examples at the end of this post.

If you want some tools on your iso then now is the time to collect them
together.
mkdir myiso/utils
Then copy them into utils, mine consist almost entirely of scripts that I
have found usefull over the years. Remember, our CD/DVD does not have an OS
onboard, we are not at this time creating any sort of rescue disc, though I
am sure many of you can see how that might be done. But this one is only a
means of selecting which OS or device to boot. So for Linux/XP dual
boot you might want to have handy utils for both systems.

This whole image creating is easily scriptable, have a location where you
collect the things you want in your bootable iso, then a single script
command can create the iso and burn it.

Now we make our image file.
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4
-boot-info-table -o grubForCD.iso myiso

(make that command one on line).

That creates a file called grubForCD.iso which you should burn. Remember to
tell your burner that you are burning an iso or it will attempt to burn it
as a file.

For those doing other bootables, mkisofs has set the starting point
/boot/grub/stage2_eltorito, so no further work on the mbr is needed. If you
had setup a linux image to mount, then you would still set this as the
starting point, but put the image information as one of the options in
menu.lst (chain boot). Alternatively use your native stage2 file, but
remember you will almost certainly need to adjust the map file because of
the volume change and will definately need to keep your CD up to date with
kernel changes on your system.

menu.lst examples and extra options available.
http://www.gnu.org/software/grub/manual/html_node/Configuration.html#...

If you aren't able to do it this way in your situation then at least I might
have given you a pointer to how to more safely install on the same drive as
your XP. i.e. don't let the install put the mbr onto the harddrive at all,
but onto a floppy because you want that menu.lst file. Then later you can
burn it to a cd.


.



Relevant Pages