Linux LVM-File System Extension
LVM extent volume size
+ The current LVM manages a disk/dev/sda
+ Method 1: expand the existing disk sda and add the added space to the maximum volumn.
+ Method 2: Add a new disk sdb and extend the added space to the largest volumn.
1. Expand the existing Disk/dev/sda (storage expansion 5 GB) and restart the machine
A. Create a new primary partition/dev/sda3 and run the fdisk/dev/sda command.
[Root @ localhost ~] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/vg01-lv01
46G 3.0G 41G 7%/
/Dev/sda1 99 M 18 M 77 M 19%/boot
Tmpfs 185 M 0 185 M 0%/dev/shm
B. Create a New pv and run the command pvcreate/dev/sda3. If the pv is not restarted, an error occurs.
[Root @ localhost ~] # Pvcreate/dev/sda3
Physical volume "/dev/sda3" successfully created
C. extend the existing vg and run the vgextend vg01/dev/sda3 command.
[Root @ localhost ~] # Vgextend vg01/dev/sda3
Volume group "vg01" successfully extended
D, extended lv 2 GB, command lvextend-L + 2G/dev/vg01/lv01
[Root @ localhost ~] # Lvextend-L + 2G/dev/vg01/lv01
Extending logical volume lv01 to 49.00 GB
Logical volume lv01 successfully resized
E. Extended lv file system, command resize2fs/dev/vg01/lv01
[Root @ localhost ~] # Resize2fs/dev/vg01/lv01
Resize2fs 1.39 (29-May-2006)
Filesystem at/dev/vg01/lv01 is mounted on/; on-line resizing required
Ming an on-line resize of/dev/vg01/lv01 to 12845056 (4 k) blocks.
The filesystem on/dev/vg01/lv01 is now 12845056 blocks long.
[Root @ localhost ~] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/vg01-lv01
48 gb 3.0G 43G 7%/
/Dev/sda1 99 M 18 M 77 M 19%/boot
Tmpfs 185 M 0 185 M 0%/dev/shm
2. add an additional disk or expand the volume of LVM. The method is the same as that of method 1.
- Use LVM to create elastic disk storage-Part 1
- Expanding/downgrading LVM in Linux (Part 2)
- Recording and restoring logical volume snapshots in LVM (part 3)
- Set a streamlined resource allocation volume in LVM (part 4)
- Use fragmented I/O to manage multiple LVM disks (Part 5)
This article permanently updates the link address: