1

When I do sudo update-grub I receive this message:

/usr/sbin/grub-probe:error:failed to get canonical path of /cow

I went through all google solutions none of them work presumably because I am running Ubuntu 20.04 from a Live USB with Persistent Storage (mkusb) and not a installed version of Ubuntu if you ask why that's because a full installation of any OS just straight up won't boot or it freezes constantly.

I want a full control of my RX580s for overclocking, I don't want only to apply fixed values to my overclock of my RX580s that's why I avoid software like:

Manually, through files, I can't overclock because there are no text files that control core, memory and voltage and it requires sudo update-grub.

TuxClocker won't run make command because Qt software won't run the command qmake rojekti.pro and it also requires sudo update-grub.

So I finally settled on WattmanGTK which also — guess what — requires sudo update-grub.

How do I fix this painful error that I've been sitting on for a month so I can move on with my life? And does it make a difference if I use AMDGPU open source or AMDGPU-PRO closed source drivers?

2 Answers2

1

How to edit grub in a persistent live drive

sudo update-grub does not work with live and persistent live systems. You need an installed system for that command line to work.

In a persistent live system, you can modify the file grub.cfg directly. If you created the system with mkusb version 12, mkusb-dus, this file can be found in partition number 3 in the USB drive.

Open a terminal window with the hotkey combination ctrl + alt + t and run the following commands to access the relevant grub.cfg. The following demo example uses Lubuntu because I have a current persistent live system for that flavour of Ubuntu, but the boot structure and the commands are the same for all flavours of Ubuntu (including standard Ubuntu).

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

lubuntu@lubuntu:~$ df -h Filesystem Size Used Avail Use% Mounted on tmpfs 770M 1.7M 769M 1% /run /dev/sda4 1.9G 1.9G 0 100% /cdrom /cow 54G 102M 52G 1% / tmpfs 3.8G 0 3.8G 0% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup tmpfs 3.8G 0 3.8G 0% /tmp tmpfs 770M 80K 770M 1% /run/user/999 /dev/sda5 54G 102M 52G 1% /media/lubuntu/writable /dev/sda1 55G 67M 55G 1% /media/lubuntu/usbdata lubuntu@lubuntu:~$ setxkbmap se lubuntu@lubuntu:~$ sudo mount /dev/sda3 /mnt lubuntu@lubuntu:~$ ls -l /mnt/boot/grub/grub.cfg -rwxr-xr-x 1 root root 2241 Dec 30 13:17 /mnt/boot/grub/grub.cfg lubuntu@lubuntu:~$

Your live system drive (the USB drive) may be seen as /dev/sdb, /dev/sdc ... instead of /dev/sda. This is shown by the command df -h.

Since you need sudo to edit it, I suggest that you use the text mode editor nano

$ sudo nano /mnt/boot/grub/grub.cfg

Edit 1: I should add the following comment:

In a persistent live system you can add the settings, that reside in the home directory (usually as hidden files), and you can add application program packages.

But you cannot upgrade the kernel and you cannot add or modify the kernel drivers, because the kernel and its drivers are started before the overlay for persistence is activated. If that is what you want, you must use an installed system. It is possible to create an installed system in an external drive, for example a USB pendrive. Let me know if this is what you want, and I can help you with some tips and links.

Edit 2: Details to find grub.cfg

df -h indicates which device (drive letter) that is active, but does not show the partition (number) containing grub.cfg unless it is mounted.

You can use lsblk -f to show all devices including partitions (also unmounted partitions), and it helps to know what partition structure should be expected in a particular system. A system created by the tool dus-persistent (in mkusb) puts grub into partition #3.

Please ask for more details if necessary, for example if your persistent live system was made by another tool (not dus-persistent).

sudodus
  • 47,684
1

Modifying GRUB on a Bootable USB

There are several types of Bootable USB.

Some USB tools clone the ISO file to USB as an ISO9660 partition. These do not have an editable grub.cfg file. They include mkusb-Live-only, dd, Etcher, Win32DiskImager, Startup Disk Creator and Gnome-Disks.

Prior to 20.10, some USB tools used Syslinux to boot in BIOS mode and GRUB in UEFI mode. For BIOS mode you need to edit either syslinux.cfg or txt.cfg. These include UNetbootin, Rufus, Universal and MultiBootUSB. Syslinux.cfg and txt.cfg can be manually edited similar to grub.cfg.

I only know of a couple of tools that before 20.10 used GRUB2 for both BIOS and UEFI, mkusb and YUMI. YUMI has a version for BIOS boot that uses grubfordos and syslinux and a GRUB2 version for UEFI boot. The GRUB version now works with 20.04 in BIOS mode.

Ventoy boots ISO files using GRUB2 but the grub.cfg file is very complex and the one file can boot most varieties of Linux.

To summarize: you can only edit grub.cfg on Live and Live Persistent USB's made using mkusb, UNetbootin, Rufus, Universal, YUMI and MultiBootUSB. Most of these will need Syslinux.cfg or txt.cfg edited if you are booting Ubuntu in BIOS mode prior to version 20.10.

You can not easily edit grub on USB's made using: mkusb-live-only, dd, Etcher, Win32DiskImager, Startup Disk Creator, Gnome-Disks and Ventoy.

C.S.Cameron
  • 20,530
  • 12
  • 78
  • 125