0

I have two ext4 partitions:

  • /dev/sda6 is the one on which I have my Ubuntu right now,
  • /dev/sda5 is a recently created empty ext4 partition.

How to merge them so the data will not be lost?

screenshot

1
  • Do you mean to combine them without moving or copying files, or just delete one & enlarge the other?
    – Xen2050
    Commented Nov 17, 2018 at 13:37

3 Answers 3

1

Since /dev/sda5 is first in disk order, the order of operations should be:

  1. Delete /dev/sda5, so it becomes part of the unallocated space
  2. Move /dev/sda6 so its starting point is as much up as possible, which is where /dev/sda5 used to be, so that the unallocated space now follows it
  3. Resize /dev/sda6 to the maximum possible so it now includes the whole of the unallocated space.

I suggest first to take a backup image of the whole disk, because even the smallest mistake may destroy it.

One tool you may use is gparted. Boot its Live CD/USB for these operations.

0

Backup and data in sda6, delete sda6, expand sda5, restore data from deleted sda5 to the newly expanded sda6.

0

Follow the steps

  • go to disks
  • unmount your sda5 partition
  • click the gear icon (additional partition options)
  • click resize and drag the bar till Minimal size and select resize
  • now unallocated space is created
  • go to gparted and right click sda6 and select resize/move
  • drag the bar to the maximum of unallocated space, click resize, ok
  • its done, now accept the changes by clicking the green tick mark.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .