Grub refuses to install

I’ve had to reinstall PM4 on to my PC for reasons I won’t go into, I’m installing alongside widows 7 but the install runs fine untill the last hurdle when it stops with this error message

Executing 'grub-install /dev/sda' failed.

This is a fatal error.

I’ve tried it with the latest cd and a live usb (pre respin) and I get the same results each time

any help would be appreciated before i lose the will to live

Many thanks

Graeme

Boot to a LiveCD/Live USB and post the output from:

sudo fdisk -l

and

sudo blkid
peppermint@peppermint ~ $ sudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1   312581807   156290903+  ee  GPT

Disk /dev/sdb: 360.1 GB, 360080695296 bytes
255 heads, 63 sectors/track, 43777 cylinders, total 703282608 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: 0x00000001

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048   358106348   179052150+   7  HPFS/NTFS/exFAT
/dev/sdb2       358107134   703281151   172587009    5  Extended
/dev/sdb5       358107136   699107327   170500096   83  Linux
/dev/sdb6       699109376   703281151     2085888   82  Linux swap / Solaris

Disk /dev/sdg: 4105 MB, 4105175040 bytes
37 heads, 37 sectors/track, 5856 cylinders, total 8017920 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: 0x04030201

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1   *        2760     8017919     4007580    c  W95 FAT32 (LBA)
peppermint@peppermint ~ $ 
peppermint@peppermint ~ $ sudo blkid
/dev/loop0: TYPE="squashfs" 
/dev/loop1: UUID="aa772a23-0df4-4e99-9190-35e6dfd8125f" TYPE="ext2" 
/dev/sda1: LABEL="graeme" UUID="0e50e84c-db4f-4111-9148-f65803f9c22e" TYPE="ext4" 
/dev/sda2: LABEL="pat" UUID="6f61be83-fcf0-4ecc-8a90-73cacaa0d1da" TYPE="ext4" 
/dev/sdb1: LABEL="Windows 7" UUID="02CAA59322478EE4" TYPE="ntfs" 
/dev/sdb5: UUID="9539e4f8-3e71-437c-9f11-53bd04b04f41" TYPE="ext4" LABEL="Peppermint" 
/dev/sdb6: UUID="0d4a0690-ca59-46e5-baf8-4a7cbf27732a" TYPE="swap" 
/dev/sdg1: LABEL="HP PENDRIVE" UUID="3433-3231" TYPE="vfat" 
peppermint@peppermint ~ $ 

Damn GPT … What’s the output from:

sudo parted -l /dev/sda
peppermint@peppermint ~ $ sudo parted -l /dev/sda
Model: ATA ST3160212ACE (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  78.8GB  78.8GB  ext4
 2      78.8GB  160GB   81.2GB  ext4


Model: ATA ST3360320AS (scsi)
Disk /dev/sdb: 360GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  183GB  183GB   primary   ntfs            boot
 2      183GB   360GB  177GB   extended
 5      183GB   358GB  175GB   logical   ext4
 6      358GB   360GB  2136MB  logical   linux-swap(v1)


Model: HP c485b (scsi)
Disk /dev/sdg: 4105MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1413kB  4105MB  4104MB  primary  fat32        boot, lba


peppermint@peppermint ~ $ sudo parted -l /dev/sda

if it’s any help I can remove /dev/sda, that drive is surplus to requirements at the moment

Graeme

Actually I’ve just noticed on the original error message

Executing 'grub-install /dev/sda' failed.

This is a fatal error

I’m not installing to /dev/sda I’m installing to /dev/sdb, could it trying to install grub to the wrong drive ?

Any particular reason why the 160gb disk is GPT and in the first slot?
Would your Win7 function if you swap sda (160gb HDD) with sdb (360gb HDD)?

[EDIT]
Just seen your post.

I'm not installing to /dev/sda I'm installing to /dev/sdb, could it trying to install grub to the wrong drive ?

Considering that the boot flag is set on your sdb, then that would be the logical place to put grub too.

Any particular reason why the 160gb disk is GPT and in the first slot?

That drive doesnt have to be there, originally I was gonna install Windows 7 to that drive and Peppermint to the other drive but I changed my mind and decided to install both operating systems to the same drive (/dev/sdb) but I never removed the 160gb drive (/dev/sda)

Would your Win7 function if you swap sda (160gb HDD) with sdb (360gb HDD)?

If I understand your question right no it wouldn’t because it’s installed on a partition on the 360gb HDD, I’m trying to install Peppermint alongside it

If you were setting the BIOS to boot from sdb first, then it should work by swapping the drives and changing the BIOS boot order.

Physically remove the GPT drive for now … We’ll add that drive back later.

Reboot to the LiveCD amnd post the output from:

sudo fdisk -l

peppermint@peppermint ~ $ sudo fdisk -l

Disk /dev/sda: 360.1 GB, 360080695296 bytes
255 heads, 63 sectors/track, 43777 cylinders, total 703282608 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: 0x00000001

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 358106348 179052150+ 7 HPFS/NTFS/exFAT
/dev/sda2 358107134 703281151 172587009 5 Extended
/dev/sda5 358107136 699107327 170500096 83 Linux
/dev/sda6 699109376 703281151 2085888 82 Linux swap / Solaris

Disk /dev/sdb: 4105 MB, 4105175040 bytes
37 heads, 37 sectors/track, 5856 cylinders, total 8017920 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: 0x04030201

Device Boot Start End Blocks Id System
/dev/sdb1 * 2760 8017919 4007580 c W95 FAT32 (LBA)
peppermint@peppermint ~ $

Run:

sudo mount /dev/sda5 /mnt

then

sudo grub-install --boot-directory=/mnt/boot /dev/sda

then reboot

Did grub install and work ?

peppermint@peppermint ~ $ sudo mount /dev/sda5 /mnt
peppermint@peppermint ~ $ sudo grub-install --boot-directory=/mnt/boot /dev/sda
Installation finished. No error reported.
peppermint@peppermint ~ $ 

Rebooting now

Damn I hate it when it takes someone ages to reply after rebooting :o

Damn I hate it when it takes someone ages to reply after rebooting

Sorry

The reboot failed with a Grub message which I didn’t write down but I was presented with a prompt GRUB> I didn’t know what to do so I rebooted with the live USB and Chromium wouldn’t open up so I took in upon myself to delete the Peppermint partition resize the Windows partition back to original then re-install Peppermint again and that worked fine so I’m now in the installed version, I also checked Windows booted which it did after a repair procedure, so all’s working at last.

So I assume the extra drive was causing the problem ?

Graeme

Yeah, GRUB always tries to install stage 1 to the MBR of /dev/sda … and it couldn’t.

We could have reinstalled GRUB via a chroot environment … but what the hell, it’s working which is what counts :slight_smile:

We could have reinstalled GRUB via a chroot environment .. but what the hell, it's working which is what counts

Well it was my own fault I should have removed the drive before I started installation, I’ve made a few bloopers over the past couple of weeks and this was only one of them,

Sorry if was impetuous but I had a strong feeling it would install ok once that drive was removed so I just thought I’d go for it

hope you’re ok with that

many thanks for your help once again

Graeme

So, did you move the 360gb HDD to the first slot?
If not then when you plug an other HHD into that slot it will bugger up your setup (again).

[quote]So, did you move the 360gb HDD to the first slot?
If not then when you plug an other HHD into that slot it will bugger up your setup (again).[/quote

No I left it where it was because the 360gb is on SATA and the 160gb drive was IDE so I couldn’t switch them