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

Re: Windows multiboot (aaargh!)



On Sat, Sep 13, 2003 at 04:33:22PM +1200, cr wrote:
> On Thursday 11 September 2003 09:38, Pigeon wrote:
> 
> (preliminaries snipped)
> The Linux boot floppy is a bit more tricky.    I thought I'd better first 
> delete the existing Linux partitons on the drive using cfdisk rather than DOS 
> fdisk.   So I tried adding cfdisk to a spare Debian Woody boot floppy, but it 
> got 'kernel panic' when run.    Tried same with a RH boot floppy and it 
> worked OK (I think the hard drive had RH7.3 on it, IIRC), but got 'kernel 
> panic' when I used it after wiping the hard drive.    Obviously Deb and RH 
> boot floppies are just intended for booting the system on the hard drive.

Dunno about RH; the Debian one seems to want you to supply it with a
root filesystem from somewhere, either your existing installation or a
second floppy.

For blanking things, I use dd; to zap the whole MBR

  dd if=/dev/zero of=/dev/hdx bs=512 count=1
  
and for just the partition table  

  dd if=/dev/zero of=/dev/hdx bs=1 seek=446 count=64

> I tried Googling for how to create a boot floppy, what I found was several 
> rescue disks - Tomsrtbt, RIP and Leka - all of which downloaded quite nicely, 
> installed themselves onto floppies exactly as per instructions, and work very 
> well.   They all have fdisk (but not cfdisk).   I can recommend them to 
> anyone reading this, as a useful tool to keep handy.    But as they're so 
> compressed I can't put anything extra on them.   I suppose I could put cfdisk 
> on another floppy and run it from that after Toms/RIP/Leka are running 
> in RAM.

The man page for fdisk says it's basically "a buggy program that does
fuzzy things but happens to produce reasonable results", and
recommends using cfdisk instead.

For a boot floppy with cfdisk on it I use the resc1440.bin boot floppy
image off the Debian Slink installation CD. Unlike the Woody boot
image, it doesn't require a root filesystem supplied from another disk.

> > - Boot DOS, and partition /dev/hdc with one 500MB primary DOS
> >   partition (for your DOS boot partition), no other partitions.
> > - Boot Linux, and use cfdisk to change the partition type of that
> >   partition to something DOS doesn't recognise.
> 
> As a matter of interest, fdisk doesn't have 'DOS' or 'ext2' in its list of 
> filetypes - I assume 'FAT16' and 'Linux' are the equivalents.   

This would seem to be the case. The numeric IDs are 06 and 83.

<snip peculiar symptoms>
> Some thought is indicated.   I may save this drive for Linux use (with which 
> it works fine) and pick up another drive for my experiments.      

This is most unexpected... I grabbed a spare PC and HD from my latest
dumpster-diving expedition and experimented. The HD was only 2 gig, so
I reduced all the partition sizes by a third. Got the same result...
FDISK showing partitions swapped, and the second partition starts
"trying to recover allocation unit xxx" part way through where x >=
25000 or so.

Tried changing the procedure slightly - formatted the DOS partitions
immediately after creating them and before hiding them. This time they
all went OK, but at the end of the procedure FDISK was showing
partitions swapped, one of the volume labels had disappeared in FDISK,
and one of the previously-correctly-formatted partitions gave me
"invalid media type" at the prompt.

At this point I changed the method of hiding partitions; instead of
booting the slink floppy and using cfdisk I used Norton Utilities
under DOS, because it's a whole lot quicker than waiting for the Linux
boot floppy to load.

I zeroed the partition table and started again, rebooting not only
after each FDISK but after each FORMAT and each Norton edit. When it
came to creating the DOS and ext2 extended partitions, I created two
DOS partitions instead. Rebooted and checked what I'd got - at this
stage all was fine.

Started NU, and changed the type of the second extended partition to
Xenix (just as good as ext2 for the purpose, and easier). Rebooted...
and FDISK showed partitions swapped, previously good partitions gave
"invalid media type", etc. Changed it back, and all was well again.
Trying it with the first extended partition gave a similar result.

Conclusion: DOS can't cope with the presence of non-DOS extended
partitions. How dead and chewed.

So it seems that the options are something like:

- don't have a Linux partition on that drive at all
- don't have your second DOS partition, so there can be room for the
  ext2 partition to be a primary partition
- have two extended partitions, both DOS, and use umsdos in one of them  

It also seems I'd misremembered how the drive letters get allocated;
as you found out, the bootable primary partition is C:, the extended
DOS partition(s) come next and after them the other primary DOS
partitions.

> > To switch between booting different OSes, two methods are possible:
> >
> > - (Easy, but unsmooth) Use Norton Utilities (for DOS) to edit the
> >   partition table and set the "bootable" flag on the partition for the
> >   OS you want to boot. From within Win95/98, set the shortcut to
> >   Norton to "run in MS-DOS mode".
> > - (Not so easy, but smoother) write a program to set the appropriate
> >   "bootable" flag as you instruct and then reboot. For example, you
> >   could have it accept as a command-line parameter the OS you want to
> >   switch to, and then "reboot 95" or "reboot 98" from within DOS, or
> >   in 95/98 set a couple of shortcuts with the appropriate command-line
> >   parameter and "run in MS-DOS mode".
> 
> Or, could I just use Linux fdisk?

Yes, although you'd have to reboot twice...

In fact, you can use DOS FDISK as well... why is it that I've been
tweaking bootable flags for years and never tried using DOS FDISK
until tonight? Seems to work OK. Brain the size of a peanut strikes
again.

> (much snippage)
> 
> > It is also possible to boot Linux from within DOS/Windoze using
> > LOADLIN.EXE (again "run in MS-DOS mode") without actually rebooting.
> 
> I was thinking of trying that later, though I was unsure about how stable it 
> might be.    But quite by chance, I found that the install for the DOS zip 
> version of Tom's Root Boot does exactly that - when unzipped (in DOS), 
> running 'install.bat' immediately uses loadlin to start its own little Linux 
> system to create the floppy.    And it *all*, Linux system plus floppy 
> contents plus HTML faq, comes in a 2.2MB zip file.    Tom must be a fanatic 
> at squeezing the maximum stuff into the tiniest package.    

Linux happily wipes out all trace of the previous operating system,
and carries on as if booted straight from the MBR. When I first
installed Debian, I balked at the possibility of LILO screwing up my
time-consuming MBR hacks, and set it up to boot using LOADLIN. Then,
when I first recompiled a kernel, I cocked it up, and experienced no
trouble at all in reverting to my previous kernel just by editing the
LOADLIN batch file. What I'd read so far seemed to indicate that LILO
was a bitch to use and fraught with danger, whereas my experience of
LOADLIN was that it was a doddle to set up and to recover from
disaster. So I've never bothered to change - I just set up a 50MB DOS
partition at the start of the HD with the DOS editor, LOADLIN and a
history of kernels and kernel boot config files. Works fine.

If you have a PS/2 mouse and it doesn't work after booting out of
Windoze with LOADLIN, try "echo -ne '\377' > /dev/psaux" before
starting X. This works around a bug in X which was fixed some time
between 4.2.0 and 4.2.1.7.

-- 
Pigeon

Be kind to pigeons
Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F

Attachment: pgpn_9VEoOnlX.pgp
Description: PGP signature


Reply to: