Micro Services Architecture ------ episode linux LVM disk expansion

The basic concept of 1.LVM

  • Physical volume (PV): volume group can be established in the above media may be a hard disk partition, and may be hard disk itself or loop file, physical volume includes a special header, the remainder of the block is cut into a physical area.
  • Volume Group (VG): a set of physical volumes collected as a snap
  • Logical volume (LV): virtual partitions, the physical region consisting of
  • Physical region (PE): a hard disk unit may be assigned to a logical minimum, typically 4MB 

2. Disk-related operations command

  • df -h to see mount points
  • lvdisplay displays the current logical volume
  • displays the current volume group vgdisplay
  • Displays the current physical volume pvdisplay

3.LVM expansion

  1. fdisk -l
  2. fdisk -l | grep '/ dev' At this point we look to the system which is only a data disk sda
  3. Mount the disk in a virtual machine, and then perform the following operation
  4. fdisl -l | grep '/ dev' because this time they mount a piece of disk, two disks results will show sda sdb
  5. fdisk / dev / sdb sdb create partitions n: create a partition l: Select logical partition, if you do not first create a primary partition, and then add a logical partition, up to four disk partitions. Once created, the last to write the partition w: write to disk
  6. fdisk -l | grep '/ dev' View Partition = "mkfs -t ext4 / dev / sdb1 format the partition
  7. pvcreate / dev / sdb1 create PV 

  8. pvscan see where VG PV
  9. vgextend ubuntu-vg / dev / sdb1 expansion VG 
  10. lvextend -L + 10G / dev / ubuntu-vg / ubuntu-lv or lvextend -l + 100% FREE / dev / ubuntu-vg / ubuntu-lv expansion LV, in accordance with a capacity to add, in accordance with a percentage of added
  11. resize2fs / dev / ubuntu-vg / ubuntu-lv refresh partition
  12. Lvdisplay whether the validation is successful if the LV Size adds to prove successful
  13. Do not uninstall the expansion disk, may cause data loss or system will not boot

LVM words: without using LVM software is linked to the data area at a fixed LV name is fixed, non-expansion,

        If the LVM is linked to a data region is under software VG, VG may comprise a plurality of the LV, when the VG insufficient capacity when a LV, LV can then expand within a VG, VG software data path point does not change. Only data corresponding to the address to be expanded capacity

Guess you like

Origin www.cnblogs.com/zmeRecord/p/11795777.html