0

I have a Dell Chromebook 13 on which I installed Windows 10 and Ubuntu 18.10 on dual boot, using Mr Chromebox UEFI Firmware (4.9).

I wanted to install Ubuntu on a new usb drive, so 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. Whe the installation finished, I removed the drive and rebooted – just to find out that 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. I tried to solve it with boot repair as shown in following [this guide][1] but the problem persists. This is the output of the repair process.

Also if I type ls in GRUB, I get

(hd0) (hd0,gpt4) (hd0,gpt2) (hd0,gpt2) (hd0,gpt1)

EDIT (2019-02-17)

I just boot into Ubuntu live-usb to check on which partition I have Ubuntu installed. This is a screenshot of Gparted Does it mean I wiped my Ubuntu partiiton somehow?

This is the output of sudo gdisk -l /dev/sda

GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 500118192 sectors, 238.5 GiB
Model: ADATA SP600NS34 
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 6D115618-F5A2-A34B-AD91-2692BBC3AFCA
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 410793028 sectors (195.9 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1023999   499.0 MiB   2700  Basic data partition
   2         1024000         1228799   100.0 MiB   EF00  EFI system partition
   3         1228800         1261567   16.0 MiB    0C01  Microsoft reserved ...
   4         1261568        89327144   42.0 GiB    0700  Basic data partition

EDIT 2 (2019-02-18)

Following the advice from @oldfred I tried both parted and testdisk

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                                                            
(parted)

Then I tried testdisk. The 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>
http://www.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]

Should I just try to change that partition characteristics from D=deleted to P=primary? Here is the full log (note that I ran the deep search twice). 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?

Fede9390
  • 113
  • 1
    Did you install in UEFI or BIOS boot mode to external drive? How you boot install media is then how it installs. http://askubuntu.com/questions/743095/how-to-prepare-a-disk-on-an-efi-based-pc-for-ubuntu Ubuntu's grub only installs to first drive usually sda. But UEFI only boots from external drive's ESP using /EFI/Boot/bootx64.efi, so grub either has to be reinstalled or manually reconfigured. Please copy & paste link to the Boot-info summary report ( do not post report), the auto fix sometimes can create more issues. https://help.ubuntu.com/community/Boot-Repair – oldfred Feb 17 '19 at 17:14
  • Sorry but I can't answer your question, I don't know. Here is the ling to the report: http://paste.ubuntu.com/p/r48kt6Sprd/ – Fede9390 Feb 17 '19 at 17:21
  • 1
    You are showing Windows is hibernated and no Linux partition, but some unused sectors on drive. First turn off hibernation. http://askubuntu.com/questions/843153/ubuntu-16-showing-windows-10-partitions Lets see if gpt backup partition will show missing partitions sudo gdisk -l /dev/sda. You show no second external drive only sdb, which is live installer. – oldfred Feb 17 '19 at 18:43
  • Could you please check the edit I just made? Gparted from live-usb shows my ubuntu partition as unallocated space.. I am starting to get a bit nervous. – Fede9390 Feb 17 '19 at 18:49
  • Does then testdisk or parted rescue show old partitions? It may show multiple versions, if you changed partitions more than once. First backup current partition table. Must use 18.04 or newer for fdisk to support gpt. sudo sfdisk -d /dev/sda > PT_sda.txt Parted rescue seems easier than testdisk https://askubuntu.com/questions/665445/upgraded-to-windows-10-on-dual-boot-and-cant-boot-to-ubuntu-partition & http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step – oldfred Feb 17 '19 at 19:50

1 Answers1

0

This is a problem with bootloader.
1. try only grub> boot
If no success.
2. Initialize the kernel. Run ls, then in following commands, in place of hdX write your Ubuntu disk and in Y write your Ubuntu partition number.

grub> set root=(hdX,Y)
grub> linux /vmlinuz-<kernelversion>-generic  
grub> initrd /initrd.img-<kernelversion>-generic
grub> boot

(kernelversion) e.g. 4.15.0-43
If you don't know your (kernelversion)

grub> linux /vmlTab
grub> initrd /inTab

or just

grub> set root=(hdX,Y)
grub> linux /vmlinuz
grub> initrd /initrd.img
grub> boot

Now you'll be able to boot into Ubuntu. Once you do, execute the following commands:

sudo update-grub
sudo grub-install --force /dev/sda 
sudo update-grub

and

Reboot

If still no success.

  1. Boot from live DVD or USB drive (installation DVD/USB) and choose "Try Ubuntu".

    • Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD).
      or. Open a terminal (Ctrl+Alt+T) and use the following commands:

      sudo fdisk -l lsblk and find out. It is usually a EXT4 Partition. Replace the XX with the drive letter, and partition number, for example:

      sudo mount /dev/sda1 /mnt. sudo mount /dev/sdXX /mnt sudo mount /dev/sdXY /mnt/boot ### if separate boot partition sudo mount /dev/sdXY /mnt/boot/efi ### for efi partition Note : sdX = disk | sdXX = system partition | sdXY = boot partition

    • Now bind the directories that grub needs access to to detect other operating systems.

      sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys

    • Now chroot.

      sudo chroot /mnt
      

Now install, check, and update grub.
This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda

update-grub
grub-install /dev/sdX
update-grub

Note : sdX = disk | sdXX = system partition | sdXY = boot partition

exit the chrooted system and unmount everything.

exit
for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done

Unmount and reboot.

sudo umount /mnt/boot/efi
sudo umount /mnt/boot
sudo umount /mnt
sudo reboot

Remove the DVD/USB drive when prompted.

Vijay
  • 8,056
  • Thanks for the detailed answer but I’m having some problems following your instructions. In grub, if I type ls I get the output I included in the question - (hd0) (hd0,gpt4) (hd0,gpt2) (hd0,gpt2) (hd0,gpt1) - how do I know which is the Ubuntu partition number? – Fede9390 Feb 17 '19 at 15:31
  • You have to boot into Ubuntu , install and update grub. Thats all. – Vijay Feb 17 '19 at 15:36
  • Sorry I erroneously sent the previous comment without adding more information. – Fede9390 Feb 17 '19 at 15:36
  • Other problem: if I type ‘linux /vlm TAB’ or ‘initrd /in TAB’ no options are shown. If I press enter it tells me respectively ‘file /vlm not found’ and ‘you need to load the kernel first. If I type ‘linux / TAB’ the only options I get are ‘efi’ and ‘boot-repair’ – Fede9390 Feb 17 '19 at 15:41
  • It's vml not vlm. 2. Read the next step.
  • – Vijay Feb 17 '19 at 16:30
  • grub> set root=(hdX,Y) and grub> linux /vmlinuz and grub> initrd /initrd.img
    grub> boot
    – Vijay Feb 17 '19 at 16:48