How can I resize A Linux partition when it is full ?, Linux partition full resizing

Source: Internet
Author: User

How can I resize A Linux partition when it is full ?, Linux partition full resizing

The figure shows that the usage of the mount point "/" has been moved to 100%, and the space is insufficient. Therefore, you need to partition the mount point.

1. First enter the VM settings to increase disk space

Note: Change 25 to 50 to expand the space. Here we must write a number larger than 25, because it is "increased to" 50 GB, rather than "increased by 25 GB"

2. You can see that the disk space is increased to 53.7 GB. There are two partitions on the device, sda1 and sda2 (ignore sda3 ). Next, add a partition.

Type the command: fdish/dev/sda

Type: m (for help)

Type: n (add partition)

Type: p (add primary partition)

Type: Press enter (start and end sectors)

Last: w (Exit)

Note: If you press enter directly in the "starting sector", random writing may cause a waste of space.

Now the system has three points: sda1, sda2, and sda3.

3. Create a physical volume

Type the command pvcreate/dev/sda3.

If sda3 is not found, type partprobe or restart the VM.

4. Use vgscan to query physical volumes

4.1 The physical volume name of the local machine can be found as "cl ",

4.2 Use the new physical volume extension cl:

Type the command: vgextendcl/dev/sda3

5. Extend lv

Enter the command: lvextend-L + 24G plus the name of the partition to be extended

Then we use dh-f to find that the actual capacity has not changed, because our system does not know the file system of the Newly Added Disk, so we need to resize the file system.

Type: xfs_growfs and the name of the partition to be extended.

Or

Resize2fs-f add the name of the partition to be extended

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.