How to resize hard drive partitions in Ubuntu from console

partition is the name given to each of the divisions that are present on a single physical storage device. For example, to illustrate, if you have several partitions, it is as if you had several hard drives on a single physical hard drive and each would have its file system and operation different from the others.

You can use these partitions for various things. For example you can use them only to store important data with security measures, you could also make backup copies of your files and use them to install different operating systems.

In operating systems such as Linux it will allow you to structure the disk into partitions for all the different files that this system uses. And that’s not all, you can also resize these partitions on your hard drive, and even install an operating system on an external hard drive .

In this article we will show you how to resize hard drive partitions in Ubuntu from your console easily. This time we will use the Ubuntu 13.04 operating system to do all the procedures.

Learn how to resize hard drive partitions in Ubuntu from the console. Follow these step-by-step instructions to allocate or reallocate disk space easily.

Resizing hard drive partitions in Ubuntu using the console (command line) typically involves a few steps. I’ll guide you through the process in a tabular format for clarity:

Step Command Description
1 sudo fdisk -l List all partitions. This command displays all current partitions on your system, along with their sizes and types. You’ll need to identify the partition you want to resize.
2 sudo umount /dev/sdXn Unmount the partition. Replace /dev/sdXn with the partition’s identifier (e.g., /dev/sda1). This step is necessary if the partition is currently mounted.
3 sudo resize2fs /dev/sdXn SIZE Resize the filesystem. Replace SIZE with the new size you want for your partition (e.g., 20G for 20 GB). Use resize2fs for ext3/ext4 partitions. If your partition is of a different type (e.g., NTFS), use a different tool like ntfsresize.
4 sudo fdisk /dev/sdX Resize the partition. Replace /dev/sdX with the disk identifier (e.g., /dev/sda). This opens the fdisk utility for your disk, where you can delete and recreate the partition with a new size. Be very careful here as mistakes can lead to data loss.
5 sudo fdisk -l Verify changes. After completing the resizing process, use this command again to ensure the changes have been applied correctly.

Important Notes:

  • Backup your data before proceeding. Resizing partitions can lead to data loss if not done correctly.
  • If you are resizing your root partition or any other system-critical partition, it’s recommended to do it from a live USB or live CD environment to avoid conflicts.
  • The resize2fs command only works for ext3 and ext4 file systems. For other file systems, you will need to use different tools.
  • The fdisk tool is for MBR partitioned disks. If your disk uses GPT, use the gdisk tool instead.
  • Ensure that the new partition size is large enough to accommodate the current data and that the filesystem is resized accordingly to avoid data corruption.

This is a high-level overview, and the actual steps might vary slightly based on your specific system configuration and partition setup.

How to resize hard drive partitions?

Although having the Linux system offers you many advantages, the truth is that one of its disadvantages is that unlike Windows, it cannot resize partitions of a hard disk or of a system that you are using. This occurs because in order to do this type of procedure, it is necessary to unmount the volume and resize it . Additionally there are differences between disk partitions .

We say that it is a disadvantage of Linux, since to do this same procedure in Windows you just have to go to its native disk management tool and from there you can resize the volume even if you are using the same drive where the Microsoft operating system is hosted.

Unlike Linux, it will not be necessary to unmount the drive volume and you can do the procedure in just a few minutes.

If you are here it is because you will do this procedure using Linux, but being different from Windows it is necessary that you do it from a Live CD or Ubuntu Live USB. In this article we will show you how to do it from the Live USB of Ubuntu version 13.04 as we mentioned earlier.

The first step you must follow is to reboot your system and boot it with the Ubuntu 13.04 Live USB, this process can be programmed directly from the Bios by selecting the USB device. Once your system has booted with the Live USB, you must open the Yumi program.

Previously installed, and select the Linux distributions option from its main screen and then the option to try Ubuntu 13.04 but without installing it on the hard disk. Once the Ubuntu desktop can be seen on the screen, you must follow these new steps that we will give you below.

What are the steps to follow to resize partitions?

Once you have started your system from the Live Distro, you must go to Dash and type the following: gparted

Now you must click on the icon and a window that is the main one of gparted should automatically appear on the screen, this is the one that will allow you to manage your hard disk drives.

You must select the Linux partition that has the EXT format, you must place your cursor on it and with your mouse right click, and in the options that were displayed choose the Resize / Move option .

You will be able to see a new window unfold where you will have to modify the partition that you have selected but without damaging the Ubuntu 13.04 operating system that will be hosted there.

For you to be able to resize the Linux partition, you have to go directly into the configuration and write in the text box the amount of space you want on the partition or by moving the upper bar to the left or right until you get the desired size.

When you have finished this procedure and you have the desired size or dimension, you must click again on the Resize / Move option and the process will start .

It will take at least a couple of hours until it is ready. And that will be the whole procedure that you are going to carry out, you will already be able to count on your resized Linux partition . Although it may seem a bit complicated, the truth is that when you start the process you will see that it is not difficult at all.

 

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment