How to expand the partition capacity under linux-linux operation and maintenance

In daily work, we often encounter the problem of insufficient remaining capacity of a certain partition, so we need to know how to expand the partition under the Linux server. For partition expansion, there are two cases here LVM partition expansion Expansion of non-LVM partition Expansion of LVM partition Generally, we recommend using LVM, which facilitates the elastic scaling of partitions. Regarding the introduction of LVM, physical volumes, logical groups, logical volumes, etc. will not be detailed here. You can read my other two articles about LVM. Scenario: The /www directory is our website-related directory. The partition mounted on this directory uses LVM. Originally, this directory has a space of 1G, but with the operation of the system, the remaining space is only Less than 100M left. Now the partition needs to be expanded. Preparation work, realize the scene # pvcreate /dev/sdb1 # vgcreate vgwww /dev/sdb1 # lvcreate -l 255 vgwww # mkfs.ext4 /dev/vgwww/lvol0 # mount /dev/vgwww/lvol0 /www # dd if=/dev/zero of=/www/bigfile bs=1M count=900 # df -h … /dev/mapper/vgwww-lvol0 988M 903M 19M 98% /www Partition expansion First, we need to see if there is any remaining space in vgwww, If not, you need to add pv in vgwww first. #…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索