These are just the steps I took to install Linux Mint 8 on LVM2 volumes.
IMPORTANT: This isn't for beginners, this is for people who know what LVM is and why they want to use it.
In this example, I:
- -Used an unpartitioned hard disk, /dev/sda
-Created a physical volume, /dev/sda1
-Created a volume group called 'mintvg'
-Created 3 logical volumes: swap, root, and home
-Used ext4 as my filesystem
Please backup your data before proceeding.
If you aren't confident, you may want to try this in a virtual machine first.
The Steps:
- 1. Boot from the Linux Mint Live CD
2. Open a Terminal or Synaptic Package Manager and install LVM2:(If you already have your logical volumes set up, you can skip ahead to step 7)Code: Select all
sudo apt-get update sudo apt-get install lvm2
3. Use fdisk to create a Linux LVM partiton (Type 8e):*note: if you are using Grub Legacy (Linux Mint 7 and earlier), you will need to create a regular partition for /boot. This isn't needed for Grub2 or LILO.Code: Select all
sudo fdisk /dev/sda n # Create a new partition p # Make it primary 1 # Partition number # Start (blank means default) # End t # Change partition type 1 # Partition to change 8e # 8e = Linux LVM w # Write partition table to disk and exit
4. Initialize your LVM partition (physical volume):5. Create a volume group:Code: Select all
sudo pvcreate /dev/sda1
6. Create your logical volumes:Code: Select all
# Create a volume group called 'mintvg' sudo vgcreate mintvg /dev/sda1
-If you want your logical volume to use the remaining free space, you can do:Code: Select all
# Create a 2GB logical volume called 'swap' sudo lvcreate -L 2G -n swap mintvg # Create a 10GB logical volume called 'root' sudo lvcreate -L 10G -n root mintvg # Create a 50GB logical volume called 'home' sudo lvcreate -L 50G -n home mintvg
*note that the 'l' is lower-case this timeCode: Select all
lvcreate -l 100%FREE -n LVNAME VGNAME
7. Activate your volume group:The device nodes will be created in /dev/mapper/YOURVG-YOURLV and will be symlinked in /dev/YOURVG/YOURLVCode: Select all
sudo vgscan --mknodes sudo vgchange -ay
8. You must pre-format the logical volumes for the installer to detect them:9. Install Mint:Code: Select all
sudo mkswap /dev/mintvg/swap sudo mkfs.ext4 /dev/mintvg/root sudo mkfs.ext4 /dev/mintvg/home
-Start the installer and follow the on-screen instructions until you reach the partitioner.
-Choose manual partitioning (specify partitions manually).
-You should see something like:- /dev/mapper/mintvg-swap
/dev/mapper/mintvg-root
/dev/mapper/mintvg-home
-In the next step, click "Advanced." For me, it was trying to install the bootloader to my root logical volume (/dev/mintvg/root). Change it to '/dev/sda' or the mbr of your hard drive.
-Continue with the rest of the install like normal,
-DON'T REBOOT YET! At the end of the install, choose 'Continue testing'
10. Set up a chroot:11. Install LVM2 inside the chroot:Code: Select all
sudo mount /dev/mintvg/root /target sudo mount /dev/mintvg/home /target/home sudo mount --bind /dev /target/dev sudo mount --bind /dev/pts /target/dev/pts sudo mount --bind /proc /target/proc sudo chroot /target
Code: Select all
apt-get update apt-get install lvm2 exit
- /dev/mapper/mintvg-swap
Hopefully somebody finds this helpful