Set default boot options in grub with persistent live USB

ng flag

I tried a bunch of times to install Ubuntu Budgie 20.04.3 on an old Acer Spin 1. Every time it would get almost all the way through but then fail when trying to install grub. After days spent trying to figure it out it seemed that something about the type of hard drive was the problem and it felt out of my league to fix it so I gave up, and opted for a bootable USB stick with persistent storage instead.

This has been working fine once I get it booted, but every time I reboot it sends me to grub and I have to run

set prefix=(hdx,y)/boot/grub
set root=(hdx,y)
insmod normal

before it takes me to the grub boot screen and eventually boots.

Several help articles suggested editing the /etc/default/grub file as follows:


which I did, but this didn't help. I'm unable to run update-grub (When I try I get error: failed to get canonical path of '/cow') while running from the live USB, I assume for the reasons cited in this answer: Can't update grub on persistent live USB, but that question doesn't include a solution that I can understand.

Is there any way to fix grub when running from a persistent live USB? I can't boot at all without a USB stick since the ubuntu installation always fails when it gets to grub. I can see all the budgie desktop files on the hard drive of the laptop, I just can't boot it.

I don't mind running from persistent bootable USB if that's the only solution, I would just like to be able to boot into it directly wihout having to set prefix and set root manually every time.

ETA: I see that my question is very similar to this one: Set default grub partition but I can't run grub-customizer for probably the same reasons I can't run grub-update -- I get the same error message (failed to get canonical path of '/cow')

cn flag

If you're only editing options that are straightforward to recognize in grub.cfg, and if you can live with them getting wiped anytime a new version of GRUB is installed, it can be done pretty easily:

  1. Find the /dev/sdX name of the partition with the "boot" flag on your persistent bootable USB (open GParted or use sudo parted -l to look for it).

  2. Mount this partition with sudo mount /dev/sdX /mnt if there's nothing already occupying /mnt.

  3. Edit what you need in the grub.cfg from this partition with sudo nano /mnt/boot/grub/grub.cfg or some editor of your choice. If you're changing the default GRUB menu option that's preselected when the menu first shows up, keep in mind the option numbers start at 0 and correspond to the menu configuration blocks as you see them in the last part of grub.cfg, ordered from top to bottom.

  4. Unmount with sudo umount /dev/sdX and restart to test.

If things don't work out you can always change it back using the same procedure, as long as you can still boot to a full Ubuntu so you can mount partitions and edit files.

This just worked for me on a Xubuntu 20.04 persistent live USB.


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.