12

I've got a brand new laptop with a 128GB SSD drive. I read that aligning the partitions to match the Erase Block Size of the SSD is important. I followed William Scott's guide SSD Tweaks in Linux and Aligning Partitions and my partitions ended up being:

$ sudo fdisk -lu /dev/sda

Disk /dev/sda: 128.0 GB, 128035676100 bytes
32 heads, 32 sectors/track, 244208 cylinders, total 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00037bd2

   Device Boot       Start        End     Blocks   Id  System
/dev/sda1   *         1024     206847     102912   83  Linux
/dev/sda2           206848   16985087    8389120   82  Linux swap / Solaris
/dev/sda3         16985088  250068991  116541952   83  Linux

Then I installed Ubuntu Natty and specified the partitions manually so that /dev/sda1 became the /boot partition formatted with ext2, /dev/sda2 the swap and /dev/sda3 the / formatted with ext4. After the installation the thing didn't boot, and I ended up in the grub-rescue console which doesn't make any sense to me. It's giving me:

error: invalid arch independent ELF magic.
grub rescue>

Have I done some mistakes during my installation? How do I solve the issue with grub-recovery?

3

2 Answers 2

10

Boot into Live CD and run:

sudo mount /dev/sda3 /mnt
sudo mount /dev/sda1 /mnt/boot
sudo grub-install --root-directory=/mnt /dev/sda
2
  • 3
    For EFI machines, you'll need to install grub-efi while booted in the live-CD, otherwise you'll get some puzzling errors.
    – user1614
    Jul 19, 2011 at 4:04
  • 1
    Just want to point out that --boot-directory (b instead of r) as written elsewhere does not work. Just got kicked into a different looking grub shell.
    – l0b0
    Jun 22, 2012 at 9:52
2

I have fixed the same problem with Backtrack , on VMware. The boot was broken after installing vmware tools

I used the following commands to fix it:

sudo mount /dev/sda1 /mnt
sudo grub-install --root-directory=/mnt /dev/sda

Not the answer you're looking for? Browse other questions tagged .