0

In my Ubuntu installation I changed something through
sudoedit /etc/default/grub
and now the installation won't boot anymore.

I am on a live usb with Ubuntu now, and it seems to me the other disk is /dev/sda1 and mounted on cdrom, but Im not sure how to get into the configurations that I changed.

When I type sudoedit /etc/default/grub I get into a file that doesnt have the changes I made (so I assume it is not the file I am looking for).

If I cd to etc/default/ and then nano grub.cfg I get to a file that looks very different and doesn't have the same configurations.

How do I get to the grub configurations from the other disk?

(I have a single Ubuntu 18.04.03 install on a Dell XPS computer with an encrypted disk).

Some more information:

lsblk returns:

sda      8:0    1   7.5G  0 disk /cdrom
├─sda1   8:1    1     2G  0 part 
└─sda2   8:2    1   2.4M  0 part

and cat proc/mounts/ returns amongst other:
/dev/sda /cdrom iso9660 ro,noatime,nojoliet,check=s,map=n,blocksize=2048 0 0

sudo mount /dev/sda1 /media/sda1_test returns:
mount: /media/sda1_test: /dev/sda1 already mounted or mount point busy.

if I cd to media/sda1_test and ls it seems empty

If I cd to cdrom, ls returns:
EFI README.diskdefines boot casper dists install isolinux md5sum.txt pics pool preseed ubuntu

And I tried to find the grub file by sudo find / -name 'grub*'
which returns amongst other:

/boot/grub
/usr/lib/grub
/rofs/usr/lib/grub
/rofs/var/lib/grub

I think the issue is that I am not in the right disk at all, since the disk is encrypted and I didn't get a prompt for a password.

and
sudo find / -type d -wholename "etc/default" which returns:

find: ‘/proc/1593/task/1593/net’: Invalid argument
find: ‘/proc/1593/net’: Invalid argument
find: ‘/proc/8949/task/8949/net’: Invalid argument
find: ‘/proc/8949/net’: Invalid argument
find: ‘/run/user/999/gvfs’: Permission denied
Kemeia
  • 101
  • /etc//default/grub on a 'live' system means on your current 'live' system and not your installed system. You need to mount your disk, then navigate to the folder you want and edit the file there. I usually mount to /mnt so I'd be editing /mnt/etc/default/grub but it'll depend on how/where you mount your hdd/ssd to. – guiverc Dec 08 '19 at 03:32
  • Thank you! From what I can understand the disk is /dev/sda1 and is mounted on /cdrom. However from there I am not sure how to get to /etc/default/grub. There is no etc folder and I cant seem to find the path (see pictures through the imgur link) – Kemeia Dec 08 '19 at 03:37
  • Are you sure you're talking about the correct device? /dev/sdxy devices can include thumb-drives and you could be meaning the 'live' system. If you type mount |grep sd do you see your hdd? (lsblk will list block devices where it should be detected). Note because your drive is encrypted, you'll need to enter key to 'mount' it. What OS are you using? (it's easier on later OSes, and there was no 2018-February release!) – guiverc Dec 08 '19 at 03:54
  • This has been asked before and I wrote a detailed answer, but the SE phone app is so poor on searching I can't find it. – Organic Marble Dec 08 '19 at 03:54
  • @guiverc I guess I am not in the correct disk then, since I didnt get any prompt to enter a passphrase for description. I am not sure about disks at all, but from a different question I got that it might be /dev/sda1 (https://askubuntu.com/questions/1194562/failed-to-connect-to-lvmetad-after-changing-grub) – Kemeia Dec 08 '19 at 04:00
  • @guiverc when I enter mount |grep sd I get the following (https://imgur.com/a/Z6Q86tP). The disk that I try to get into is Ubuntu 18.02. The live USB also has Ubuntu 18.02 – Kemeia Dec 08 '19 at 04:02
  • @OrganicMarble I searched through your answers but I couldnt find something related to grub configurations from a different disk... – Kemeia Dec 08 '19 at 04:05
  • Ubuntu releases are year.month and there was no Ubuntu release in February 2018. Please don't provide pictures of text, they aren't easy to read. – guiverc Dec 08 '19 at 04:07
  • @guiverc Yes, sorry, It is Ubuntu 18.04.03. And I added some text output instead of the pictures, hope that is better – Kemeia Dec 08 '19 at 08:40
  • This is the answer I was talking about, and I think is the procedure you need. https://askubuntu.com/a/891812/243321 – Organic Marble Dec 08 '19 at 15:17
  • Do recall what you changed? Why not just boot to Recovery Mode from the GRUB menu, correct the error in /etc/default/grub, update-grub, and reboot? – heynnema Dec 08 '19 at 15:44

0 Answers0