Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ LVM basic concepts, management     - MySQL optimization of the relevant Group By (Database)

- Talk about the Linux ABI compatibility Application (Linux)

- To compile and install MySQL 5.7.7 RC under CentOS 7.1 (Database)

- Install multiple Linux distributions and Fedora 21 first experience on the same hard disk (Linux)

- DB2 table space is redirected to restore the database combat (Database)

- Common Linux System Troubleshooting (Linux)

- Oracle 11g Export guide problem not an empty table (Database)

- How to Install Node.js in CentOS 7 (Linux)

- Ubuntu under VirtualBox virtual machine serial port settings (Linux)

- Android Get App version number and version name (Programming)

- Getting Started with Linux: Nginx Web Server How to Block Specific User Agents (UA) (Server)

- Linux firewall iptables beginner tutorial (Linux)

- Unity Greeter Badges: the lost session icon back to the login screen Ubuntu (Linux)

- swap space is insufficient cause OOM kill MySQL Case (Database)

- How to install web crawler tool in Ubuntu 14.04 LTS: Scrapy (Linux)

- Story timestamp and time zones: daily programmer (Programming)

- openSUSE 13.1 / 13.2 installation SoundConverter 2.1.2 (Linux)

- Linux file system management partition, format, mount - label mount (Linux)

- Debian GNU / Linux service list acquisition, shutting down services or run (Linux)

- Debugging with GDB tool Go (Programming)

 
         
  LVM basic concepts, management
     
  Add Date : 2018-11-21      
         
         
         
  First, the traditional disk management problems

When the partition size is not enough when you can not expand its size by adding only disk, create a new partition to expand space, but add in the new hard disk as a separate file system exists, the original file system has not been expanded, the upper application Very often only have access to a file system. Only make existing disk offline, then replaced with a new disk, and then import the raw data.

Second, the basic concepts of LVM logical volumes

LVM (Logical volume Manager) Logical Volume Manager by abstraction of the underlying physical hard disk encapsulated in the form of logical expression to the upper system, the logical volume size can be dynamically adjusted, and will not lose any existing data. Newly added hard disk does not change the existing upper logical volume.

As a dynamic disk management mechanism, technology has greatly enhanced the flexibility of logical disk management.

PE (physical extend) defaults to 4MB of basic blocks

PV (physical volume) hard disk or partition

Overall VG (volume group) consisting of one or more of PV

LV (logical volume) cut out from VG in space to create a file system

Three, LVM creation process
1. The physical disk is formatted as a PV, a space is divided into a PE
2. nowhere PV join the same VG, different PV of all entered the VG PE PE tanks
3.LV created based on PE, PE is an integer multiple of the size, the LV PE composition may come from different physical disks
After 4.LV format can now directly use the mount
5.LV expansion reduction is actually to increase or decrease the number of PE in the composition of the LV. The process without losing the original data

Fourth, create LVM

The physical disk device is initialized as a physical volume

pvcreate / dev / sdb / dev / sdc

Create a volume group and the volume group PV added

vgcreate vg0 / dev / sdb / dev / sdc

Create a logical volume-based group

lvcreate -n lv0 -L 5G vg0

Create a logical file system to create good

mkfs.ext4 / dev / vg0 / lv0

The formatted logical volumes mount use

mount / dev / vg0 / lv0 / mnt /

The mount information write / etc / fstab the restart still take effect

echo "/ dev / vg0 / lv0 / mnt ext4 defaults 0 0" >> / etc / fstab

V. View LVM

Check the physical volume information: pvs, pvdisplay (Details)

Check volume group information: vgs, vgdisplay (Details)

See logical volume information: lvs, lvdisplay (Details)

Sixth, delete LVM

Remove LV: lvremove / dev / vg0 / lv0

Remove VG: vgremove vg0

Delete PV: pvremove / dev / sdb

Seven, drawing a logical volume

Logical stretching operation can be performed online, without uninstalling the logical volume

VG ensure that there is enough free space

vgs, vgdisplay

Logical extension

lvextend -L + 5G / dev / vg0 / lv0

Check the size of the expanded LV

lvs, lvdisplay

Update the file system

resize2fs / dev / vg0 / lv0

See the updated file system

df -h

Eight, drawing a volume group

VG will be added to the hard disk is formatted as PV

pvcreate / dev / sdd

Add a new PV to the specified volume group

vgextend vg0 / dev / sdd

Check the size of the expanded VG

vgs, vgdisplay

Nine, shrink a logical volume

Logical volume shrink operation must be performed offline, to uninstall the logical volume

Uninstall the logical volume has been mounted

umount / dev / vg0 / lv0

Shrink the file system (formerly lv0 to 10G)

e2fsck -f / dev / vg0 / lv0

resize2fs / dev / vg0 / lv0 3G

Reduced LV

lvreduce -L -7G / dev / vg0 / lv0

LV view after reduction

lvs, lvdisplay

Mounting

mount / dev / vg0 / lv0 / mnt

Ten, shrinking the volume group

PV will be removed from a specified group

vgreduce vg0 / dev / sdd

Check the size of the volume group after reduction

vgs, vgdisplay

Remove PV

pvremove / dev / sdd
     
         
         
         
  More:      
 
- Configuring Sublime Text Python runtime environment 2 (Linux)
- Android imitation UC browser scroll up and down functions (Programming)
- B-tree - ideas and implementation of C language code (Programming)
- Apache Linux firewall reverse proxy configuration (Linux)
- C language function pointer and a callback function (Programming)
- Internet proxy workaround can not be used under Linux YUM (Linux)
- CentOS 6.4 Telecom ADSL dial-up network configuration (Linux)
- CentOS 7 update source - the use of domestic sources 163 yum (Linux)
- How to configure FirewallD in RHEL / CentOS 7 and Fedora in (Linux)
- Create your own YUM repository (Linux)
- Vagrant build LNMP environment (Server)
- Ubuntu ADSL dial-up Internet access (Linux)
- Nine artifact control disk partition under Linux (Linux)
- Open log in Hibernate (Programming)
- Linux systems use logwatch log file monitoring (Linux)
- How a lot of blocking malicious IP address in Linux (Linux)
- The user of fedora is not in the sudoers file method to solve (Linux)
- Use NTFS-3G to mount NTFS partitions under Linux U disk and removable hard disk (Linux)
- Formatting Java floating-point types (Programming)
- Java8 Lambda expressions and flow operations (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.