Software & AppsOperating SystemLinux

How To Fix “Failed to Get Canonical Path of `/cow`” Error in Grub2 on Ubuntu Persistent USB Drive

Ubuntu 2

When working with Ubuntu on a persistent USB drive, you may encounter the error message “Failed to get canonical path of /cow” while trying to update the GRUB bootloader. This error typically arises because the GRUB on a LiveUSB is read-only, even with persistence enabled. This article will guide you through the process of resolving this issue.

Quick Answer

To fix the "Failed to Get Canonical Path of /cow" error in Grub2 on an Ubuntu persistent USB drive, the recommended solution is to use an installed release of Ubuntu on a separate USB stick. This allows you to have a writable GRUB and modify the necessary configuration file to resolve the error.

Understanding the Error

Before we dive into the solution, let’s understand the error. The Canonical Path of /cow error occurs when you execute the command sudo update-grub in a persistent USB mode of Ubuntu. This is because the Grub2 bootloader on a LiveUSB is read-only, even with persistence enabled, which makes it impossible to modify the file /etc/default/grub, specifically the line “GRUB_CMDLINE_LINUX_DEFAULT=”.

Solutions

There are a couple of ways to fix this error and make changes to GRUB:

1. Remake the entire LiveUSB image

This method involves creating a new LiveUSB with the desired changes to the /etc/default/grub file. However, this process can be complex and is not recommended unless you are familiar with creating custom LiveUSB images.

2. Use an installed release of Ubuntu on a USB stick

Instead of using the LiveUSB’s “Try Ubuntu” environment, you can install Ubuntu onto a separate USB stick. This installed version of Ubuntu will have a writable GRUB, allowing you to modify the /etc/default/grub file and execute “sudo update-grub” successfully.

Step-by-Step Guide to Using an Installed Release of Ubuntu on a USB Stick

This is the recommended solution for most users. Here’s a step-by-step guide:

  1. Install Ubuntu on a USB stick: Instead of using the LiveUSB’s “Try Ubuntu” environment, install Ubuntu onto a separate USB stick. This will give you a writable GRUB.
  2. Boot from the USB stick: Once Ubuntu is installed on the USB stick, boot your system from this USB stick.
  3. Open Terminal: Once you’re in the Ubuntu environment, open the Terminal.
  4. Modify the GRUB file: Use the command sudo nano /etc/default/grub to open the GRUB configuration file. Find the line that reads “GRUB_CMDLINE_LINUX_DEFAULT=” and make the necessary changes.
  5. Update GRUB: After making the changes, save the file and exit. Then, update GRUB by running the command sudo update-grub.

This command updates the GRUB bootloader with the changes you made in the configuration file. The sudo prefix gives you superuser permissions necessary to modify system files, update-grub is the command to update the GRUB bootloader.

After following these steps, you should no longer see the “Failed to get canonical path of /cow” error when updating GRUB.

Conclusion

The “Failed to get canonical path of /cow” error in Grub2 on an Ubuntu persistent USB drive can be a bit of a headache, but it’s not insurmountable. By using an installed release of Ubuntu on a USB stick, you can easily modify the GRUB configuration and avoid this error. Remember to always be careful when modifying system files and to only make changes you understand. Happy coding!

What is a persistent USB drive?

A persistent USB drive is a USB drive that allows you to save data and settings even after you shut down or reboot your computer. It essentially acts as a portable operating system that you can carry with you and use on different computers.

Can I fix the “Failed to get canonical path of `/cow`” error without using an installed release of Ubuntu on a USB stick?

While it is possible to fix the error by remaking the entire LiveUSB image, this process can be complex and not recommended for most users. Using an installed release of Ubuntu on a USB stick is the recommended and easier solution for resolving the error.

Leave a Comment

Your email address will not be published. Required fields are marked *