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?
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?
Since /dev/sda5
is first in disk order, the order of operations should be:
/dev/sda5
, so it becomes part of the unallocated space/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/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.
Backup and data in sda6, delete sda6, expand sda5, restore data from deleted sda5 to the newly expanded sda6.
Follow the steps