Re: Windows multiboot (aaargh!)
From: cr (cr_at_orcon.net.nz)
To: email@example.com Date: Sun, 14 Sep 2003 21:23:47 +1200
On Sunday 14 September 2003 12:39, Pigeon wrote:
> 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.
I'd say RH does exactly the same.
It'd be nice to have a self-contained floppy with just the basic componenets
needed to boot a Linux system, so there's room to add a few utilties of ones
choice. I've done that with my DOS floppy. But reading the HOWTOs, it
seems that creating a Linux boot disk is a rather more complex procedure.
I guess the workaround is to use one of the pre-made disks like tomsrtbt, and
just put my own utilities on a floppy that I can mount afterwards. At
least, unlike DOS-booted-from-a-floppy, I imagine the Linux rescue systems
don't constantly nag you to "Insert disk with COMMAND.COM in Drive A:" or
whatever the Linux equivalent would be ;)
> 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.
I had a look on my various Linux CD's, and a look at Debian.org, but I
couldn't find it. OTOH I may have missed it. I'll try putting cfdisk on
a floppy and running it from that, after booting with a rescue disk.
Umm, just tried, with Leka's system running and a DOS floppy in the drive.
mount -t msdos /dev/fd0 /floppy
mounting /dev/fd0 on /floppy failed: no such device
But it's got a /dev/fd0 there, I checked. I'm probably forgetting
something important. Ah well, fdisk it is ;)
> > > - 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.
Umm, but does this weird behaviour start at the same distance into the
physical drive, or the same distance into the second partition, or the same
> 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
Let me see - umsdos (and support for it is in my kernel, I just checked)
will allow long filenames to be used *and* DOS can still read it, is that
I was intending to use the Linux partition as temporary space for mkisofs to
put CD images for cdrecord to write to CD. It's handy to reserve a spare
space of the right size that won't get imperceptibly filled up. I suppose
the question now is whether mkisofs and cdrecord can work with umsdos.
If not, no disaster, I'll just have to find 800MB somewhere else on the
I thought DOS could only handle partitions of up to ~500MB (512? 528?). I
must be wrong, it happily formatted 600MB, at least for partition 3.
But anyway, this is the revised scheme:
1 Pri DOS 500MB Bootable DOS6.22
2 Pri DOS 600MB W95
3 Pri DOS 600MB W98
4 Extended 5 DOS 500MB
6 DOS 800MB
I'll see how it goes.
3 may get converted to FAT32 later.
> 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
Does that sound like it spells 'kludge' ? ;)
There's actually a file in the Microsoft Knowledge Base that explains how
letters are assigned... if you have multi drives and multi partitions it
gets fiendishly complicated.
> > > 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
And I've been using FDISK too, yet I spent some time googling around in the
recesses of Simtel trying to find a utility to do just that.
"Why didn't we think of that?"
"Guess our brains must be too highly trained"
(apologies to DNA)
> > (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.
Well, I've found that GRUB is extremely benign (once sorted). It took me a
while to sort booting on this thing, I suspect mainly because GRUB reads the
BIOS drive type and I had that set wrong (and IIRC Linux doesn't, so once
booted from floppy(!) it was fine). But GRUB has since happily handled two
changes of kernel without a hitch. It pops up a menu to allow me to choose
which kernel to boot.
> 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 184.108.40.206.
No, my meeces are all plain vanilla 9-pin serial
-- To UNSUBSCRIBE, email to firstname.lastname@example.org with a subject of "unsubscribe". Trouble? Contact email@example.com