0

I need to tell details about my disk first: I bought SSD drive (223 Gb) a while ago and decide install on it Windows 10 and Ubuntu 16.04, I have split drive 450 Mb + 100 Mb + 173 Gb for Windows 10 and 530 Mb + 400 Mb + 49 Gb for Ubuntu. Disk use GPT, by the way and my motherboard support UEFI.

Recently I get limit on my Windows drive, I have issues with free space, I decided to bought another SSD for Ubuntu and move everything here and Windows extend partition to all remaining space.

Now, I have moved all my data from Ubuntu drives to HDD and starting to remove partitions and here where I stuck.

I removed already two partitions from a disk and only remain is 530 Mb swap partition, I'm now working from Windows and can't remove this last partition to be able to extend Windows partition. And tools like diskpart can't see or remove this partition. This is how it look from Windows:

disk info

At this moment I don't have new SSD and only have Windows 10, I still can use something like Ubuntu LiveCD, because as I think I can only remove this partition from Linux.

So, I need help either with:

  1. commands to remove this partition form Windows (diskpart can't see this volume)
  2. some tool for USB flash to remove it here
  3. commands to remove it from LiveCD (I'm not familiar with formatting tools in Linux)

1 Answer 1

1

If you have a live-CD (or USB stick) with Linux, you can use fdisk.

Find your disk:

Log in as root or do sudo -s and then:

for d in /dev/sd? ; do sudo fdisk -l $d; done

This will list all the partitions on all the disks Linux sees. The format will be a bit different, but you will see something like:

/dev/sda1        2048    1050623    1048576  512M EFI System
/dev/sda2     1050624 1888487423 1887436800  900G Linux filesystem
/dev/sda3  1888487424 1953525134   65037711   31G Linux swap

As root again, type fdisk /dev/sda (use the letter from your own output). Type m to see the possible actions. type p to print the partitions, and then type d to remove the partition. fdiskwill ask which partition; that is the number behind the sda, so in my scheme, it would be partition 3 for the swap.

Now, to complicate things a bit, it might be that there are secondary partitions used. In that case you might need to remove the container for the secondary partitions as well, but not if your Windows is also a secondary partition. If this sounds too complicated, add the output of the p command of fdisk to your question; we'll have a look at it.

Do again a p in fdisk to see that the partition table is as you want it. Especially: make sure the Windows partitions are still there.

Write the new partition table with w in fdisk and all should be ok.

1
  • Today got time to experiment with this and it work. Now I have extended C drive. Thanks.
    – XCanG
    Commented Jun 19, 2020 at 18:45

You must log in to answer this question.

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