Cannot find /dev/sdX in grub, so I cannot exit
https://askubuntu.com/questions/1222066/cannot-find-dev-sdx-in-grub-so-i-cannot-exit
Recently, I was working on switching Ubuntu to Windows OS. I have forgotten what I have set in the grub GUI. When I rebooted my laptop, I found that I am stuck inside the grub command line. See
grub command line.
GNU GRUB version 2.04
Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions.
Anywhere else TAB lists possible device or file completions.
grub> ls
(proc) (hd0) (hd0,gpt2) (hd0,gpt1)
grub> ls -lh
Device proc: Filesystem type procfs - Sector size 512B - Total size 0KiB
Device hd0: No known filesystem detected - Sector size 512B - Total size 250059096KiB
Partition hd0,gpt2: Filesystem type ext* - Last modification time 2020-03-28 15:01:06 Saturday, UUID 358b866a-2b54-42
Partition hd0,gpt1: Filesystem type fat, UUID 659D-CD20 - Partition start at 1024KiB - Total size 524288KiB
grub> set root=(hd0,gpt
Possible partitions are:
Partition hd0,gpt1: Filesystem type fat, UUID 659D-CD20 - Partition start at 1024KiB - Total size 524288KiB
Partition hd0,gpt2: Filesystem type ext* - Last modification time 2020-03-28 15:01:06 Saturday, UUID 358b866a-2b54-4
grub> set root=(hd0,gpt2)
grub> ls boot/vm*
error: invalid file name `boot/vm*'.
grub> ls boot/vm
error: invalid file name `boot/vm'.
grub> ls /
Possible files are:
lost+found/ boot/ swapfile etc/ media/ var/ bin dev/ home/ lib lib32 lib64 libx32 mnt/ opt/ proc/ root/ run/ sbin snap/ srv/ tmp/ usr/
grub> ls boot/
error: invalid file name `boot/'.
grub> ls /boot/
config-5.3.0-42-generic grub/ initrd.img initrd.img.old memtest86+.bin memtest86+_multiboot.bin vmlinuz vmlinuz.old vmlinuz-5.3.0-42-generic
I followed a couple of guidelines from the websites, and all have stated to do the following:
set root=(hd0,gpt)
linux /vmlinuz root=/dev/sdX
boot
However as I was following these instructions, I was not able to find out that my SSD device. See no device name like sdX.
error: invalid file name `boot/vm'.
grub> ls boot/
Possible files are:
lost+found/ boot/ swapfile etc/ media/ var/ bin dev/ home/ lib lib32 lib64 libx32 mnt/ opt/ proc/ roo
grub> ls boot/
error: invalid file name boot/'. grub> ls /boot/ efi/ grub/ grub.bak/ initrd.img initrd.img.old memtest86+.bin memtest86+.elf memtest86+_multiboot.bin initrd.img-5.3.0-40-generic vmlinuz-5.3.0-42-generic System.map-5.3.0-42-generic initrd.img-5.3.0-42-g grub> ls dev/ error: invalid file name dev/'.
grub> ls /dev/
fd mapper/ pts/ shm/ console full null ptmx random stderr stdin stdout tty urandom zero
grub> _
My laptop is an Acer Swift 3, 15 inches. I have a single boot OS (Ubuntu). I have tried checking the /mnt and I saw there's a folder called boot-save which contained my SSD name, but still I can't point the root to it. See file under dev.
error: invalid file name `dev/'.
grub> ls /dev/
fd mapper/ pts/ shm/ console full null ptmx random stderr stdin
grub> ls /mnt/
boot-sav/
grub> ls
Possible commands are:
ls lsefi lsefimmap lsefisystab lsfonts lsmod lssal
grub> ls /mnt/boot-sav/
mmcblk0p1/ nvme0n1p1/
grub> _
And every time I just got a kernel panic error as shown.