The use of the lower LVM is studied due to the expansion of the installed KVM.
LVM (Logical Volume Manager) Logical Volume Manager, the practice is that the physical partition through the software combination does not have a separate large disk (VG, Volume Group), and then the large disk into a new partition (LV, logical volume) mount use.
After the physical partition plus the Sysem ID of 8e, the system ID is adjusted with the Fdisk command by turning the pvcreate into physical volume (PV).
PE (physical extension block) is the smallest storage block of LVM, LVM uses 4M PE block by default, VG (volume group) can only have up to 65,534 PE, so VG will have a maximum size of 4m*65534=256g.
How to do elastic Morbihan more LV? Transfer the original LV PE to other places in the VG to reduce the LV capacity, add the VG of the other PE into this LV can increase capacity.
With LVM, you need to first install lvm2 (apt-get install lvm2), which involves the command:
Fdisk,partprobe,pvcreate,pvscan,pvdisplay,pvremove,vgdisplay,vgcreate,lvcreate,lvdisplay,mkfs,mount.
LVM has two write modes: linear mode (linear, default), Interleaved mode (triped). Interleaved mode reads and writes better, but as long as any one partition is corrupted, the entire file system is broken.
About primary partitions (primary), extended partitions (extended), and logical Partitions (logical):
The MBR on each hard disk only supports up to four partitions, and if you want more partitions, you need an extended partition to add logical partitions to the extended partition. So if there is an extended partition, there can be at most three primary partitions, the primary and extended partition information is stored in the MBR, and the logical partition information is stored in the extended partition.
The logical volume is located as follows:/DEV/VBIRDVG/VBIRDLV,VBIRDVG is the VG name, VBIRDLV is the LV name and is actually linked to/dev/mapper.
Increase LV Capacity finally need to call RESIZE2FS, can be executed online, that is, without umount.
Reducing capacity and resizing swap sizes are not processed online:
Reducing capacity requires first calling resize2fs,umount,e2fsck and then Mount,lvresize,pvmove.
Swap partition changes first swapoff-a, complete after mkswap,swapon-a.
When using LiveCD or desktop version trying Ubuntu, you need to install LVM2, use FDISK partition, boot sub 1G, another partition to put/,swap volume and home volume, and add the System ID (8e). And then:
sudo pvcreate/dev/sda2
sudo vgcreate sysvg/dev/sda2
sudo lvcreate-l 1g-n lvswap sysvg
sudo lvcreate-l 20g-n lvroot sysvg
sudo lvcreate-l 100%free-n lvhome sysvg
sudo mkfs.ext4/dev/mapper/sysvg-lvroot
sudo mkfs.ext4/dev/mapper/sysvg-lvhome
sudo mkswap-f/dev/mapper/sysvg-lvswap
Then install Ubuntu in the above several disks and mount point.
Because the system does not boot by default without lvm2 after installation, you need to mount several points in live system below/mnt, then chroot to/mnt, and then perform apt-get install lvm2 (reference 1 suggests first in/etc Add some modules to the/modules, which may need to be performed before Mount:
Vgchange-a y sysvg
Ubuntu 12.04.3 Server Edition cannot configure LVM before installation, apply desktop (equivalent to LiveCD) boot, but the image displays problems when installing desktop in KVM (alternate this issue after installation) , without-no-acpi at startup), then use the alternate version with LVM, which does not have a/home corresponding logical volume, and the boot partition is 254MB.
PS: I tested the addition of 10G HDD in KVM, add 3G swap,7g ROOT, sure enough. It is important to note that deleting the old partition when adding a new partition starts with a default value instead of the old value, otherwise it will not reboot.
Reference:
1.http://ubuntuforums.org/showthread.php?t=1782296
2. Brother Bird's private cuisine third edition
3.KVM increased disk capacity: Http://serverfault.com/questions/324281/how-do-you-increase-a-kvm-guests-disk-space
LVM Usage Summary-Go