[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "Recovery disk" question



In message <3uo1G-3wb-11@gated-at.bofh.it>, Jack Nguy <jack.nguy@gmail.com> writes
On Thu, 03 Feb 2005 19:50:50 -0800, Rich Rudnick <nickrud@verizon.net> wrote:
On Thu, 2005-02-03 at 20:09 -0500, Curt Howland wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
>
> Ok, I intend to use Knoppix as a recovery disk. I know it has tools
> like fsck and such, but I have a procedural question:
>
> How do I run "lilo" (if I need to, Cromm forbid) so that the MBR and
> boot files on the hard drive are effected, not the CD?
>
> I've never tried to boot from one disk and run "lilo" on the other, I
> don't know how to change the perspective of "lilo" to know to look
> at /dev/hda1 instead of whatever disk it booted from.
>

My Seven Steps to Lilo Heaven

(Assuming sarge or later for nano)

1. Boot up knoppix (or any recovery disk) and open a shell.

2. Create a mount point ( `mkdir /repair` )

3. Mount your root partition ( `mount -text3 /dev/hdd2 /repair` for me )

   * If /boot and/or /etc are separate partitions, mount them also
              ( /repair/[ boot|etc ] )

4. Switch to the hard disk installation ( `chroot /repair` )

5. Check for the correct boot files ( `ls /boot` )

6. Check the lilo configuration ( `nano /etc/lilo.conf` )

7. Write the MBR ( `lilo` )


after you rescue root=/dev/hda[xx], I think you can usually run lilo
and have it write to the harddrives MBR. Seems easier that the other
stuff.

But that has to be done from the working system. The OP asked how to do it from another Linux running on the machine. Lilo can do the chroot itself (one less man lookup, unless you use chroot often).

From 'man lilo':

     -r root-directory
              Before doing anything else,  do  a  chroot  to  the
              indicated  directory.  Used  for  repairing a setup
              from a boot floppy.

Carry out steps 1, 2 and 3 and issue the command (using the example given):

lilo -r /dev/hdd2/repair

If there is any question of the integrity of the existing boot files or lilo.conf, Rich's method is slightly easier, but usually you know they're OK and just need to repair the MBR.
--
Joe



Reply to: