My setup

Dell Chromebook 13 with Windows 10 and Ubuntu 18.10 on dual boot, using MrChromebox UEFI Firmware (4.9).

What happened

I wanted to install Ubuntu on an external usb drive. I took two drives, installed the live version of ubuntu 18.10 on the first, booted into it, and then used the installer to install ubuntu on the second usb.

When the installation finished, I removed the drive and rebooted. After removing both USB sticks I tried to boot into my primary Ubuntu installation (that of my laptops internal hard drive) but now the laptop boots into GRUB 2.2 (with “Minimal BASH-like editing supported”) rather than into Ubuntu.

I can still boot into Windows by selecting it in the boot manager but if I do nothing the computer goes into GRUB.

What I tried

1) I tried boot repair but the problem persists. This is the output of the repair process.

2) parted

sudo parted /dev/sda unit s print
Model: ATA ADATA SP600NS34 (scsi)
Disk /dev/sda: 500118192s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start     End        Size       File system  Name                          Flags
 1      2048s     1023999s   1021952s   ntfs         Basic data partition          hidden, diag
 2      1024000s  1228799s   204800s    fat32        EFI system partition          boot, esp
 3      1228800s  1261567s   32768s                  Microsoft reserved partition  msftres
 4      1261568s  89327144s  88065577s  ntfs         Basic data partition          msftdata

Parted could not see the partition with my ubuntu installation so I tried to rescue starting from +1 sector after the fourth partition but to no result:

sudo parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) rescue                                                           
Start? 89327145
End? 500118191                                                            

3) testdisk: first level analysis could not find any partition, so I did the deeper search. Here is the result

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>

Disk /dev/sda - 256 GB / 238 GiB - CHS 31130 255 63

The harddisk (256 GB / 238 GiB) seems too small! (< 12 TB / 11 TiB)
Check the harddisk size: HD jumpers settings, BIOS detection...

The following partitions can't be recovered:
   Partition               Start        End    Size in sectors
  Linux Swap              89606136 25289942743 25200336608
   MS Data                257078856  656388551  399309696
   MS Data                257079752  656389447  399309696
   MS Data                257082240  656391935  399309696
   MS Data                257082400  656392095  399309696
   MS Data                257083096  656392791  399309696
   MS Data                257084352  656394047  399309696
   MS Data                257085056  656394751  399309696
   MS Data                257086456  656396151  399309696
   MS Data                257086592  656396287  399309696

[ Continue ]
SWAP2 version 2674814663, pagesize=8192, 12 TB / 11 TiB

In the following screen I get a list of partitions (or at least I think they are). I checked some of them with P, which allows me to see the files contained in each. I think I identified my root partition

 D MS Data                     2048    1023999    1021952
 D MS Data                  1023999    2045950    1021952
 D MS Data                  1024000    1228799     204800 [NO NAME]
 D MS Data                  1024006    1228805     204800 [NO NAME]
 D MS Data                  1261568   89327144   88065577
 D MS Data                  6173667    6179840       6174
 D MS Data                  6179840    6186013       6174 [Boot]
 D MS Data                  6179859    6186032       6174
 D MS Data                  6186032    6192205       6174 [Boot]
 D MS Data                  6186051    6192224       6174
 D MS Data                  6192224    6198397       6174 [Boot]
 D MS Data                  6192243    6198416       6174
 D MS Data                  6198416    6204589       6174 [Boot]
 D MS Data                  6204624    6207503       2880 [EFISECTOR]
 D MS Data                  6207504    6210383       2880 [EFISECTOR]
 D MS Data                 17739774  417049469  399309696
 D MS Data                 17739776  417049471  399309696
 D MS Data                 22864947   22871120       6174
 D MS Data                 22871120   22877293       6174 [Boot]
 D MS Data                 78493568   78496447       2880 [EFISECTOR]
 D MS Data                 81325576   81328455       2880 [EFISECTOR]
 D MS Data                 81328456   81331335       2880 [EFISECTOR]
 D MS Data                 86914272   86917151       2880 [EFISECTOR]
 D MS Data                 89327144  177392720   88065577
 D MS Data                 89327614  500117501  410789888
 D MS Data                 89327616  500117503  410789888    // this is where my root folder is
 D Linux Swap              89606144   93800431    4194288
 D MS Data                154662036  154666963       4928 [NO NAME]
 D MS Data                222556160  305313791   82757632
 D MS Data                237681520  237684399       2880 [EFISECTOR]
 D MS Data                299342267  299345146       2880 [NO NAME]
 D MS Data                305313791  388071422   82757632
 D MS Data                316486379  316489258       2880 [NO NAME]
 D MS Data                316486403  316489282       2880 [NO NAME]
 D MS Data                332211579  332214458       2880 [NO NAME]
 D MS Data                395771312  395774191       2880 [EFISECTOR]
 D MS Data                395774192  395777071       2880 [EFISECTOR]
 D MS Data                417052670  500117501   83064832
 D MS Data                417052672  500117503   83064832
 D MS Data                468003251  468006130       2880 [NO NAME]
 D MS Data                468004147  468007026       2880 [NO NAME]
 D MS Data                471783563  471786442       2880 [NO NAME]

Here is the full log (note that I ran the deep search twice).

Should I just try to change that partition characteristics from D=deleted to P=primary?

Are there any other partitions I should recover? When I try to visualize file in many of them (like the preceding one) I only get this message: Can't open filesystem. Filesystem seems damaged.

Or should I just give up and reinstall everything or is there still some hope?

  • What shows up when you browse that USB on a Linux system? Does it look like a fully installed system is present. Where did you put GRUB on the main disk or the USB? More details about the choices you made while installing would be good. Feb 19 '19 at 14:59
  • I choose the 'other' option and decided myself how to set up the partitions. I actually followed the instructions by this guide: linuxhint.com/run-ubuntu-18-04-from-usb-stick Basically I canceled everything on the usb drive (sdX), created a first partition of 512 MB as EFI system parititon (sdX1) and the rest of the space as root partition (sdX2). Finally as "device for boot loader installation" I chose the external drive (sdX).
    – Fede9390
    Feb 19 '19 at 22:12
  • Btw I cannot boot into that drive (sdX), so something probably went wrong during installation but as I said I care more about restoring my laptop back to normal than making that external drive work.
    – Fede9390
    Feb 19 '19 at 22:44
  • The way you said you installed it should not have effected the main system. So if none of the USB drives are plugged in then it should just boot normally. Feb 19 '19 at 23:12

From your description, it seems likely that you managed to install Ubuntu on your external USB disk just fine, but GRUB, Ubuntu's bootloader, got installed into sda2, your EFI System Partition. And if you're trying to boot with the external USB disconnected, GRUB is getting confused as its configuration and/or some of its modules are located in the (now-unreachable) external USB.

You might not have created an EFI System Partition (ESP for short) on the external USB, so the ESP in sda2 was the only valid location for installing an UEFI bootloader.

Since your Windows is not overwritten and you stated your goal was to install Ubuntu on the external USB, I'd assume that your Ubuntu installation ended up there just as you ordered, except for the bootloader. To find out if that's true, you might boot from the live USB drive again, and then examine the contents of the other USB drive. If there is enough space for it, your goal might be to create another ESP on the Ubuntu installation target USB, and install the Ubuntu bootloader there.

Your secondary goal would be to fix the Windows boot. That's easy: you'll just need to move "Windows Boot Manager" to be the first item in the boot order. In Ubuntu, you can do it with the efibootmgr command. In Windows, you could do the same by opening Command Prompt as an administrator and using the bcdedit command exactly like this:

Bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst

If you want, you could also mount the sda2 partition and remove the accidentally-installed Ubuntu GRUB bootloader from there, simply by deleting the <mount point>/EFI/ubuntu/ directory with all its contents. But that is not essential.

  • I do not care so much about fixing my USB drive, rather I want to be able to boot into my Ubuntu on my laptop's hard drive. At the momento, when I boot into my computer, instead of initializing Ubuntu I get.the GRUB 2 prompt. Sorry if have not clarified it well in the question.
    – Fede9390
    Feb 19 '19 at 17:56
  • So you already had a working dual-boot installation when you started the "install from a Live USB to the other USB" exercise? Then I'm sorry, I misunderstood. Then, since the parameters of your assumed root partition don't seem to overlap with the Windows partitions, I guess it would be safe enough to try that. Anyway, as Michael Prokopec said: more information about the choices you made when running the Ubuntu installer would be good.
    – telcoM
    Feb 19 '19 at 18:13

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.