3

I've seen posts in the past that advise against changing the partition number but like Fox Mulder: " All the evidence to the contrary is not entirely dissuasive "

I have an old MBR disk that I used to boot from before I install Ubuntu on a faster M.2 ssd. I now want to remove my old Win8 partitions and give the space back to Linux

fdisk /dev/sda Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x3457a860 Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 524290047 524288000 250G 7 HPFS/NTFS/exFAT /dev/sda2 524290048 548290559 24000512 11.5G 82 Linux swap / Solaris /dev/sda3 548292606 648290303 99997698 47.7G 5 Extended /dev/sda4 648290304 3907028991 3258738688 1.5T 83 Linux /dev/sda5 548292608 648290303 99997696 47.7G 83 Linux 

The only partition that I use is sda4.
sda1 was my old Win8 dual boot partition
sda2 was for swap but now I'm running on a separate ssd
sda5 was for /boot before my current ssd

Is is possible to delete sda1, sda2 and sda5 and perform something like e2fsresize to grow my ext4 filesystem into the extra space and then rename sda4 to sda1?

I rather not resort to buying a new 2TB drive just so I can backup my files and repartition the whole disk.

1
  • If there's a way to do what you want (I don't know a way, and lean towards it not being possible) it's uncommon enough that the chance of something being sufficient dangerous to cause data loss is high, so you really should backup your data before trying it. Commented May 12, 2016 at 15:23

1 Answer 1

3

You can do all this with GParted. The 1.5TB partition you want to keep and extend is inside an extended partition (which makes it a logical partition), so using standard tools you won't be able to turn it into sda1 — the "container" extended partition will end up being sda1 and your useful partition will be sda2. (You can turn a logical partition into a primary partition manually, but that's a little more dangerous.)

To extend your partition to use all the available disk space, you'll need to delete the three obsolete partitions, then extend the extended partition, move it, and finally move and extend the logical partition. This should all be possible with GParted.

As always though, if your data is important you should have a backup.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.