How to create and manage partitions with GParted step by step

  • GParted allows you to create, resize, move, clone, and format partitions from a very complete graphical interface.
  • Operations are planned first and only written to disk when the change queue is applied, making it easier to review and correct.
  • Used from a Live CD/USB, it is ideal for preparing Windows or Linux installations and for repairing boot problems with GRUB.
  • In the event of serious errors in the partition table or data loss, tools such as testdisk and photorec complement the use of GParted.

partitions with GParted

If you work with multiple operating systems or simply want to keep your data better organized, sooner or later you're going to have to deal with the Disk partitioning and GParted is the perfect tool To do this from GNU/Linux. It's powerful, free, works on almost any distro, and you can also boot it from a Live CD or Live USB when the system won't start.

In the following lines you will find a very complete guide, based on the official documentation of GParted, educational manuals and classic tutorialsBut rewritten in a more accessible language. You'll see exactly what GParted is, how its window is organized, how to create, delete, move, resize, clone, and check partitions, how to prepare a disk to install Windows or Linux, and even how to rescue the GRUB bootloader or try to recover a lost partition table.

What is GParted and what can you do with it?

GParted (GNOME Partition Editor) is a Free and open-source cross-platform graphical partition editor Designed to create, reorganize, and delete partitions on hard drives and SSDs without using the command line. It's the result of many years of development that have refined the program and expanded its file system compatibility.

A single storage device can be divided into several logical areas called partitions, each with its own file system and function: system, data, swap, backups, etc. The beauty of GParted is that it allows you to change the disk "map" (create, resize, move, copy, delete...) trying to preserve the data when possible.

Typical actions that GParted allows you to perform include create new partitions, resize them, move them, copy them, format them, adjust them, and manage their flags (boot, hidden, etc.). You can also see which operations each type of file system supports using a compatibility chart accessible from the help menu.

Another important advantage is that GParted is available both application installed on your Linux desktop (Ubuntu, Debian, Fedora, etc.) as a bootable Live CD/USB. This is key to being able to modify partitions of the system itself, or of another operating system installed on the same computer, without having them mounted.

GParted

Ways to start GParted and first steps

On most GNU/Linux desktops, you can open GParted from the Applications menu in the Administration or System sectionwith a name similar to “Partition Editor (GParted)”. In GNOME-based or derivative environments, it usually appears in the system tools category.

If you prefer the terminal, simply run the command Use `sudo gparted` to launch the interface with administrator privileges.Some educational guides even specify a specific password for classroom environments, but on your computer you will use your user password with sudo privileges.

GParted also allows you to specify one or more specific devices from the command line. For example, you could call gparted /dev/sda /dev/sdb so that the program loads those disks directly and you can switch between them from the window itself.

Upon startup, the application performs a scan of all detected storage devices in the system: SATA disks, NVMe disks, USB drives, SCSI, etc. After a few seconds, you will see the first disk selected by default, usually /dev/sda, with its partition layout.

In the upper right there is a selector that allows quickly switch between connected physical drives. This is very useful if you have several internal hard drives or work with external hard drives plugged in via USB.

The GParted window: zones and main elements

GParted's interface is designed so that you can understand how your disk is partitioned at a glance. The window is divided into several There are distinct areas that you should be familiar with before touching anything..

  • Toolbar and classic menus (Device, Partition, View, Edit, Help…). In the upper area. These options are equivalent to what appears when you do Right-click on a partition or on unallocated spaceSo you can achieve the same actions in several ways: menu, button bar, right click, or keyboard shortcuts.
  • Disk space bar graphJust below the previous one. Each colored block represents a partition, its relative size, and the space used and free. The color legend at the bottom tells you which file system corresponds to each color (ext4, NTFS, swap, etc.).
  • Partition table in detailed listing formatThis table displays fields such as device name (/dev/sda1, /dev/sda2…), file system, total size, used space, free space, flags, etc. This table complements the graph above, and any selection is highlighted in both views simultaneously.

Optionally, you can activate a panel on the side with Device Information selected (model, total size, partition table type, etc.), and in the lower area you will see the famous list of pending operations, where all the actions you plan are accumulated before actually applying them to the disk.

gparted

Select disks, partitions, and unallocated space

To change drives, use the drop-down menu in the upper right corner and choose the physical device you want to manage (for example, /dev/sdb instead of /dev/sda)As soon as you select it, the program will update the graph and table to show only the contents of that disk.

To work on a specific partition, simply do Left-click on your color block in the graphic bar or in the corresponding row of the tableThe partition will be highlighted and the menu options will be enabled or disabled depending on what can be done with it at that time.

If what you want is to select unallocated space To create a new partition, simply click on the gray area that indicates free space, both in the chart and in the list. It will then be highlighted in both views, making it clear which area you will be trading.

When you right-click on an unallocated partition or space, a pop-up menu appears with the most common operations: new, resize/move, delete, copy, paste, format, manage flags, checketc. It's the fastest way to access almost everything you'll use on a daily basis.

Creating a partition table on an empty or damaged disk

In some educational settings or when you buy a new hard drive, when you open GParted you might see a Warning with a caution triangle indicating problems with the partition tableThat means the disk does not have a valid table or it is corrupted.

In that situation, the first thing to do is go to the Device menu and choose the option Create partition table to initialize the diskGParted will display a window asking you to select the table type: MSDOS, GPT, Mac, pc98, sun, bsd, dvh, amiga, aix, loop, etc.

For most domestic cases where you're going to install Windows XP, Windows 7, some versions of Ubuntu or classic distributionsThe MSDOS-type table (MBR) is sufficient. On modern systems with UEFI and EFI partitions For large disks, it's more common to use GPT, but the procedure in GParted is similar: you choose the type, confirm the warning, and the program writes the new table.

Once created, you will see the entire disk as unallocated space ready for partitioningFrom there you can start defining primary, extended, and logical partitions as needed.

gparted

Create, delete, and format partitions with GParted

With the partition table ready, the next usual step is to create the partitions you're going to use. To do this, you need to select the unallocated space and use the New option from the context menu or from the Partition menu.

Doing so will open a wizard where you can define several parameters:

  • Total size.
  • Free space before and after.
  • Partition type (primary or extended).
  • File system (ext4, NTFS, FAT32, swap, etc.).
  • Label (friendly name).
  • Alignment (by MiB, cylinders or none).

On disks with multiple partitions, it is generally recommended to reserve space, if necessary. a gap before or after the partition to allow for the creation of others later.or to free up space for another installation. If you choose "use the entire disk," you will simply use all the free space available at that time.

To delete a partition, the process is similar but in reverse: Select the partition, right-click, DeleteThe action will be marked in the pending operations queue, and that area will be marked as unallocated space. This is a delicate operation because all the content of that partition will be lost.

Formatting is used to change the file system of a partition or to clean all its contents while maintaining the same size and locationThis is done by selecting the partition, right-clicking, "Format as" and choosing the type of file system you are interested in (for example, ext4 for Linux, NTFS for Windows, FAT32 for wide compatibility, etc.).

Resize, move, and move space between partitions

One of GParted's most powerful features is the ability to resize a partition and move it across the disk. Even in a single combined operation. This allows, for example, shrinking one data partition to free up space and enlarging another that is running out of space.

To resize, select the partition and use the option Resize/Move to open the adjustment windowThere you can drag the ends of the graphic block with the mouse or directly type the new size values, free space at the beginning and end.

The alignment can also be modified in this dialog. It is highly recommended to leave the alignment as is. MIB to ensure good performance on modern drives and avoid strange gapsGParted may leave small gaps of 1 MiB between partitions to maintain this alignment, and it's best not to try to take advantage of them by forcibly moving partitions.

When an operation involves moving the beginning of a partition (not just the end), the risk increases, because A lot of data needs to be relocated and the system may fail to boot If something goes wrong, or if it involves a system partition, GParted will explicitly warn you with a message. It's important to take this very seriously.

A typical case is when you have one primary partition full (C:) and another with free space (D:). The procedure for Migrate storage space from one to another without losing data. It consists of chaining together several resizing and moving operations: shrinking the partition that has extra space, adjusting the extended partition if the space is within it, and finally, expanding the partition you want to grow using the freed-up space.

The trick is that, to enlarge a partition, there must exist unassigned space directly adjacent to itIf that gap is "beyond" another partition or within a different extended partition, you have to move the boundaries of the partitions involved until you place the free space where it is needed.

disk partition

Cloning partitions and managing backups with GParted

In addition to changing sizes, GParted allows copy and paste entire partitionsIn practice, this is equivalent to cloning them. This technique is very useful for duplicating an existing system to another disk, preparing a structural backup, or replicating a data partition.

The usual procedure involves selecting the source partition, choosing Copy from the context menu and then click on the unallocated space of the destination disk (or from the same disk, if there is space) and click Paste. GParted will create a new partition with the same characteristics, adjusting the size if you modified it in the previous dialog.

This function is also very practical when you want to transfer the contents of an old disk to a new one with greater capacity, whether cloning specific partitions or replicating the entire schemeHowever, the startup process needs to be adjusted afterwards, and in some cases, the UUIDs or labels need to be adjusted to avoid conflicts.

Flag management, error checking, and pending operations

Each partition can have certain flags or activated indicators, such as boot, hidden, lba, etc.These factors influence how the system behaves at startup and in terms of visibility. In GParted, they are managed from the "Mark flags" (or "Manage flags") option in the partition's context menu.

For example, to make a partition bootable in BIOS/MBR systems, it is common to select the boot flag on the partition where the manager is located or the main system. Changing other flags without fully understanding their function can cause unwanted effects, so it's best to only touch them when specifically instructed by a guide.

Another useful tool is the option of Check partition, which attempts to detect and correct errors in the file systemIt also expands to fill the entire partition if necessary. It's a kind of "fsck with extras" that's launched from the graphical interface.

All the operations you plan in GParted (create, delete, format, resize, move, copy, etc.) They do not run immediately on the diskThey accumulate in the pending tasks list at the bottom of the window. This allows you to review what you're going to do before confirming.

If you want to undo the last planned action, you can use Edit → Undo the last operationAnd if you prefer to clear the entire queue at once, you have the option to clear all operations. Only when you click "Apply all operations" will GParted begin writing the changes to disk.

Partitioned with GParted to install Windows or Linux

A very typical situation is having a team with a single Windows partition occupying the entire diskand want to reserve space to install a GNU/Linux distribution. The opposite can also happen: an empty disk where you want to make room for Windows XP/7 or Ubuntu.

Once you have Windows installed, there's usually a small primary boot partition of a few hundred MB and a larger primary partition containing the entire system and data. In other cases, there's only a single partition. The one you're interested in resizing is the larger one, because That's where you're going to "steal" space from. for Linux.

The procedure involves right-clicking on that partition, choosing Resize/Move, reduce its size leaving at least 20 GB free marked as unallocated space and apply the operation. It's recommended to make the changes one by one and wait for the resizing to complete before continuing. This way, if something goes wrong, you'll know exactly where it happened.

With that free space, you can now create the partitions for Linux. Normally, one main ext4 partition of at least 20 GB for the root (/)Optionally, a swap partition of around 1 GB (or more, depending on RAM and needs), another ext4 partition for /home if you want to separate user data, and, if you're interested, an extra NTFS partition for sharing files between Windows and Linux.

When you launch the distro installer, the installation type screen usually gives you several options, including one like "More options" or "Manual partitioning." There you'll see the partitions that you defined in GParted. You'll just need to assign mount points, marking, for example, the large ext4 partition as the root "/". The swap partition is usually detected automatically.

Use GParted from a Live CD/USB to repair the GRUB boot

One of GParted's biggest advantages is that it's available in Many Live distributions boot directly from CD or USBThere is also an official GParted Live image designed specifically for these disk maintenance tasks. There are two ways:

Working from a Live environment allows modify partitions that would otherwise be in useFor example, you can resize the root partition of your Linux installation or modify the Windows boot partition. You can even try to fix a system that won't boot after an unfortunate partitioning change.

If, after making changes to the disk, your PC stops booting and you use GRUB as your boot manager, it is possible to restore the GRUB 2 loader following a series of steps from a Live environmentThe typical procedure involves mounting the root partition, mounting /boot if it is separate, binding /dev, /proc, /sys, changing the root with chroot, running grub-install on the device (e.g., /dev/sda) and rebooting.

On systems that still use GRUB Legacy, the method varies:

  • The grub interpreter is started. Then the command is used. find to locate stage1 (for example, (hd0,0)).
  • The device is set as root in grub and setup (hd0) is used to rewrite the bootloader to the MBR or the desired partition.

In any of these cases, having a Live system with GParted and other utilities on hand is a real lifesaver when A change in partitions breaks the system bootThis happens more often than we'd like when the system partition startup is moved.

Recovering partitions and data when everything goes wrong

Although GParted is a very robust tool, there is always the possibility that it will break. partition table or entries are lost due to human error or hardware problemsIf you find yourself in that situation, there are still cards you can play.

One of the best-known tools is TestDisk. This console application is designed for attempt to recover lost partitions by analyzing the disk for recognizable structuresIt allows you to rebuild the table and return it to a functional state in many scenarios, although there are no guarantees.

When the problem is no longer the partition but the individual files, another sister utility is Photorec, designed to recover all types of deleted or lost files (photos, documents, videos…) searching for known signatures in the free disk space. It's less refined structurally, but it can recover a lot of data.

Both tools are usually included in Live CDs designed for data recovery, which also incorporate GParted for clearly see the state of the disc before and after the recovery attemptsIt's a very powerful combo for emergencies.

Partition mounting and limitations from GParted

GParted focuses on the partitioning and low-level disk managementThis does not apply to persistent partition mounting on the system. However, you can find options to mount and unmount partitions under certain conditions in the context menu.

If you see that the mount option appears disabled (grayed out) for a specific partition, it is usually because GParted is unclear on which mounting point to attach it to, or the system doesn't allow it. In that state. In many cases, a one-off mount is best managed from the desktop file manager. Or by using the mount command with the appropriate parameters.

To automatically mount a partition in a specific location when the system starts, you need to Configure the /etc/fstab file correctly using the UUID or partition labelThis is precisely to avoid problems when device names change (for example, from /dev/sda1 to /dev/sdb1). GParted helps by seeing these identifiers, but it doesn't edit the fstab file for you.

When planning a good assembly scheme, it is essential to keep in mind that Device names may change when adding or removing disksHowever, tags and UUIDs are retained. Therefore, all modern guides recommend mounting by tag or UUID and not by /dev/sdXY.

Overall, GParted has earned its reputation by combining a fairly intuitive interface with enormous power, allowing everything from basic tasks like creating or formatting a partition to advanced maneuvers like move space between partitions, clone entire disks, or prepare complex multiboot systemsProvided it is used with care, a prior backup is made, and it is very important to remember that any mistake can render a system unusable if you don't know what you are doing.

gparted
Related article:
Creating a Partition Table in GParted: A Beginner's Guide