2

enter image description here

I Want to merge my /sda1 and /dev/sda6. I have Ubuntu in both /sda1 and /dev/sda6. But just now I have formatted /dev/sda1, now I want to merge it with /dev/sda6 (it has Ubuntu).

Please suggest me step wise using gparted.

Ravexina
  • 57,256
sam
  • 71
  • 1
  • 5

1 Answers1

4

There are at least three problems with your question:

  • You cannot directly merge two partitions using common Linux tools. You can expand a partition into adjacent unpartitioned space, but merging partitions (which implies saving the contents of both partitions) is not supported by any Linux tools of which I am aware.
  • Your /dev/sda1 and /dev/sda6 are not adjacent to one another -- two other partitions exist in-between them. Also, /dev/sda1 is a primary partition and /dev/sda6 is a logical partition. Thus, even if you found some obscure tool to merge two partitions, it would be useless in this context, because a partition must be a continuous set of sectors, like sectors A to D, not A to B and C to D, with other partitions occupying sectors B to C.
  • Your /dev/sda1 is NTFS and /dev/sda6 is ext4fs. Thus, even if you found a tool to merge two partitions, and if they were adjacent to one another, you couldn't do it because they're different filesystem types.

All that said, I suspect that your /dev/sda1 is empty, and you simply want to expand the size of /dev/sda6, using the space of /dev/sda1. That task can be done, but it requires some intermediate tasks:

  1. Delete /dev/sda1.
  2. Move /dev/sda2 to the left. This will have the effect of moving the free space now occupied by /dev/sda1 to the right of /dev/sda2.
  3. Move /dev/sda3 to the left. Again, this has the effect of moving the free space to the right of /dev/sda3.
  4. Resize the extended partition, /dev/sda4, so that its start point is as far to the left as possible. It should now encompass the free space. (Note that an extended partition is a sort of placeholder that itself contains logical partitions. Thus, although the free space is within the extended partition, it's still available to logical partitions and so remains free, in some sense.)
  5. Resize /dev/sda6 to the left, so that it now consumes the free space.

This procedure carries some significant caveats:

  • You'll need to perform the last two of those operations from an emergency boot (like an Ubuntu installer in "try before installing" mode).
  • The partition-move operations and resizing the Ubuntu partition to the left are likely to be time-consuming. Precisely how time-consuming depends on the speed of your disk -- maybe just a few minutes, but maybe over an hour for each of them.
  • The partition-move and resizing operations carry some risk of damage to your partitions. Note that "damage to your partitions" could mean loss of important files. Thus, it's imperative that you back up anything important on these partitions before you begin.
  • This operation might render OS(es) on the partition(s) unbootable. Thus, you should be prepared to run Boot Repair to fix Ubuntu. Windows repair is likely to require running specialized Windows tools, and is beyond my expertise. Repairing Windows is beyond the scope of this forum, too. You may want to research this topic before beginning, and ask for help on a Windows forum if you need it.
  • DO NOT try to operate on this disk using the standard Windows tools. Although it might do a better job of keeping Windows bootable, the standard Windows partitioning tools are known to wreak havoc when dealing with disks, like yours, that have extended and logical partitions.

As an alternative to this procedure, you might consider using your existing /dev/sda1 more-or-less as-is. This question and answer, for instance, describe how to add a partition as a separate /home partition. You'd need to create a fresh ext4fs (or other Linux native) filesystem on the partition, but this approach bypasses all of the preceding caveats. OTOH, your current Ubuntu root (/) partition is tiny (16.28 GiB), so unless you want to increase its size for more user storage space, you might not free up enough space by using /dev/sda1 as /home. Maybe moving /var or something else to the new partition would work better, but that creates its own inflexibility. Moving the entire installation to /dev/sda1, which is 53.61 GiB, might be a better approach. See here for some discussions on this approach.

Rod Smith
  • 45,120
  • 7
  • 66
  • 108