Re: MBR and Logitech USB mouse.


Subject: Re: MBR and Logitech USB mouse.
From: civileme (civileme@mandrakesoft.com)
Date: Thu Jun 13 2002 - 21:45:06 AKDT


On Thursday 13 June 2002 01:22 am, Brian ThunderEagle wrote:
> I gave up on it. I had nothing to lose so I just restarted. But it is still
> something I would like to know in the future. Had there been any important
> information on the drive I would have lost it all. So would still like to
> know if there is anyway to fix this kind of a problem.
>
>
> -----Original Message-----
> From: aklug-bounce@aklug.org [mailto:aklug-bounce@aklug.org]On Behalf Of
> bryan@ak.net
> Sent: Wednesday, June 12, 2002 5:21 PM
> To: aklug@aklug.org
> Subject: Re: MBR and Logitech USB mouse.
>
>
>
> On Fri, Jan 01, 1999 at 11:52:22PM -0900, Brian ThunderEagle
>
> <aklug@arcadia.2y.net> wrote:
> > I decided to take this
> > moment to make my computer dual-boot with RedHat 7.2 and Windows 2000.
> > So,
>
> I
>
> > have everything up and running great. Both OS's are installed and I have
>
> Grub
>
> > set up to access both. However because of the way Dynamic diks work with
> > Windows 2000, and related hard drive 'stuff' I had to use Diskprobe to
>
> modify
>
> > the type ID. I made a mistake, but luckily I had the boot sector backed
>
> up. I
>
> > was able to restore the Primary partition boot sector, but now my Linux
> > partition is missing and I can't boot, because I was using Grub. So I can
> > either re-install everything, or I was hoping there was a feature in
> > Linux
>
> that
>
> > is equivalent to "fdisk /mbr" which is how I was able to restore the
>
> Windows
>
> > partition. So if anybody knows if it is possible to restore a missing
>
> Linux
>
> > Partition please let me know, I am going to continue to try and figure it
>
> out.
>
> I don't know if this will help or not, but....
> Keep in mind that each partition on a drive has its own boot sector
> at the beginning of the partition, but these are all separate from
> the MASTER boot record (MBR) at the very beginning of the disk. It's
> this MBR that is rewritten by 'fdisk /mbr', of course. I'm not
> familiar with Grub, but LILO can go either in the MBR, or a partition's
> boot sector.
>
> Immediately after the MBR, I believe, is the partition table, which
> specifies the Cylinder, Head, and Sector at which each partition
> begins and ends. So 'fdisk /mbr' will make the disk bootable, and
> is not specific to any one partition. Once that is good, you need
> to have a partition table that specifies where things are. Aside
> from that, whether or not you need anything special in the partition
> boot sectors depends on your method of bootloading.
>
> Does that help at all? Corrections from others are welcome.

The MBR is sector first on track first, and the partition table is the last
66 bytes of it (4 16-byte pointer fields of which one to 4 may be used, and
two signature bytes). The rest points to the booter to use. The next six
sectors are undefined and viruses and anti-viral software hide there and also
one segment of date and timestamps for fake hardware IDE RAID, Be advised
that LILO STOMPS ALL OVER those six sectors.

a> fdisk /mbr

in dos recovers a windows boot without affecting your partition table. Next
it is necessary to boot into linux and rerun GRUB or LILO depending on which
one you use.

To do that, some distros make a rescue floppy which will boot the system with
its private copy of the MBR. Then it is a snap to come up in single mode with

linux 1

and immediately

/sbin/lilo

or the equivalent for GRUB.

Some distros make a rescue available off their first install CD whereby you
type F1 at the splash screen and

rescue

at the next one and you get a menu of useful things to do. (Mandrake 8.2 is
like this, and 8.1 had the primitives less fully developed)

I keep a copy of tomsrtbt handy, so I can boot a standalone console linux off
the floppy in root mode. This works for ext2 and ext3 but not for Reiserfs,
JFS or XFS / partitions. Here's how:

Assuming you come up with Tom's

# mkdir -p /mnt
# fdisk -l /dev/hda

(Now if you forgot which partition number is your root partition, you have a
list of possible ones to try (write them down)) You DO NOT want to try any
partitions that are not ext2 or ext3--you will hang unless it is some vfat
filesystem and we know linux probably isn't on vfat (though it will work
there if you are perverse enough to install it with a vfat /.)

# mount /dev/hda5 /mnt
# ls /mnt/etc

If no such directory exists, keep stepping through your list,

# umount /dev/hda5
# mount /dev/hda6 /mnt
# ls /mnt/etc

The only legal or bootable place for an /etc directory in most configurations
is /, so when you get a directory you have struck paydirt... The next
command does it (almost) all

# chroot /mnt

Congrats you are back on your disk in /

Now all that is left is the recovery work

# /sbin/lilo

# reboot (or ctrl-alt-del since I am not sure if tomsrtbt has an alias for
reboot)

Now get the floppy outta there and your disk should boot dual-boot style.

Civileme

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Thu Jun 13 2002 - 22:02:22 AKDT