Wednesday, 24 October 2012

A disk read error occurred Press Ctrl+Alt+Del to restart

After fitting an IDE SSD in my aging laptop, I found that although Windows 7 (and Windows 8 Preview) would install to it, they wouldn’t boot – instead claiming that there was a disk error.

After some experimentation, I found that the Super Grub2 Disk, booted from a CD, could start Windows via its “Detect any other operating system” option.

But booting from a CD every time sort of defeats the point of a faster drive, so I tried to get grub to boot into Windows from the hard drive. It worked – (almost every time), and here’s how.

  1. Get an Ubuntu Live disk.
  2. Boot into Ubuntu and repartition the disk using gparted. Create one ext2 partition of 256Mb (aligned to none) and set its flags to bootable. Create a second partition for NTFS that fills the rest of the disk.
  3. From the terminal, start a su shell and mount the ext2 partition as /boot, then install grub
    • sudo –i
    • mount /dev/sda1 /boot
    • grub-install /dev/sda
  4. Install windows to the second partition, you might need the Super Grub2 disk to help it through the reboots.
  5. Boot into Ubuntu again, mount the boot partition, and find the volume info for the NTFS partition using the blkid command.
  6. Create a /boot/grub/grub.cfg that looks like this

set default=0
set timeout=0

menuentry "Windows 7" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    insmod ntldr
    set root='(hd0,msdos2)'
    search --no-floppy --fs-uuid --set=root BIGHEXNUMBERFROMBLKID
    ntldr ($root)/bootmgr