Installing Mint 16 on an LVM, EFI boot setup

On newer systems UEFI boot is either the only option or it is the default option. EFI (Extensible Firmware Interface) boot is a new way of faster, and secure booting which replaces the old MBR-based boot. In order to make an EFI-enabled installation, an EFI-enabled LiveCD/LiveUSB is needed, and must be booted in EFI mode from the BIOS startup.

After booting into the Linux Mint 16 live environment, connect to the internet, open a terminal window and install the necessary packages as follows:

sudo apt-get install gdisk lvm2 gparted

If the installation drive has not been previously set up with a GPT partition table, you will need to do this using GParted. After opening GParted, select the device (which should be unallocated, if it is not, unmount all partitions in it, and remove them), and go to Device → Create Partition Table. When the dialog shows (as shown below), “msdos” will be the default. Change this to gpt, and click OK. This will create a new GUI Partition table, necessary for EFI boot to work.

After you have set the drive to work as GPT, you will no longer be able to use fdisk commands to create partitions. You will now have to use gdisk instead. We are intending to use LVM (Logical Volume Management) to set up our partitions, but it is recommended that the EFI boot partition and the swap partitions be created outside of the LVM, and preferably before the LVM partition. In order to do this, use gdisk as follows.

$sudo gdisk /dev/[device: sda, sdb, depending on your disk array]
GPT fdisk (gdisk) version 0.8.7
 
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present
 
Found valid GPT with protective MBR; using GPT.
 
Command (? for help):_

Type 'n' here to create the first partition, and press enter. It will be given the default number of 1. Leave this unchanged and press enter. Enter the first sector (2048 is default on GPTs), and press enter. Enter the last sector. You can enter a size like this: +250M. Press enter. Enter the code for the type of partition to create. We want an EFI partition, so enter code ef00.

Type 'n' here to create the second partition, and press enter. It will be given the default number of 2. Leave this unchanged and press enter. Enter the first sector (use default), and press enter. Enter the last sector. Generally use .5 times your RAM: ie +10240M. Press enter. Enter the code for the type of partition to create. We want a Linux Swap partition, so enter code 8200.

After creating the 2 separate partitions, we are ready to create our LVM partition. Type 'n' here to create the second partition, and press enter. It will be given the default number of 3. Leave this unchanged and press enter. Enter the first sector (use default), and press enter. Enter the last sector. The default will be the end of the available space. Press enter. Enter the code for the type of partition to create. We want a Linux LVM parition, so enter code 8e00.

After creating all needed partitions we need to apply the changes. Press 'w', enter, and confirm your changes. Exit gdisk by typing 'q' and enter.

In order for Mint setup to work with the EFI partition we just created, we need to format it using a fat32 filesystem. Open GParted, select the device, and the EFI partition, and format it using fat32.

The LVM volumes are managed through a totally different interface, and preparation/partitioning functions must be performed in a specific order. The sequence is as follows.

In order to create our partitions we need a logical volume, which can be prepared as follows. Considering that the LVM partition we created is number 3 in order:

sudo pvcreate /dev/sdb3
This gives the LVM an understanding of what physical volumes it has to offer for volume groups and logical volumes during your setup.

All physical volumes created will have to reside within a specific volume group. LVM is capable of spanning volume groups across multiple physical storage devices. In this particular case our group will be inside a single physical storage unit. Create the group as follows.

sudo vgcreate sysvg /dev/sdb3
In this case our new volume group 'sysvg' now lives within our logical volume /dev/sdb3.

We are now ready to create our actual data partitions to be used by the installer. In this particular case, we are creating root (/) and home (/home) partitions. The beauty of creating them in our volume group is that they can be grown or shrunk at will without disrupting the Linux filesystem. Create the volumes as follows.

sudo lvcreate -L 30G -n lvroot sysvg
Where 30G is the size given to the partition (30GB is a good starting point for / where programs and and other non-user files are installed), lvroot is the name of our phyrical volume, and sysvg is the name of our volume group.

sudo lvcreate -L 200G -n lvhome sysvg
Where 200G is the size given to the partition (it is good practice to not use the entire space of the volume group, especially when using an SSD, and expand it as needed. In this case, the total size of the group is 430GB), lvhome is the name of our phyrical volume, and sysvg is the name of our volume group.

More volumes can be created to house /tmp, /var, etc. Otherwise they will use space in /.

We can now display our newly-created volumes as follows.

$sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/sysvg/lvroot
  LV Name                lvroot
  VG Name                sysvg
  LV UUID                [your disk UUID]
  LV Write Access        read/write
  LV Creation host, time mint, 2013-12-17 14:46:09 -0600
  LV Status              available
  # open                 1
  LV Size                30.00 GiB
  Current LE             7680
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0
 
  --- Logical volume ---
  LV Path                /dev/sysvg/lvhome
  LV Name                lvhome
  VG Name                sysvg
  LV UUID                [your disk UUID]
  LV Write Access        read/write
  LV Creation host, time mint, 2013-12-17 14:52:01 -0600
  LV Status              available
  # open                 1
  LV Size                200.00 GiB
  Current LE             51200
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

After all our partitions have been created and our LVM volumes have been prepared, we can now proceed with installation. Double-click on the install icon on the desktop of the LiveCD environment. (Screens are approximate and not exact Mint 16 setup screens)

On the “Preparing to install” screen, you can select both “Download updates while installing” and “Install this third-party software” (this is optional). Click 'Forward'.

On the “Allocate drive space” screen, make sure you select 'Something else' before pressing the 'Forward' button. After you press the 'Forward' button, go to picture 1.3 for what you should see when manually setting up your partitions:

The “Allocated drive space” should look different now showing you a list of your logical volumes and the /dev/sdb partitions near the bottom. Assign the 2 /dev/sdb partitions to EFI boot and swap respectively. Then, find the logical volumes for lvroot and lvhome and assign them to / and /home. The partition /dev/sdb1 will be the /boot partition for your system. Make sure you select EFI as the type of filesystem. In the same manner, find partition /ev/sdb2 and assign it to swap.

Now lets scroll up to the top and highlight the /dev/mapper/sysvg-lvhome partition that has the “ext4” next to it. Press the “Change…”. Set it up to the ext4 filesystem, and select /home as the mountpoint. If this is a new install, make sure the volume is formatted. This will be the /home directory for my system using ext4. Again, the file system is your choice and doesn't need to be ext4. Do this same process for /dev/mapper/sysvg-root highlighting it and pressing the “Change…” button.

If you are all setup for your system to have all proper logical volumes, you press the “Install Now” button to start the installation process. This installation will ask for you additional information like your timezone, username, etc… please fill that in with what you want for your system. Once you are done, you can sit back and wait for the whole thing to comeplete. After the installation process is done, you will see:

Press 'Restart' to reboot the machine and you will then boot into your new EFI/LVM Linux installation.

  • linux/mint16_efi_lvm.txt
  • Last modified: 2017/12/13 17:34
  • (external edit)