How to combine partitions
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
How to combine partitions
I currently have two partitions on my HDD, one has Mint 17.x and the other 18.2. I want to eliminate 17 and expand 18.2 to occupy the entire drive. I cannot seem to find a way with GParted. Can it be done?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: How to combine partitions
Can you run this command, then copy and paste the result:
or give a snapshot of the disk in Gparted
Code: Select all
sudo parted -l
Re: How to combine partitions
Model: ATA ADATA SP550 (scsi)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 69.2GB 69.2GB primary ext4 boot
2 69.2GB 120GB 50.9GB extended
6 69.2GB 116GB 46.6GB logical ext4
5 116GB 120GB 4282MB logical linux-swap(v1)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 69.2GB 69.2GB primary ext4 boot
2 69.2GB 120GB 50.9GB extended
6 69.2GB 116GB 46.6GB logical ext4
5 116GB 120GB 4282MB logical linux-swap(v1)
Re: How to combine partitions
Actually, you have 3 partitions, #1 is a Primary partition which is the boot partition.
#6 and #5 are Logical partitions that are contained within #2 which is an Extended partition.
I don't think it'll be easy to move the Extended partition, but someone with more experience may have the answer.
#6 and #5 are Logical partitions that are contained within #2 which is an Extended partition.
I don't think it'll be easy to move the Extended partition, but someone with more experience may have the answer.
bushyiii wrote:Code: Select all
Model: ATA ADATA SP550 (scsi) Disk /dev/sda: 120GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 69.2GB 69.2GB primary ext4 boot 2 69.2GB 120GB 50.9GB extended 6 69.2GB 116GB 46.6GB logical ext4 5 116GB 120GB 4282MB logical linux-swap(v1)
Re: How to combine partitions
Gparted screenshot is attached
Re: How to combine partitions
Which partition correspond to which system ?
One way to say, would be to tell us on which system you were booted when you made the gparted screenshot.
The easy situation is if LM 18.2 is on sda1 and you want to get rid of sda6.
The harder one is if LM 18.2 is on sda6 and you want to get rid of sda1.
In all cases, backup your data beforehand.
Easy case:
- boot on a live USB and open gparted
- select sda6 Partition > delete > apply
you have deleted LM 17. We are now going to grow sda1 and relocate the swap on a primary partition
- select sda5 Partition > swapoff > apply , then Partition > delete > apply
- select sda1 Partition > Resize/Move, grow it as you wish, just leave 4097MiB free fro swap, Apply
- select the remaining free space, Partition > New , create as primary partition, file system: linux-swap, make it 4096MiB (=4GB), Apply
- select the swap partition you just created. Partition > Information, see the field "UUID" it's a sequence of 36 characters, copy it somewhere (e.g. by selecting it and click-pasting it in a text editor)
- quit gparted, open the file manager, mount sda1 which should be visible as a device in the left column
- open the folder "etc" as root, open the file "fstab" with a text editor (still as root), find the line looking like this:
and correct the uuid by putting the new value found two steps above
- save, close the text editor, close the root window of the file manager, unmount sda1, shutdown, unplug the live USB
- boot to LM 18.2 and update grub
- you're done
Harder case:
as JerryF, I dont know if it's easy to move and resize an extended partition. Also I'm not sure if deleting sda1 is a good move, since it's the partition which has the boot flag and thus probably all the bootloading code. Deleting it directly runs the risk of making the system not booting anymore.
So I would wait for someone with more experience
One way to say, would be to tell us on which system you were booted when you made the gparted screenshot.
The easy situation is if LM 18.2 is on sda1 and you want to get rid of sda6.
The harder one is if LM 18.2 is on sda6 and you want to get rid of sda1.
In all cases, backup your data beforehand.
Easy case:
- boot on a live USB and open gparted
- select sda6 Partition > delete > apply
you have deleted LM 17. We are now going to grow sda1 and relocate the swap on a primary partition
- select sda5 Partition > swapoff > apply , then Partition > delete > apply
- select sda1 Partition > Resize/Move, grow it as you wish, just leave 4097MiB free fro swap, Apply
- select the remaining free space, Partition > New , create as primary partition, file system: linux-swap, make it 4096MiB (=4GB), Apply
- select the swap partition you just created. Partition > Information, see the field "UUID" it's a sequence of 36 characters, copy it somewhere (e.g. by selecting it and click-pasting it in a text editor)
- quit gparted, open the file manager, mount sda1 which should be visible as a device in the left column
- open the folder "etc" as root, open the file "fstab" with a text editor (still as root), find the line looking like this:
Code: Select all
# Swap
UUID=blabla none swap defaults 0 0
- save, close the text editor, close the root window of the file manager, unmount sda1, shutdown, unplug the live USB
- boot to LM 18.2 and update grub
Code: Select all
sudo update-grub
Harder case:
as JerryF, I dont know if it's easy to move and resize an extended partition. Also I'm not sure if deleting sda1 is a good move, since it's the partition which has the boot flag and thus probably all the bootloading code. Deleting it directly runs the risk of making the system not booting anymore.
So I would wait for someone with more experience
Re: How to combine partitions
Join the 'Four Partitions or Fewer' queue. When it starts, the gdisk command will assume you want GPT and convert that drive to GPT. That will discard the 'extended' status and make them all real. Still in gdisk, convert the drive back to MBR and write the changes. You'll end up with three 'real' partitions and gparted can handle that.