Just a quick techy post.
I was setting up Windows 7 on my laptop, which trashed access to the existing Linux Ubuntu installation on the machine (as any Windows install will do). By the way – if you want to install Windows 7 on a free partition to dual boot, its possible, but I had to make the free partition ‘active’ to make Windows recognise it as a ‘system’ partition … but I digress.
Anyway, I followed the instructions in this post – http://ubuntuforums.org/showthread.php?t=224351 – to restore the boot loader (Grub) and get Linux booting again, but then had to add an entry to allow me to select the new Windows installation.
Well, again I was able to use the usual way you get another non-Linux OS running within Grub, and there are loads of resources on the Internet to tell you how to do this.
For me it was an entry like this in menu.lst:
title Windows 7 rootnoverify (hd0,1) makeactive chainloader +1
But I was getting the error “Invalid or Unsupported Executable Format”. After quite a bit of searching around, with lots of varied responses to this particular error, I just couldn’t see what was wrong.
Then, after staring at the grub configuration for quite a long time, eventually I realised that the rootnoverify command had no space between the rootnoverify and the brackets – i.e. “rootnoverify(hd0,1)” … after adding a space, as shown above, all was well.
This post is just in case someone else has the same problem, and to remind them that before they start trying all the variants of grub commands and partition numbers that the Internet serves up in response to that error, do check the exact syntax of the menu.lst file first!
(Now thats enough geek for today)
I’m in the process of setting up a new PC that has Windows Vista on it. I’ll put Linux on it at some point, but for now, I wish to dual boot it with Windows 98 (don’t worry, it won’t be connected to the Internet) so that we can play some old games.
Well, this is the sort of thing that is possible with the GRUB boot-loader – even if I don’t actually have Linux installed yet.
Setup – I have 2 hard disks as follows:
- Disk 1 – NTFS partition with main Vista install
- Disk 2 – NTFS partition with data on it
Procedure (warning, this worked for me, but requires an understanding of disks and operating systems. Proceed at your own risk – this could trash everything on your PC if it doesn’t apply directly to your setup!):
- Use the Vista management console disk management snap-in to resize the NTFS partitions to give me some space. I created 160 Mb on disk 1 and 40 Gb on disk 2 (I had more space on disk 2 for the W98 installation).
- Boot into Knoppix (I used an old Knoppix 3.7 CD) and get up a root console
- Create a Windows FAT partition in the spare space on disk 2
# fdisk /dev/hdb
-> n (new partition – used default sizes)
-> t (set type – used c – Win FAT (lba))
-> w (write parition table)
- Create a Linux partition in the spare space on disk 1
# fdisk /dev/hda
-> n (new partition – used default sizes)
-> t (set type – used 83 – Linux)
-> w (write partition table)
- Format the Linux partition (# mkfs /dev/hda2)
- Mount the Linux partition so that Knoppix can read/write to it (# mount /mnt/hda2)
- Run grub-install to install grub into the mounted Linux partition and in the MBR of the main disk
# grub-install –root-directory=/mnt/hda2 /dev/hda
- Create a grub menu for the two entries now (for me, this was in /mnt/hda2/boot/grub/menu.lst). I used the following:
title Windows Vista
title Windows 98
map (hd0) (hd1)
map (hd1) (hd0)
- I needed the two map entries above as I was installed W98 on a second disk, and needed to tell GRUB to swap them over (as you can’t boot W98 off a second disk apparently). Recall, Vista is on disk 1 partition 1 (hd0,0), W98 on disk 2, partition 2 (hd1,1).
- Then I booted from a Windows 98 startup disk, used FDISK to verify that my C: drive was the unallocated 40 Gb on the second disk (and not any of my other partitions) and formatted C: as a system disk – (format /s c:)
- There was a problem though – on rebooting, I got a “GRUB error 17” indicating that it couldn’t mount the linux partition. On rebooting into Knoppix, I re-ran grub-install but then got a “stage1 not read correctly” error. On examining the partitions in fdisk, it appeared that the Linux partition had been changed to type 93 – Ameoba! No idea why. Changing the type back to Linux (83) solved the problem.
- The system now boots either into Windows Vista or Windows 98 (well, DOS – I now need to install Windows 98 – but I’ll actually be copying stuff off an old PC to do that).
Remember – mucking about with Linux boot disks, partitions and formatting is highly likely to screw up your PC. I’ve only put this here as I couldn’t find any mention of how to do this sort of thing on the Internet and it may be useful to someone attempting something similar. This is not a recipe, its just what worked for me. I can’t help you if you try anything here and it breaks something. Sorry.