0

I am want to uninstall ubuntu(16.04), from my dual boot system and probably reinstall ubuntu or install kali(dual boot it with windows). I want to allocate more space to the already existing windows. I have 10 partitions and I want to figure out if any of these partitions can be freed(not necessary for windows) so that I can increase the disk space allocated to windows as well as allocate more storage to Kali.enter image description here

3
  • Welcome to Ask Ubuntu! Please don't post images of text. Instead, paste the text directly into your question and use the formatting tools to format it as code.
    – terdon
    Jul 9, 2019 at 17:09
  • Also, what is the 'Microsoft basic data' partition? You have 4 "Basic data partitions", are those the ones you mean? One of them will be your C:/ drive, but we can't tell which from this output. The other two will probably be your data partitions but, again, that depends on what you have stored on them.
    – terdon
    Jul 9, 2019 at 17:12
  • Yeah I am talking about the 4 basic data partitions. Are there any commands which would be helpful in determining which data partition has what so as to get a clear idea of whether any partition can be freed? Jul 9, 2019 at 17:43

2 Answers 2

2

If you remove partitions /dev/sda9 and /dev/sda10 (swap and Ubuntu), which you might want to do to remove Ubuntu, then you won't be able to just boot into Windows any more because GRUB (the bootloader which should be installed in /dev/sda10) will be gone. If you then re-install Ubuntu, or another Linux, you'll be fine. You'll also be fine (be able to boot into Windows) if you delete /dev/sda9 but leave /dev/sda10 alone.

Currently, in Windows, (C: is probably /dev/sda5) you probably have a D: and E: drives, and that would account for the extra partitions /dev/sda6 and /dev/sda7. You'll have to see what files are there, if you have external backups, and if you still need/want those drives in Windows.

You shouldn't touch the other partitions.

10
  • Why would deleting the swap partition make any difference to Windows?
    – terdon
    Jul 9, 2019 at 18:38
  • @terdon deleting swap wouldn't make any difference to Windows, but that's not what I said. I only mention swap and Ubuntu partitions so that if OP decides to go with Kali, and then deletes swap and Ubuntu, they won't be able to boot any more.
    – heynnema
    Jul 9, 2019 at 18:41
  • 1
    Deleting swap would not, but grub menu is in ext4 partition. Since UEFI, you still should be able to directly boot Windows from UEFI boot menu and should make that first or default in UEFI before removing ext4 partition and grub boot menu.
    – oldfred
    Jul 9, 2019 at 18:41
  • @oldfred if Windows bcdedit showed the boot path as \EFI\ubuntu\shimx64.efi then it probably still won't boot Windows.
    – heynnema
    Jul 9, 2019 at 18:44
  • just a tiny doubt, output of the command fdisk -l and sudo parted would be the same right? I mean in terms to the referencing sda number?I ask this because the size column shows different values. Jul 9, 2019 at 18:44
0

First, you need to figure out what each partition contains. We are only interested in partitions 5, 6 and 7 since 1 is the EFI system partition, 2,3 and 4 are some sort of diagnostic tool for Windows or your laptop or something like that. Not safe to delete in any case and not relevant since they're tiny. Partition 9 in your swap for Ubuntu, 10 is your Ubuntu's root (/) partition (where your Ubuntu is installed) and 8 is Windows' recovery partition. So let's see what the rest are.

First of all, you will need to mount them. Open a terminal and run these commands:

  1. Make the mountpoints. This will create directories sda5, sda6 and sda7.

    mkdir sda{5,6,7} 
    
  2. Mount each partition onto its corresponding directory

    for d in sda{5,6,7}; do
        sudo mount -t ntfs /dev/"$d" $d"
    done
    
  3. Now, check the contents of each of them to figure out what they are and which ones you can delete. Just run ls:

    ls sda5
    ls sda6
    ls sda7
    

Once you know what's what, you can choose to delete and/or resize as desired.

19
  • Why not just boot into Windows and see what the NTFS partitions show? sda6/7 are probably drives D: and E:
    – heynnema
    Jul 9, 2019 at 18:48
  • @heynnema dunno, because that's what the OP asked for. Presumably because if you've booted into Windows you won't be able to delete the mounted partitions.
    – terdon
    Jul 9, 2019 at 18:50
  • So basically I want to replace the already installed ubuntu with Kali. So in order to do a dual boot and install it in the right partition I wanted to clearly understand what each partition contains. What @terdon says is logical. I'll mount and check. But does sudo parted give any clear indication as to which partition I should boot kali into to replace ubuntu? Jul 9, 2019 at 18:56
  • @Randomuser if you're going to REPLACE Ubuntu with Kali, ultimately you'll need to remove sda9/10... but at that point, Windows won't boot until you install Kali and re-setup dual booting.
    – heynnema
    Jul 9, 2019 at 18:58
  • @Randomuser if you just want to replace, don't delete anything at all. Just choose those partitions when installing Kali and tell the installer to format them. However, if you don't know this sort of basic commands like mount, do not under any circumstances install Kali! Kali is a tool for experts and many things are much harder there. If you just want to play around with security tools, just install the Kali tools on Ubuntu.
    – terdon
    Jul 9, 2019 at 19:02

You must log in to answer this question.

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