Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#83316 - 25/03/2002 01:09 (LINUX HELP) I broke my linux/windows boot setup
johnmcd3
enthusiast

Registered: 19/04/2001
Posts: 369
Loc: Seattle, WA (formerly Houston,...
I set up redhat 7.2 before I went on vacation to start learning linux and teach myself C in my spare time (this weekend I made it about halfway through the K&R) but I'm obviously not very competent yet. I had previously unplugged my multimedia drive to plug in the "old" 20 gb drive i use for red hat. I still use windows as my primary system so I had XP's os loader take care of the dual boot stuff by telling linux to install its boot info into a boot partition, and copying that over to my windows disk and adding a reference to that bin file I'd created in the windows loader.

But I just spent 45 mins moving drives around and installing a pci ide controller to fit my 5 drives and setting it up in windows. I screwed everything in (like an idiot) before testing linux. Obviously you can see where this is going, my bootsect.bin file points to where my drive used to be (hdb1) not where it is now (hda1). The cables don't reach where they used to. Do I have to put it back like it was to get into linux? Whether I do or not how do I change the boot sector info to point to the new place? (hda2). It's not an editable file, of course. This boot sector info was created for me in installation and I can't figure out how to do it myself. Thanks,

John
_________________________
1998 BMW ///M3 30 GB Mk2a, Tuner, and 10 GB backup

Top
#83317 - 25/03/2002 11:33 Re: (LINUX HELP) I broke my linux/windows boot setup [Re: johnmcd3]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
You don't *have* to rearrange your drives again, but it would be simpler if you did.

Aside from redirecting your bootsect.bin to point to the new location, and dealing with GRUB/LILO issues, once you got linux to boot it would complain about not being able to find any partition other than the root partition as the entries in /etc/fstab would reference the old location. All of this is correctable - fairly trivial to an experienced linux admin, but certainly not something I'd recommend for a newbie, especially as the /etc/fstab editing would have to be done with vi which is a bit arcane to the uninitiated.

First off you will need to boot into linux using a linux boot/rescue disk. (bootdisk.com has a selection if you didn't create one yourself)
Then you need to mount your your root and boot partitions somewhere, edit /etc/fstab to reflect your physical changes, edit /etc/lilo.conf to change where the root location is and where the boot sector should be put. Then you'll need to run lilo to update the boot sector on this partition. This is complicated by the fact that whilst you are doing this, you're runing in a chroot'ed environment - so you'll have to take this into account whilst working with lilo.

Finally you'll need to copy the new boot sector to the location that WinXPs boot loader expects to find it.

Ultimately, it's a great learning experience - once you're done you will be familar with the basics of unix/linux paritioning, the concept of chroot, the basics of vi and lilo, and the mount command, which is not a bad thing. But it's probably better to be able to learn most of these things at a more leisurely pace.
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#83318 - 26/03/2002 12:56 Re: (LINUX HELP) I broke my linux/windows boot setup [Re: genixia]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Lilo actually has a switch that does the chroot for you so that you don't have to bust your brain. You can just run ``<root>/sbin/lilo -r <root>'' where <root> is where you've mounted your real installation's root, including the leading `/', /mnt for a common example.
_________________________
Bitt Faulk

Top
#83319 - 26/03/2002 20:38 Re: (LINUX HELP) I broke my linux/windows boot setup [Re: wfaulk]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
Yeah, that switch was mighty useful when setting up RAID on my server. Now that lilo deals with RAID on the boot partitions it's a bit easier...but I digress.

My point was that all of that stage is is a chrooted environment, so it's going to be 'vi /mnt/etc/lilo.conf', vi /mnt/etc/fstab.conf' etc, which is easy enough once you can wrap your head around the concept of chroot, but for people coming from a DOS/Win background that's not always easy. The feeling is similar to that experienced trying to navigate around The Big Dig in Boston...
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#83320 - 26/03/2002 23:08 Re: (LINUX HELP) I broke my linux/windows boot setup [Re: genixia]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Uhhh. Methinks you misuse ``chroot''. It's sort of an inverse chroot, but the chroot system call actually goes in the other direction. That is, once you booted off of a rescue floppy that way, you could ``chroot /mnt'' and have it work almost like you booted off of that partition to begin with.
_________________________
Bitt Faulk

Top
#83321 - 26/03/2002 23:33 Re: (LINUX HELP) I broke my linux/windows boot setup [Re: wfaulk]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
Yeah, ok...maybe 'chrooted with respect to your normal root environment' would have been a better description. But you're right - we're not actually changing root at all - we're merely booting up with a different one. I rarely actually issue a chroot command - I usually do it in my head


Edited by genixia (26/03/2002 23:35)
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#83322 - 26/03/2002 23:35 Re: (LINUX HELP) I broke my linux/windows boot setup [Re: genixia]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Sorry to be all pedantic, but I don't want to get wrong ideas in the new guy's head. (I think I knew what you meant, but just wanted to be clear that your usage was ``metaphorical'', and not used denotatively. I probably should have just come right out and said so from the beginning. Sorry.)
_________________________
Bitt Faulk

Top
#83323 - 26/03/2002 23:37 Re: (LINUX HELP) I broke my linux/windows boot setup [Re: wfaulk]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
Well, someone has to keep us honest
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top