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.
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 30G 3.4G 26.2G 16% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 487M 4.0K 487M 1% /dev
tmpfs 100M 844K 99M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 498M 152K 497M 1% /run/shm
none 100M 52K 100M 1% /run/user
2) Use fdisk command to check disk partition
I will use the fdisk
command to verify this.
$ sudo fdisk -l
[sudo] password for daygeek:
Disk /dev/sda: 33.1 GB, 33129218048 bytes
255 heads, 63 sectors/track, 4027 cylinders, total 64705504 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk 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 / Solaris
3) Download the GParted live ISO image
Use the following commands to perform the download GParted live ISO.
$ 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.
5) Select Keyboard
By default, it chooses the second option, press Enter.
6) Select Language
By default, it selects "33" in American English, press enter.
7) Select mode (graphical user interface or command line)
By default, it selects the "0" graphical user interface mode, press enter.
8) loads GParted Live screen
Now, GParted Live screen has been loaded, it displays a list of the partition I had created.
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.
To do this, press the "Resize / Move" button to reorder the partition size.
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.
It will again ask you to confirm resize partitions, because you are editing the system partition active, then click "Ok".
Zoning is reduced from 30GB to 20GB has been successful. Also shows 10GB disk space unallocated.
Finally, click "Apply" button below to perform the remaining operations.
e2fsck
Is a file system check utility, bad fan Road Automatically fix file system associated with the HDD, I / O error.
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.
e2image
The program saves the metadata key located ext2, ext3 or ext4 file system on the device to a specified file.
All the operation is complete, close the dialog box.
We can now see unallocated "10GB" disk partition.
Reboot the system to check the results.
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.
$ sudo parted /dev/sda print free
[sudo] password for daygeek:
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 32.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk 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
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