You want to use the 40_custom
file for this, preferably in maintenance mode.
All commands in this tutorial are to be run as root! This tutorial also DOES NOT WORK for systems with /boot
on a different partition!
Find the UUID of your main partition by using blkid
and looking for an EXT4 partition. Remember this UUID, you will need it soon.
Start by opening the 40_custom file.
nano /etc/grub.d/40_custom
- Append this to the end of the file:
menuentry "Ubuntu Text Mode" {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos9)'
search --no-floppy --fs-uuid --set=root
[UUID from earlier]
linux /vmlinuz root=UUID=
[UUID from earlier] ro text $vt_handoff
initrd /initrd.img
}
Save this file as 15_custom
. It will be after the Ubuntu default entries. Name it to 06_custom
if you want it before default Ubuntu.
Run the following command, based on your system:
chmod a+x /etc/grub.d/06_custom
chmod a+x /etc/grub.d/15_custom
Finally, run this command to refresh the GRUB menu:
update-grub
Source for this tutorial is available here, free of charge.