How to use the GParted utility scale root partition | Linux China

640?wx_fmt=jpeg In this article, we will teach you how to use Linux GParted zoom in on the activities of the root partition. - Magesh Maruthamuthu

Today we will discuss the disk partition. This is a good topic of Linux. This allows the user to re-adjust the active root partition in Linux.

In this article, we will teach you how to use Linux GParted zoom in on the activities of the root partition.

For example, when we installed the Ubuntu operating system, and did not properly configured, only 30 GB of disk in our system. We need to install another operating system, so we want to make the second partition.

Although it is not recommended to re-adjust the active partition. However, we want to perform this operation, because there is no other way to release the system partition.

Note: Before performing this action, make sure you back up important data, because if something goes wrong (for example, a power failure or reboot your system), you may be able to keep your data.

What is Gparted

GParted  is a free partition manager, which allows you to zoom, copy, and move partitions without losing data. By using the GParted Live can boot image, we can use all the features GParted application. GParted Live can allow you to use GParted on GNU / Linux and other operating systems, for example, 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 district. df Command output clearly shows that I have only one partition.

 
  
  1. $ df -h
  2. Filesystem Size Used Avail Use% Mounted on
  3. /dev/sda1 30G 3.4G 26.2G 16% /
  4. none 4.0K 0 4.0K 0% /sys/fs/cgroup
  5. udev 487M 4.0K 487M 1% /dev
  6. tmpfs 100M 844K 99M 1% /run
  7. none 5.0M 0 5.0M 0% /run/lock
  8. none 498M 152K 497M 1% /run/shm
  9. none 100M 52K 100M 1% /run/user

2) Use fdisk command to check disk partition

I will use the  fdisk command to verify this.

 
  
  1. $ sudo fdisk -l
  2. [sudo] password for daygeek:
  3. Disk /dev/sda: 33.1 GB, 33129218048 bytes
  4. 255 heads, 63 sectors/track, 4027 cylinders, total 64705504 sectors
  5. Units = sectors of 1 * 512 = 512 bytes
  6. Sector size (logical/physical): 512 bytes / 512 bytes
  7. I/O size (minimum/optimal): 512 bytes / 512 bytes
  8. Disk identifier: 0x000473a3
  9. Device Boot Start End Blocks Id System
  10. /dev/sda1 * 2048 62609407 31303680 83 Linux
  11. /dev/sda2 62611454 64704511 1046529 5 Extended
  12. /dev/sda5 62611456 64704511 1046528 82 Linux swap / Solaris

3) Download the GParted live ISO image

Use the following commands to perform the download GParted live ISO.

 
  
  1. $ wget https://downloads.sourceforge.net/gparted/gparted-live-0.31.0-1-amd64.iso

4) Use GParted Live boot your system installation media

Use GParted Live installation media (such as burning a CD / DVD or USB or ISO image) to boot your system. You will receive output similar to the following screen. Here Select "GParted Live (Default settings)", and hit the Enter button.

640?wx_fmt=jpeg

5) Select Keyboard

By default, it chooses the second option, press Enter.

640?wx_fmt=jpeg

6) Select Language

By default, it selects "33" in American English, press enter.

640?wx_fmt=jpeg

7) Select mode (graphical user interface or command line)

By default, it selects the "0" graphical user interface mode, press enter.

640?wx_fmt=jpeg

8) loads GParted Live screen

Now, GParted Live screen has been loaded, it displays a list of the partition I had created.

640?wx_fmt=jpeg

9) How to re-adjust the size of the root partition

Choose who you want to re-adjust the size of the root partition, only one partition here, so I will edit this partition in order to install another operating system.

640?wx_fmt=jpeg

To do this, press the "Resize / Move" button to reorder the partition size.

640?wx_fmt=jpeg

Now, in the first box, enter the size you want to be removed from this partition. I will ask for "10GB", so I add "10240MB", and let the rest of the dialog box to the default values, then click the "Resize / Move" button.

640?wx_fmt=jpeg

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

640?wx_fmt=jpeg

Zoning is reduced from 30GB to 20GB has been successful. Also shows 10GB disk space unallocated.

640?wx_fmt=jpeg

Finally, click "Apply" button below to perform the remaining operations.

640?wx_fmt=jpeg

e2fsck Is a file system check utility, bad fan Road Automatically fix file system associated with the HDD, I / O error.

640?wx_fmt=jpeg

resize2fs The program will re-adjust the ext2, ext3 or ext4 file system size. It can be used to expand or shrink an unmounted positioned on a device's file system.

640?wx_fmt=jpeg

e2image The program saves the metadata key located ext2, ext3 or ext4 file system on the device to a specified file.

640?wx_fmt=jpeg

All the operation is complete, close the dialog box.

640?wx_fmt=jpeg

We can now see unallocated "10GB" disk partition.

640?wx_fmt=jpeg

Reboot the system to check the results.

640?wx_fmt=jpeg

10) Check the remaining space

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

 
  
  1. $ sudo parted /dev/sda print free
  2. [sudo] password for daygeek:
  3. Model: ATA VBOX HARDDISK (scsi)
  4. Disk /dev/sda: 32.2GB
  5. Sector size (logical/physical): 512B/512B
  6. Partition Table: msdos
  7. Disk Flags:
  8. Number Start End Size Type File system Flags
  9. 32.3kB 10.7GB 10.7GB Free Space
  10. 1 10.7GB 32.2GB 21.5GB primary ext4 boot

via: https://www.2daygeek.com/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility/

Author: Magesh Maruthamuthu  Translator: robsean  proofread: wxy  topics: lujun9972

This article from the  LCTT  original compiler, Linux China  is proud

640?wx_fmt=jpeg


Guess you like

Origin blog.csdn.net/F8qG7f9YD02Pe/article/details/92265699