Repartitioning
Here is some guidance on getting linux to boot, after re-partitioning
your disks with partition magick.
The problem is that after pm has shuffled partitions around, it doesnt
tell the linux kernel that the absolute locations of its root partition and
swap have changed on the disk. So when you boot linux you will get a kernel
panic as it fails to find a sensible information at the place it used to
think the root partition lived at.
If we could just get linux to boot, all we would need to do is run
"lilo" for it to fix that up. The steps below allow us to do just that.
I will set this in the context of wanting to repartition the disks
to create a new vfat partition, which is a more realistic scenario.
To add a new vfat32 partition so you have something you can read/write
in both linux and windows do the following.
- Add Partition
- I used partition magick 7.0 (one good reason
not to use ext3 or reiser for the linux partitions as I dont think
PM 7.0 can handle those). I reduced my windows
root partition to 9G, and created a fat32 parition in the freed-up 1G.
Partition magick worked fine for me doing that, and win reboots fine.
However PM isnt smart enough (or brave enough) to rerun lilo, so rebooting
linux fails. So...
- Boot linux in rescue mode
- For suse, this means booting from dvd (my
usb floppy still hasnt arrived from hp), so you need to get the bios to
select the cdrom/dvd as the initial boot device (have hard-disk as the second
device). Then boot and choose "rescue"
from the suse options, and login as root.
- Find your linux root partition
- by running "fdisk /dev/hda", and then
use the "p" command to see the partitions. Find the linux root partition
(/dev/hda5 in my case), and quit from fdisk.
- Mount that parition
- eg, "mkdir /tmp" to create a directory to
mount it on, then "mount -t ext2 /dev/hda6 /tmp".
- chroot it.
- Set that partition to appear as your root filesystem with your running
rescue kernel temporarily by issuing "chroot /dev/hda6". So now you have
a running kernel using your old root directory as its root, (so all your
old system's commands, and paths relative to its root will be like in the
old days).
- Run lilo
- with the command "lilo", and that will
set our old boot kernel to know about the new absolute locations of the root
file system, swap and so forth.If you want to look at the configuration that lilo is working with,
look in /etc/lilo.conf.
- Remove the dvd and reboot
- (otherwise we'll boot from it), and restart -
ctl-alt-del.
- Watch it work
- It should now reboot into your old linux ok.
- Reset bios boot order
- Change the bios settings to put boot device order back to hard disk
first, cdrom/dvd second.
Now you can mount your new windows vfat partition. Use fdisk (as before)
to see which partition it is. Mine is /dev/hda5. Then, as root,
mkdir /windows/shared
mount -t vfat /dev/hda5 /windows/shared
cd /windows/shared
And you should be able to see, read and write files to that. Put a
corresponding entry in /etc/fstab if you want that to mount when
linux boots.