Pinto Repartition

Pinto, the Thinkpad T60, has three OS partitions of 10 GB each.  Space is getting tight on there, so I’m going to repartition the disk into two 15 GB  partitions.  The partitions are as follows:

sda6: Ubuntu 10.04

sda7: old Ubuntu (partial installation)

sda8: openSUSE 10.2

I’m not using sda7 or sda8, so I’ll remove them and resize sda6 to 15 GB, then create a new sda7 partition of 15 GB.  But first, I’m going to back up the sda6 partition.

I’m going to use SystemRescueCD to back up the partition.  Download the ISO (systemrescuecd-x86-2.8.1.iso).  Check the downloaded file with MD5Sum by creating a file with the same name as the ISO but with an appended .md5sum extention.  In this file, copy the MD5sum number from the web site, followed by two spaces and the ISO file name.  Save the file, then run md5sum -c systemrescuecd-x86-2.8.1.iso.md5sum.

If the MD5sum is OK, burn the ISO to a CD with k3b (Tools->Burn Image).  If you forget to select verify CD in k3b, you can do so afterward with the mounted CD.  Run df to see which device the CD is mounted on.  Then run MD5sum on the device, for example, md5sum /dev/sr0. Compare the output to the MD5sum you saved earlier.

I booted with the default options and after loading the kernel, the screen went blank right after “>> Loading modules…” and never came back.  I tried a few different boot options in the manual, and nomodeset fixed the problem.

I started the GUI with the wizard and mounted a USB drive manually in /mnt:

  • mkdir usb
  • mount /dev/sdb

You can see where the USB drive is with System->Show Filesystems.

Next, I ran PartImage and saved sda6 to /mnt/usb/pinto-sda6-ubuntu10.img.

With the partition backed up, I started GParted and deleted sda7 and sda8. Now sda6 was in the middle of 30,710 MiB. I made sda6 15,355 MiB with 15,355 MiB left. When the resize was done, there was only 15,353 MiB left, so I resized sda6 to 13,354. I made a new ext3 partition after sda6 that was also 13,354 and labeled it ubuntu12, which what it will become. Last, I copied the file system:
dd if=/dev/sda6 of=/dev/sda7 bs=1024k
then followed the rest of the steps to make sda7 it’s own OS:

  • In GParted, select the new partition and give it its own UUID with Partition->New UUID.
  • Save the Grub configuration and current kernel files in /boot
  • Change the new partition name
  • Add an entry to grub’s menu.lst to boot the new partition
  • Update the new partition’s /etc/fstab

For the last step, Grub has changed on my system since the linked post above.  Rather than specifying root for the new entry, the disk is specified by UUID.  To get that, use blkid, in this case: blkid /dev/sda7. You can also use ls -l /dev/disk/by-uuid. Note this is not the UUID on the line that starts with uuid (that’s for /boot), but the uuid in the line that starts with kernel.