2

I have a non-persistent Xubuntu 18.04 LTS live USB. I like to keep it non-persistent EXCEPT for a small change.

I'd like to add radeon.modeset=0 to the line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" in the file /etc/default/grub so that it reads:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.modeset=0"

and make that change permanent.

This is to prevent one of my discrete graphic cards (Radeon) from starting on boot.

JJrussel
  • 287
  • 1
  • 4
  • 12
  • What program did you use to create the USB? Most Live and Persistent USB's do not allow sudo update-grub. It returns error: failed to get cononical path of '/cow'.thus editing /etc/default/grub has no effect. – C.S.Cameron Nov 08 '20 at 05:56

2 Answers2

1

Luckily length of new grub option matches length of existing options (it is not longer). I guess --- is used to inform end of options, I've just booted 20.04 LTS (I assume it either applies that same to 18.04 LTS or as one year passed it is Ok for you to use 20.04 LTS now) replacing "quiet splash ---" with "toram" and have not noticed any problems.

Therefore for that particular edit answers to that QA can be directly applied (editing on byte level of iso file or USB stick): How is it easier to make a persistent live drive with Ubuntu 19.10? See "Manual" section of sudodus answer or my answer with script based on sudodus answer.

$python
>>> len ("radeon.modeset=0")
16
>>> len ("quiet splash ") # not enough to replace only those
13
>>> len ("quiet splash ---") # just fits!
16

P.S. Assuming you do not need that splash image and don't mind output of Linux booting on the screen instead ;-)

0

Make a Permanent Change on a Persistent Live USB

Programs like Etcher, Win32DiskImager, dd, Gnome-Disks and Startup Disk Creator, create a USB with a read only operating system with a read only bootloader.

Other Programs like Rufus, Ventoy, mkusb, UNetbootin and YUMI create a USB with a Syslinux or GRUB bootloader config file that can be edited regardless if the USB is Persistent or not.

Rufus Windows:

  • If you are working from Windows, use Rufus to create your Live or Persistent USB. Use the Write ISO image option, (Default), if asked.

  • While still in Windows Edit /boot/grub/grub.cfg. adding radeon.modeset=0 after quiet splash in the first menuentry.

  • Then Edit /isolinux/txt.cfg adding radeon.modeset=0 after quiet splash in the first menu item.

Mkusb Ubuntu

  • If you are working from Ubuntu use mkusb to create a persistent USB with your preferred options.

  • Using disks, mount the USB's usbboot partition.

  • Edit /boot/grub/grub.cfg. adding radeon.modeset=0 after quiet splash in the first menuentry.

This should set you up permanently for both BIOS and UEFI boots whether the USB is Live or Persistent.

C.S.Cameron
  • 19,519
  • It's not allowing me to make changes to grub.cfg. Read-only. https://imgur.com/dXIENfo https://imgur.com/UygjTaa – JJrussel Nov 09 '20 at 03:28
  • You should be able to edit a Rufus USB from Windows. If booted from Linux, (but not the target USB), try opening grub.cfg's or txt.cfg's folders using sudo -H nautilus or install nautilus admin, (sudo apt install nautilus-admin) You can not change it if booted from the live USB unless booted toram. – C.S.Cameron Nov 09 '20 at 03:33
  • So is that `sudo -H nautilus grub.cfg'? – JJrussel Nov 09 '20 at 05:36
  • sudo -H nautilus will open nautilus as root, then go to /media/xubuntu/xubuntu.../boot/grub/grub.cfg and double click to open it, as root in text. You should be able to edit and save it no problem. – C.S.Cameron Nov 09 '20 at 06:09
  • Same reason result. https://i.imgur.com/Gf3974V https://i.imgur.com/Q3mxf2P – JJrussel Nov 09 '20 at 21:26
  • @JJrussel: Try again with an upper case H, ie sudo -H nautilus. – C.S.Cameron Nov 10 '20 at 08:01
  • There is no text.cfg in /cdrom/isolinux/ – JJrussel Nov 18 '20 at 23:38
  • @JJrussel The name of the file is txt.cfg not text.cfg. This is the file to edit if using Rufus. If you are using UNetbootin edit syslinux.cfg, (in the root of the USB. If you are using Etcher, Win32DiskImager, dd, Gnome-Disks and Startup Disk Creator, the OS is ISO9660 and txt.cfg is read only. – C.S.Cameron Nov 19 '20 at 01:44
  • Ah, yeah, just seen it earlier accidently. Problem though, I can't edit it. I am able to edit 'syslinux.cfg' in UNetbootin created USB, by unplugging the USB and plugging it back in and working directly on the mounted USB instead of file system. In a Ventoy (similar to Rufus I believe) created live USB though though, I can only see the file in filesystem and the USB is just the iso file. I can't edit txt.cfg in filesystem (/cdrom/syslinux/txt.cfg). It's read only. I've tried thunar. EDIT: Just notuced the end of your comment above about ISO9660. So no can do? No solution? – JJrussel Nov 19 '20 at 02:00
  • @JJrussel, It is only ISO9660 that you can not edit, You can edit grub.cfg, txt.cfg or syslinux.cfg files in USB's made using Rufus, Unetbootin, Universal, YUMI, MultiBootUSB or mkusb,(persistent). Ventoy boots read only ISO files using GRUB2. It's grub.cfg file can be edited, but is extremely complex. – C.S.Cameron Nov 19 '20 at 03:00
  • Which one of those functions like Ventoy (in that it's a multi-boot USB)? – JJrussel Nov 19 '20 at 12:27
  • @JJrussel YUMI is a natural multibooter. If you divide the USB into multiple partitions first, UNetbootin will install and boot multiple OS. Mkusb will multiboot if you drop multiple ISO's on the usbdata partition and add menuentries for each to usbboot/boot/grub/grub.cfg. I make my own custom multiboot USB's using the instructions on this page: https://askubuntu.com/questions/1269462/bios-uefi-template-image-for-booting-iso-files – C.S.Cameron Nov 19 '20 at 13:19