How Do I Merge Two Partitions in Linux

Are you looking to merge two partitions in your Linux system? Maybe you want to combine the available space from two separate partitions into one larger partition, or you simply want to reorganize your disk space. Whatever the reason, merging partitions in Linux can be a useful and efficient way to manage your storage resources. In this article, we will walk you through the process of merging two partitions in Linux, step-by-step.

Step 1: Backup Your Data

Before you begin the process of merging partitions, it is crucial to back up all your important data. While merging partitions can be done without losing data, there is always a risk of data loss or corruption during the process. It’s better to be safe than sorry, so take the time to back up your data to an external storage device or cloud service before proceeding.

Step 2: Identify the Partitions to Merge

Next, you need to identify the partitions you want to merge. Use the lsblk or fdisk -l command to list all the available partitions on your system. Take note of the names and sizes of the partitions you want to merge, as you will need this information for the following steps.

Step 3: Unmount the Partitions

Before you can merge the partitions, you must ensure that they are unmounted. Use the umount command to unmount the partitions. For example, if you want to merge partitions /dev/sdb1 and /dev/sdb2, you would use the following commands to unmount them:

umount /dev/sdb1
umount /dev/sdb2
How Do I Merge Two Partitions in Linux


How Do I Merge Two Partitions in Linux


Step 4: Delete One of the Partitions

Once the partitions are unmounted, you will need to delete one of the partitions in order to free up its space. Use the fdisk or gdisk command to delete the partition you no longer need. For example, if you want to delete partition /dev/sdb2, you would use the following command:

fdisk /dev/sdb
Command (m for help): d
Partition number (1-4): 2

Be extremely careful when using the fdisk or gdisk command, as deleting the wrong partition can result in permanent data loss. Double-check the partition information before proceeding.

Step 5: Resize the Remaining Partition

With one of the partitions deleted, you can now resize the remaining partition to occupy the freed-up space. Use the resize2fs command to resize the filesystem on the remaining partition. For example, if you want to resize /dev/sdb1, you would use the following command:

resize2fs /dev/sdb1

Step 6: Verify the Merged Partition

Once you have completed the previous steps, it’s essential to verify that the partitions have been successfully merged. Use the lsblk or df -h command to check the status of the merged partition and ensure that it is now using the combined space of the original partitions.

Step 7: Remount the Merged Partition

Finally, remount the merged partition to make it accessible for use. Use the mount command to mount the merged partition to a desired mount point on your system. For example, if you have merged /dev/sdb1 and /dev/sdb2 into a new partition /dev/sdb1, you would use the following command to mount it:

mount /dev/sdb1 /mnt/merged_partition

That’s it! You have successfully merged two partitions in your Linux system. By following these steps, you can efficiently manage your disk space and optimize your storage resources to better suit your needs.


Merging partitions in Linux can be a valuable skill for system administrators and regular users alike. By carefully following the steps outlined in this guide, you can merge partitions safely and effectively, without the need for complex third-party tools or software. Remember to always back up your data before making any changes to your disk partitions, and exercise caution when using commands that modify disk partitions to avoid accidental data loss.

About Mohammad Ibrahim

Editor - An aspiring Web Entrepreneur and avid Tech Geek. He loves to cover topics related to iOS, Tech News, and the latest tricks and tips floating over the Internet.