GParted _ use GParted-LiveCD to adjust the Ubuntu partition size

Source: Internet
Author: User
Tags gparted
Partitioning is the first step to install the operating system, but before the operating system, it is difficult for us to clearly know which partitions need much space, even if we get some reminders and reference numbers from others, however, there are often differences in the specific circumstances of the user. Some partitions are larger than needed, so there is no big problem, as long as your hard disk is enough. However, if some partitions are used up, it is not enough!

This article focuses on using the gparted tool in Ubuntu to resize or merge partitions. This mainly applies to scenarios where a partition is insufficient. There is no big problem in narrowing down a partition.

Partitioning is the first step to install the operating system, but before the operating system, it is difficult for us to clearly know which partitions need much space, even if we get some reminders and reference numbers from others, however, there are often differences in the specific circumstances of the user. Some partitions are larger than needed, so there is no big problem, as long as your hard disk is enough. However, if some partitions are used up, it is not enough!

At this time, you have to adjust the partition size. There are many methods. Some directly Delete the system, re-partition, and re-reinstall the operating system, which is simple and troublesome, and requires a large number of backups or there is no need to back up important things; some of them draw out a free space for a large partition, delete a small space, and combine the free partitions, re-create the partition, and modify the fstab file in linux, no, but you need to be aware of data loss and clearly know what fstab is, so you need a certain level for linux. Of course, you also need to use the logical volume method. All in all, no matter what method is used, make necessary backup to ensure that nothing is lost.

I already have a free space on the disk. I need to merge the idle partitions into the smaller ones. I checked it online in two ways: logical volume and the method of deleting and recreating a partition and then modifying the fstab. I think that since we have a dedicated tool, how can this problem be solved ?! In this case, the value of the tool gparted is doubtful.

I think many people want to do this because they do not have a good understanding of gparted usage.

Note that the operation on a partition in gparted can only affect the two adjacent partitions, and only the adjacent partitions can affect the partition.

That is, if a partition is drawn out into a free zone, the partition will certainly be generated after it is generated. Naturally, to expand a partition, you must ensure that one of the upper and lower zones of the partition is empty and unallocated. Only in this way can we resize the partition! In gparted, to expand a partition, at least one of the pre-and post-free zones is not 0.

The Free Zone on my disk is not adjacent to the small partition. So we need to move the space area near the small partition. For details, refer to the following section. If you move the partition, as I know now, you can only adjust the partitions to be "passed" one by one. (Note: the adjustment is not the size of these passing partitions, but the size of the free areas before and after the passing partitions, see ). For example, if you move "unallocated" to/dev/sda9, you need to pass through the/dev/sda6,/dev/sda7,/dev/sda8 partitions. You need to adjust the size of the free zones before and after these partitions separately.

For/dev/sda6, select and click "Resize/Move". The displayed dialog box contains three edit boxes: Free Space Preceding, New Size, free Space following. what we need to do is adjust the first and third values. In And, we can see that the size of "unallocated" is 11.37 GB (11641 MB), which is above/dev/sda6, there are no other Free zones behind/dev/sda6. Therefore, in the "Resize/Move" dialog box, Free Space Preceding is 11641 MB, and Free Space following is 0 MB.

In order to move the Free zone down and move it to the tight zone of/dev/sda6 (closer to/dev/sda9), set the Free Space Preceding of/dev/sda6 to 0, the Free Space following is set to the size of the Free zone. Of course, if you do not want to move the entire idle space, you can set this value to a smaller value. If you need to move the entire process, you can set Free Space Preceding to 0. The system automatically sets Free Space following to the desired value (the size of the entire idle zone ), of course, if you want to see the result in real time, just move the mouse over it (Click somewhere else, for example, in the Free Space following input box ). For more information, see. Click the "Resize/Move" button in the dialog box to see the effect. Click "Apply" to start the processing and Implementation of the partition location adjustment. (Of course, you can set all the operations and the final effect and apply them again)

In this way, the free zone can be moved to the top of/dev/sda9 step by performing the same processing on/dev/sda7,/dev/sda8. Then perform "Resize/Move" on/dev/sda9, and you will find that the size of the free zone before and after the partition is not all 0, the idle zone in front of it is already 11641MB. In this way, you can resize/dev/sda9.

Note that if the swap partition is involved during adjustment, disable it first. However, after the adjustment, it is found that after the restart, the swap is not mounted and activated, resulting in a slow System and the swap needs to be activated. The uuid of the swap partition has changed. You need to change it in fstab. I think this is not perfect for gparted.

View the UUID of the partition: ls-l/dev/disk/by-uuid

List partitions: df-lh

. For my disk partition, You need to merge 1 GB in "unallocated" into/dev/sda9.


. In gparted, each partition has three attributes to be adjusted.


. Move the idle area to the bottom.

. Set the effect of adjusting the partition location.

Related Article

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.