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?

  • Have you considered a Full install to USB? You can install any program or driver that can be installed to a desktop install. You can even run update-grub. You can install a Full install to USB using a disk image created by sudodus for that purpose, It works great for me: https://askubuntu.com/questions/1300454/easy-full-install-usb-that-boots-both-bios-and-uefi – C.S.Cameron Jan 03 '21 at 11:57

2 Answers2

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
  • 19,519
0

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.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • I tried applying grub modification from a live CD to my live USB with persistent storage and it worked the problem is I can’t apply sudo update-grub command from my live CD to my live USB so it essentially did the same as sudo nano grub edit from my USB. When I tried fully installing Ubuntu to my 3.0 16 GB USB it constantly gave me freezes and lags, I also tried installing Windows on it it also didn’t work it couldn’t boot. Let me know if you know if it’s possible to do sudo update-grub from another system if not what are full install alternatives for usb that actually work.Thanks for replying – dudididu Jan 02 '21 at 20:09
  • @dudididu, sudo update-grub does not work with a live or persistent live system. But you can modify grub.cfg directly. sudo update-grub is doing that in an indirect way (the edits of /etc/default/grub and of the files in /etc/grub.d/ are transferred to grub.cfg but only in an installed system). – sudodus Jan 02 '21 at 20:52
  • @dudididu, See the links and links from them. My two posts in this thread and Step-wise instructions for installed system in a USB drive. The easiest method is to extract and clone from a compressed image file of an installed system. (This is the same method as when installing an operating system into Raspberry Pi, but using Ubuntu for regular PC computers.) – sudodus Jan 02 '21 at 21:01
  • this may sound stupid but is it possible to transfer edits from /etc/default/grub to grub.cfg directly since you said I can modify it directly? – dudididu Jan 02 '21 at 22:56
  • @dudididu, You can 'translate' the edits in /etc/default/grub to grub.cfg (if you know what you are doing). In other words, learn what is the corresponding edit in grub.cfg, and do it manually. – sudodus Jan 03 '21 at 15:40