Partitions, MBR, etc.

Mark K. Kim markslist at cbreak.org
Fri Aug 9 22:42:30 PDT 2002


On Fri, 9 Aug 2002, Rick wrote:

> Q 1.  Is there a simple way to backup and
> restore the MBR, using floppy, to stave off
> potential disaster?

What do you mean by restore the MBR?  Restore to LILO or Windows
default?

To restore to Windows default, get a floppy, format it under Windows with
the "transfer system files" option.  Copy over FDISK.EXE from
"c:\windows\command" (under Win95, Win98, and WinMe; search for FDISK.EXE
on other Windows) to the floppy.  If something goes wrong, boot with the
floppy, and type "fdisk /mbr".  You'll be right back to being able to boot
Windows.

To restore to LILO, it's best to get a bootable Linux rescue CD.
You can use it to switch over to your hard drive's Linux system, then
reinstall LILO.  The process I use is something like this:

   1. Use bootable Linux CD to boot into Linux.
   2. Mount the hard drive's root Linux partition.
   3. Chroot to make the hard drive's root Linux partition into the
      effective root.
   4. Run `lilo`.

==8<--
> Q 2.  Using fdisk, if hda5 is deleted,
> hda6,7,8 are renumbered as hda5,6,7.
> If this is written back to the MBR, my guess is that
> LILO and RH v.7.3 will no longer work?

You'll need to modify /etc/lilo.conf and rerun lilo.  You'll also want to
modify /etc/fstab.

==8<--
> The number of blocks reported has changed,
> in particular for hda6.
> If this is written back to the MBR will it continue to work?

It's probably okay, but I don't recommend modifying working partitions.
Do it from a bootable Linux CD just to be safe.

> Q 4.  Can hda7 be used as swap for multiple linux distributions,
> or does each distribution need a dedicated swap partition?

I believe it's okay to share the swap partition.  Never had problems in
the past for me.  But I haven't done it in a long time so your mileage may
vary.

> Q 5.  Should I reserve a bunch of small partitions below the
> "1024 cylinder barrier" (like hda9,10), to provide a boot point
> for potential future distributions?
> How large do they need to be?

No need.  You just need one spot where you can install LILO.  Once it goes
into LILO, LILO can boot a Linux kernel anywhere on your hardware.  Just
make sure you use the lba32 option in /etc/lilo.conf, and make sure you
use the newer version of LILO that has overcome the 1024 cylinder problem.

Another way to look at this problem is, if you install LILO in MBR, then
there's no need to worry about it.  Just make sure you use the "lba32"
option in /etc/lilo.conf.

> Let me know if you foresee any other gotcha's!

Some partitions you can share between distributions.  /home is a
relatively safe one to share, and so is swap.  Others you probably
shouldn't, though, if you wanna get the full effect of each distribution.

-Mark

--
Mark K. Kim
http://www.cbreak.org/
PGP key available upon request.








More information about the talk mailing list