LVM – failed to install bootloader

boot-loaderlvm

I have Mint 16 installed on an LVM system. I originally had 3 logical volumes: lvswap, lvrootone, and lvstorage, with Mint 16 installed on lvrootone. I was hoping to use this scheme to upgrade and try new distros by adding logical volumes, but hadn't done so until now, when I tried to install Mint17.

While running under Mint 16 I created another logical volume, lvroottwo. I ran the Mint17 installer, choosing 'something else' and asked that Mint17's root file system be installed on lvroottwo. The installation proceeded but ended with (something like): 'failed to install bootloader'. I was given the option of trying to have bootloader installed onto sda, which I chose, but that failed too.

I gave up, exited the installer and rebooted. It booted to the old Mint 16 as usual. I can mount lvroottwo and see the Mint17 installation there. What can I do to be able to boot to Mint17 or, preferably, to have a choice? What is the 'proper' way to use LVM in order to try new installations? As you can tell I haven't had any prior experience with the bootloader or anything concerning the boot process.

Thanks for any help.


Pavel (his answer and comments are below) asks for details on how I tried to get it working. I didn't try anything. I don't know anything about boot or boot tools and did not know what to try. My question is: what should I try?

Pavel also requested description of disk layout. Output from fdisk -l is below.
(Please note that sdb is not being used. I added it to the volume group as a physical volume and tried to use it as a raid1 type mirror to one of the logical volumes on sda. But then the system would not boot. So using a live CD I removed the mirror and system booted again. I think that for this current question my experience with sdb could be ignored, but I need to learn about the boot process so I mention it here.)

output from fdisk -l:

Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 
60801 cylinders, total 976773168 sectors Units =
sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512
bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000d8478

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   976773119   488385536   83  Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63
sectors/track, 60801 cylinders, total 976773168 sectors Units =
sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512
bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vgpender-lvswap: 8589 MB, 8589934592 bytes 255 heads,
63 sectors/track, 1044 cylinders, total 16777216 sectors Units =
sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512
bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vgpender-lvrootone: 26.8 GB, 26843545600 bytes 255
heads, 63 sectors/track, 3263 cylinders, total 52428800 sectors Units
= sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes 
/ 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vgpender-lvstorage: 375.8 GB, 375809638400 bytes 255
heads, 63 sectors/track, 45689 cylinders, total 734003200 sectors
Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical):
512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096
bytes Disk identifier: 0x00000000

Disk /dev/mapper/vgpender-lvroottwo: 26.8 GB, 26843545600 bytes 255
heads, 63 sectors/track, 3263 cylinders, total 52428800 sectors Units
= sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes 
/ 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Best Answer

You should always have a simple partitioning scheme that leaves space for the boot loader, good old DOS MBR works the best for this purpose plus guards the disk from being treated as unformatted when attached to windows machine. Even the fancy new GPT format uses MBR as the basis.

The GRUB2 bootloader is capable of booting from stuff like RAID and LVM and combination of those. But it needs a place to install itself, which typically consists of a code block in MBR and more code in the gap between MBR and the first partition. Current versions of fdisk and similar tools already create a large enough gap (the first partition typically starts on a megabyte boundary).

If you're using just one disk, you can format it using the DOS disklable (o command in fdisk) and create one partition spanning the disk space (n command in fdisk, p for primary, confirm the default start and end). Then format the partition as LVM physical volume, and the rest you know already.

When multiple disks are used, the partition is typically formatted for RAID instead of LVM, a raid array is assembled and formatted as LVM physical volume and the rest is the same again.

Related Question