ubuntu non-lvm expansion mode root directory

 

  Business needs because the server is not preinstalled on lvm, not directly expansion, and before all the files on the same disk, but the business requires additional capacity is needed, you can use multiple hard drives

  Professional terms
* A physical storage medium (PhysicalStorageMedia)
It refers to the physical storage device system: magnetic disks, such as: / dev / hda, / dev / sda , is a storage system, the bottom of the storage unit .
* Physical Volume (Physical Volume, PV)
Refers to a disk partition or device (e.g., RAID) having the same function from a logical disk partition, it is the basic storage logical blocks LVM, but basic physical storage medium (such as a partition, disk, etc.) comparison, but with related LVM the management parameters.
* Volume group (Volume Group, VG)
LVM system similar to non-physical disks, which consists of one or more physical volume PV. You can create one or more of LV (logical volumes) in the volume group.
* Logical volumes (Logical Volume, LV)
Similar to non-LVM disk partition system, built on the logical volume group VG. LV logical volume on the file system can be established (such as / home or / usr, etc.).
* Physical block (Physical Extent, PE)
Each physical volume PV is divided into units called PE (Physical Extents) of the base unit , PE has a unique number is the smallest unit that can be addressed LVM. PE size is configurable, default to 4MB. Therefore, physical volume (PV) of equal size by the base unit PE composition.
* Logical block (Logical Extent, LE)

   solution:

  

fdisk -l # Displays all physical storage medium 
fdisk / dev / sdb sequentially input D (delete the original letter) n (to create the volume) p 1 enter enter yt (modified disk mode) 8e (Linux LVM) w (save)
the pvcreate / dev / sdb1

{another hard disk
fdisk / dev / sdc sequentially input D (delete the original letter) n (to create the volume) p 1 enter enter yt (modified disk mode) 8e (Linux LVM) w (save) 
the pvcreate / dev / sdc1

}
The vgcreate Ubuntu-VG-Test / dev / sdb1 # Create a physical volume group
the lvcreate    -L-500G -n lvtest Ubuntu VG- Test # Create a logical volume space and a physical volume allocated to logical volumes 500G
vgextend ubuntu-vg / dev / sdc1 # expandable using physical volume group
lvextend -L + 500G / dev / mapper / ubuntu - vg-test-lvtest # logical extension
resize2fs /dev/mapper/ubuntu--vg-test-lvtest
mkfd.ext4 / dev / Mapper / Ubuntu - VG - # Test-formatted lvtest
mkdir  /home2
mount /dev/mapper/ubuntu--vg--test-lvtest
/home2 cp -rf /home/* /home2
blkid # uuid is set according to the output of the / etc values ​​/ fstab of
vi / etc / fstab # below 
reboot

 

  

Guess you like

Origin www.cnblogs.com/skycandy/p/11360198.html