1

I was using Windows 10 and Ubuntu 18.04 dual boot. And yesterday I was trying to create more space in Ubuntu partition. So, I tried to shrink space from the Windows partition using Windows disk management tool. But, it allowed me to shrink only 8 GB, and I needed more space (30GB). So, I used AOMEI partition assistant to shrink it. It went on a preOS mode and then after booting to Windows again I saw that it the required created 30GB space but formatted my Ubuntu partition too.

And after that, I was unable to boot into Windows also. I get

boot device not found

I would appreciate any help since I have no clue what to do and I don't want to lose my data from Windows.

I am currently using Ubuntu from a bootable flash drive. And running sudo fdisk -l gives the following output:

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: CC7B896F-703B-441A-B358-34F3401BA61F

Device          Start        End    Sectors   Size Type
/dev/sda1        2048     821246     819199   400M Windows recovery environment
/dev/sda2      821248    1353727     532480   260M EFI System
/dev/sda3     1353728    1615871     262144   128M Microsoft reserved
/dev/sda4     1615872 1749703408 1748087537 833.6G Microsoft basic data
/dev/sda5  1758339224 1766727831    8388608     4G Microsoft basic data
/dev/sda6  1768774856 1777163463    8388608     4G Microsoft basic data
/dev/sda7  1828229120 1879709695   51480576  24.6G Microsoft basic data
/dev/sda8  1879709696 1881571326    1861631   909M Windows recovery environment
/dev/sda9  1881581000 1953521069   71940070  34.3G Microsoft basic data


Disk /dev/sdb: 7.5 GiB, 8036285952 bytes, 15695871 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: 0x0199340a

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1  *     2048 15695870 15693823  7.5G  c W95 FAT32 (LBA)

I am ready to provide additional data if required.

Please take a look at this screenshot of gParted on my PC. There is no linux-swap partition. I guess this happened after the shrinking process by the AOMEI partition assistant processed.

gparted screenshot

I am able to boot to Windows and Ubuntu through the rEFInd rescue USB disk.

Edit
Oops, I found a silly mistake of mine. After shrinking through AOMEI I foolishly converted my EFI system partition from FAT32 to NTFS (using AOMEI). I converted it back again. And now I am able to boot to Windows normally, but not able to boot to Ubuntu, not even using the rEFInd rescue disk. Now, that's probably because of corruption in my linux-swap partition, but I am not sure.

Should I expect any help?

1
  • Like what I said to a poster earlier, insert Ubuntu usb, reinstall Ubuntu, select your partitioning correctly during the install. Unless you know what you're doing don't mess with the partitions or you'll be on here again.
    – user857648
    Oct 6 '18 at 17:56
1

Can you open Nautilus? If so, can you see the Windows 10 drives on the "Other Locations" tab? If you can see those drives, be sure to backup all your important data from those drives before you try something risky.

Also, if you have a Windows 10 boot disk, try the 'Repair' option and see if that helps.

VERY UNLIKELY, but make sure you are booting Windows 10 and NOT Ubuntu. You might be trying to boot Ubuntu and be met with 'Boot Device Not Found' as the Ubuntu partition is formatted.

3
  • Yes I can open Nautilus and access my files both from Windows and Ubuntu. But the sad thing is I don't have any external hard drive to back up my data.
    – kush-mish
    Oct 7 '18 at 5:26
  • And how can I make sure that I am booting to windows or not? I'm sorry, I have very less knowledge. So I appreciate your help a lot.
    – kush-mish
    Oct 7 '18 at 5:28
  • Just make sure you manually select Windows 10 during boot from the boot menu that's all.
    – de_tail
    Oct 8 '18 at 13:37
0

You can try making a refind rescue disk and using it to boot into Windows and then using start up repair from Windows to fix the problems.

  • Create a refind rescue usb using refind iso downloaded from this page.
  • Download the cd image and burn it to a usb using rufus on another PC which is running Windows.
  • Boot using the usb you just created. You will get a screen similar to this with Windows as the first option. Other options will be of mmx64.efi and grubx64.efi from the Ubuntu folder in the EFI System partition. Both having an Ubuntu icon. A UEFI-shell is also given in the options.
  • Select Windows and hit enter. Windows should boot.

Once you get Windows booted and running good follow the following steps:

  • Run cmd as administrator.
  • Type the following commands:

    cd s:
    cd EFI\
    dir          
    

This will display the contents of EFI folder in your EFI System partition. Delete the ubuntu folder from here and also set Windows boot manager to boot Windows itself. To do so type following commands:

rmdir /S ubuntu

press y to confirm deleting the ubuntu folder.

  • Now type bcdedit /set "{bootmgr}" path \EFI\Microsoft\Boot\bootmgfw.efi
  • This will set Windows Boot Manager back to its default value if it was changed. Now run startup repair to ensure everything is correct.
  • Remove the refind USB from your PC.
  • Open Settings. Go to Security and Updates > Recovery
  • Click on restart below advanced startup.
  • Once in the advanced start up options, go to Advanced options and select start-up repair. This should repair any boot issues you are having and you should be able to boot Windows normally after this.

In case you are not able to boot Windows using refind usb disk, ONLY AND ONLY THEN try the following steps.

In case you cannot boot windows using the refind usb drive, Then go to the efi shell using the refind usb drive and press esc when the shell starts to skip and startup script. Then, type bcfg boot dump to display all the efi entries in your firmware. Look at the entries and note their numbers. Delete any Ubuntu related entry from here by typing bcfg boot rm XX.

Type the entry number of the entry in place of XX . DO NOT delete the default entries of booting from usb or cd drives.

Type bcfg boot dump to view the value again and type exit to exit the shell.

Shut down the pc from refind menu and then remove the refind USB from your PC.

Start the PC again to check. The problem should be fixed now.

It takes a lot of time to write answers, so please let me know if you were helped or not. Let me know even if it didn't work. It will help me know whether I went wrong.

4
  • Why do I need to delete Ubuntu folder? Will I be able to boot again to Ubuntu later without reinstalling it? Also, can the rEFInd be burned only in windows and not on Ubuntu (running on bootable flash drive)?
    – kush-mish
    Oct 7 '18 at 5:49
  • I am able to log into Windows and Ubuntu both. But on entering the cd s: I was getting the output as cd s: the system cannot find the drive specified.
    – kush-mish
    Oct 7 '18 at 12:32
  • @The_Loud.Speaker please take a look at Edit part also.
    – kush-mish
    Oct 7 '18 at 12:45
  • @kush-mish I saw the edit, I will soon edit my answer. Sorry for delay, I had exams last 2 weeks Oct 17 '18 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.