Before upgrading, it’s useful to have the partition layout written down. Here’s Pinto’s (from parted’s “print” command):
1 32.3kB 14.0GB 14.0GB primary ntfs , , , , , , , , , type=07, ,
3 17.2GB 18.2GB 1045MB primary ext3 boot, , , , , , , , , type=83, ,
4 18.2GB 54.7GB 36.4GB extended , , , , , , , , , type=05, ,
5 18.2GB 20.4GB 2147MB logical linux-swap , , , , , , , , , type=82, ,
6 20.4GB 31.1GB 10.7GB logical ext3 , , , , , , , , , type=83, ,
7 31.1GB 41.8GB 10.7GB logical ext3 , , , , , , , , , type=83, ,
8 41.8GB 52.6GB 10.7GB logical ext3 , , , , , , , , , type=83, ,
2 54.7GB 60.0GB 5342MB primary fat32 , , , , , , , , , type=12, ,
This is what’s on each of them (in partition order):
- Windows
- ThinkPad Recovery partition
- Boot partition (/boot)
- Extended partion (contains logical partitions 5-8)
- swap
- Fedora Core 5
- Fedora Core 6
- openSUSE 10.2
Rather than leave Pinto in a non-working state, I chose to copy the openSUSE 10.2 partition (/dev/sda8
) over the old Fedora Core 5 partition (/dev/sda6
) and upgrade that.
I have only one boot partition. When the upgrade runs, it’ll replace the kernel files for the installation being upgraded. Since I want to keep my current kernel, this is bad. To remedy this, I copied all the files with the current kernel version to a backup area to be restored later:
# cd /boot
# mkdir opensuse-10.2
# cp -p grub/menu.lst opensuse-10.2/.
# cp -p *2.6.18.8* opensuse-10.2/.
Then I copied the current installation’s partition with the GParted Live CD. This is required because copying a partition while in use is a bad idea. When running from the CD the partitions aren’t in use.
But GParted wouldn’t copy the partition for me, so I used the Live CD’s terminal and my older partion copying instructions:
# dd if=/dev/hdb8 of=/dev/hda6 bs=1024k
# tune2fs -L opensuse-11.1 /dev/hda6
# resize2fs /dev/hda6
Alas, although I tried to have all three partitions the same size, they are slightly different (according to GParted, sda6=10237 MiB, sda7=10237 MiB and sda8=10245)
and resize2fs wanted e2fsck run first. e2fsck complained the filesystem size and the physical sizeh were different. So I switched gears.
The first order was to get these partitions equal. Using GParted, I resized sda8 to match sda6 and sda7 at 10237 MiB.
There are three 10GB partitions for Linux on Pinto. I’m only using openSUSE 10.2, leaving the other two, Fedora Core 5 and 6 free. So the plan was updated to put an image of sda8 on sda7 and restore it to sda6.
Using GParted, I formatted /dev/sda7
as ext3
From the command line, I mounted it:
# mkdir /mnt/sda7
# mount /dev/sda7 /mnt/sda7
I saved an image of /dev/sda8
to /mnt/sda7/sda8.img
with partimage, which is also on the GParted Live CD. This took about 12 minutes.
Then using GParted, I formatted /dev/sda6
as ext3.
Using partimage, I restored the image /mnt/sda7/sda8.img.000
to /dev/sda6
.
Next I used GParted to edit the label of the new partition copy. If you forget this step, anything referencing the old label may use the new copy, as both partitions have the same label. Then I mounted the boot partition (/dev/sda3
) and edited the grub menu /mnt/boot/grub/menu.lst
, copied the current openSUSE entry and changed the title from openSUSE 10.2 to openSUSE 11.1 and root from /dev/sda8
to LABEL=opensuse-11.1
.
To update the location of the new partion in the file system, I mounted the new opensuse-11.1 partition and edited /mnt/new/etc/fstab to change the entry for the root to point to the new partition, LABEL=opensuse-11.1
.
I rebooted and made sure both copies of openSUSE still worked. For each, I ran df /
to see that the correct file system was mounted (verified the label location as root with e2label /dev/sda6
and e2label /dev/sda8
).
Perform the upgrade.
After the upgrade, I booted openSUSE 11.1 and edited the Grub configuration to restore the 10.2 entry and copied the backed up kernel files to /boot. One more reboot checked that the old 10.2 installation still worked.