Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the GParted utility to scale the root partition

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use the GParted utility to zoom the root partition. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

How to use GParted to scale the active root partition on Linux.

For example, when we installed the Ubuntu operating system, it was not configured properly, and our system only had 30 GB disks. We need to install another operating system, so we want to make a second partition in it.

Although readjusting the active partition is not recommended. However, we want to do this because there is no other way to release the system partition.

Note: make sure you back up important data before performing this action, because if something goes wrong (for example, a power failure or your system restart), you can keep your data.

What is Gparted?

GParted is a free partition manager that allows you to scale, copy, and move partitions without losing data. By using GParted's Live to start the image, we can use all the features of the GParted application. GParted Live enables you to use GParted on GNU/Linux and other operating systems, such as Windows or Mac OS X.

1) use the df command to check disk space utilization

I just want to use the df command to show you my partition. The output of the df command clearly shows that I have only one partition.

$df-hFilesystem Size Used Avail Use% Mounted on/dev/sda1 30G 3.4G 26.2G 16% / none 4.0K 0 4.0K 0 / sys/fs/cgroupudev 487M 4.0K 487m 1% / devtmpfs 100M 844K 99M 1% / runnone 5.0M 05.0M 0% / run/locknone 498M 152K 497m 1% / run/shmnone 100m 52K 100m 1% / run/user2) use the fdisk command to check disk partitions

I'll use the fdisk command to verify this.

$sudo fdisk-l [sudo] password for daygeek: Disk / dev/sda: 33.1GB, 33129218048 bytes255 heads, 63 sectors/track, 4027 cylinders Total 64705504 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000473a3 Device Boot Start End Blocks Id System/dev/sda1 * 2048 62609407 31303680 83 Linux/dev/sda2 62611454 64704511 1046529 5 Extended/dev/sda5 62611456 64704511 1046528 82 Linux swap / Solaris3) download GParted live ISO image

Use the following command to execute the download GParted live ISO.

$wget https://downloads.sourceforge.net/gparted/gparted-live-0.31.0-1-amd64.iso4) starts your system using the GParted Live installation media

Use GParted Live installation media (such as burned CD/DVD or USB or ISO images) to start your system. You will get output similar to the following screen. Select "GParted Live (Default settings)" here and click enter.

5) Keyboard selection

By default, it selects the second option and presses enter.

6) language selection

By default, it chooses "33" American English and press enter.

7) Mode selection (graphical user interface or command line)

By default, it chooses "0" graphical user interface mode and presses enter.

8) load GParted Live screen

Now that the GParted Live screen is loaded, it displays a list of partitions I created previously.

9) how to resize the root partition

Select the root partition you want to resize, there is only one partition here, so I will edit this partition to install another operating system.

To do this, press the Resize/Move button to resize the partition.

Now, enter the size you want to take out of this partition in the first box. I'm going to ask for "10GB", so I add "10240MB", leave the rest of the dialog box at default values, and then click the "Resize/Move" button.

It will once again ask you to confirm that you resize the partition because you are editing the active system partition, and then click "Ok".

The partition has been reduced from 30GB to 20GB successfully. The unallocated disk space of 10GB is also displayed.

Finally, click the "Apply" button to perform the rest of the actions below.

E2fsck is a file system check utility that automatically fixes HDD-related bad fan tracks and Icano errors in the file system.

The resize2fs program resizes the ext2, ext3, or ext4 file system. It can be used to expand or shrink an unmounted file system located on a device.

The e2image program saves the metadata of critical ext2, ext3, or ext4 file systems located on the device to a specified file.

All operations are complete, close the dialog box.

Now we can see the unallocated "10GB" disk partition.

Restart the system to check this result.

10) check the remaining space

Log in to the system again and use the fdisk command to view the space available in the partition. Yes, I can see the unallocated "10GB" disk space on this partition.

$sudo parted / dev/sda print free [sudo] password for daygeek: Model: ATA VBOX HARDDISK (scsi) Disk / dev/sda: 32.2GBSector size (logical/physical): 512B/512BPartition Table: msdosDisk Flags: Number Start End Size Type File system Flags 32.3kB 10.7GB 10.7GB Free Space 1 10.7GB 32.2GB 21.5GB primary ext4 boot on "how to use the GParted utility to scale the root partition" is here. Hope that the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report