Re-organising amber

Following the upgrade of amber's Windows 7 installation to Windows 10, I figured I would also clean up the disk allocation, as I had done for crimson.

This involved the purchase of another SSD so that I could dedicate it to Debian jessie. Before adding the new SSD to the system, the disks were laid out as shown below:

Windows Disk # Windows Drive Linux Grub Size Comment
0 D: sda 232GB Windows 7, Debian squeeze, Windows user files
1 E: sdd 230GB User files backup
2 N/A: sdc 931GB MD array (/rep)
3 C: sdb 232GB Samsung SSD wth Windows 10, Debian jessie
4 N/A sde 931GB MD array (/rep)

Once the new SSD was installed, I partitioned it using gparted, using the cool and trendy GPT layout. I then used a small script (see below) to copy the jessie partitions from sdb to the partitions on the new SSD. To ensure the jessie filesystems were quiet, I did this from the old squeeze instance.

I then booted the old jessie and ran grub so that a boot entry was created for the new jessie on the SSD. On reboot, I was in the new jessie. I then reran grub on the new version and installed grub on the new SSD disk. I rebooted once again, entering the BIOS to make the new SSD the boot device. It would not boot. It appeared my BIOS was too old to boot from GPT. I therefore had to redo the whole process, this time paritioning the new SSD with an MBR scheme.

Lastly, I used gparted to give all the space on the old SSD to Windows 10 and moved the user's files from the D: drive to it. That meant I could delete everything on D:.

After adding the new SSD disk, the disk layout is as follows:

Windows Disk # Windows Drive Linux Grub Size Comment
0 N/A sda hd0 232GB SanDisk SSD - Debian jessie
1 D: sdb hd1 232GB Tank for Window 10
2 E: sde hd4 230GB Documents backup
3 C: sdc hd2 232GB Samsung SSD wth Windows 10
4 N/A sdd hd3 931GB MD array (/rep)
5 N/A sdf hd5 931GB MD array (/rep)

Here's the list of disks as recognised by Linux.

   (hd0)   /dev/disk/by-id/ata-SanDisk_SDSSDA240G_153948406642
   (hd1)   /dev/disk/by-id/ata-WDC_WD2500JS-00MHB0_WD-WCANK2888079
   (hd2)   /dev/disk/by-id/ata-Samsung_SSD_840_Series_S14GNEBCB54802V
   (hd3)   /dev/disk/by-id/ata-WDC_WD10EADS-00P8B0_WD-WMAVU0973302
   (hd4)   /dev/disk/by-id/ata-WDC_WD2500JS-00MHB0_WD-WCANK3041226
   (hd5)   /dev/disk/by-id/ata-WDC_WD10EADS-00M2B0_WD-WMAV50496471
 

And here's the partition copy script:

  SDRIVE=/dev/sdc
  TDRIVE=/dev/sda
  PARTS="7=3 1=5 3=6 4=7 5=8 6=9"

  for part in ${PARTS}; do
      TARGET=${part%=*}
      SOURCE=${part#*=}
      mount -t ext4 -r ${SDRIVE}${SOURCE} /mnt/source
      if [ $? -ne 0 ]; then
          echo "failed to mount ${SDRIVE}${SOURCE}"
          exit 1
      fi
      mount -t ext4 ${TDRIVE}${TARGET} /mnt/target
      if [ $? -ne 0 ]; then
          echo "failed to mount ${TDRIVE}${TARGET}"
          exit 1
      fi
      echo "cloning ${SDRIVE}${SOURCE} to ${TDRIVE}${TARGET} ..."
      (cd /mnt/source && find . -print0|cpio -pd0mau --block-size=64 /mnt/target)
      umount /mnt/source
      umount /mnt/target
  done