How can I delete the option nomodeset in /etc/default/grub? Or, more precisely, how can I access a command line in order to delete the option?

I have set it in my grub file trying to debug this bug. Now I can not longer access the Ubuntu recovery mode in order to delete the nomodeset from the grub file. I do not know how to get access to a command line without access to the recovery mode.

CTRL + ALT + F1 or F7 does not work. The last messages I get are starting LightDM display manager and stopping save kernel messages so I think the system does start fine.

Is there a way (keyboard shortcut) to boot into a terminal for instance?

  • I do not know what I was thinking this morning. The bounty text should read: "Your answer is well written, it was fast, it saved me the time of figuring this out again. Also I think it is interesting for future reference. Thank you."
    – don.joey
    Mar 23 '13 at 16:10

If Ubuntu does not work, you can still access your installation via chroot.

Be aware that the live system must have the same architecture (32 or 64bit) as your system on the hard disk.

Boot from a Live media of Ubuntu (USB/CD/DVD) and open a terminal (CTR+ALT+T). The general idea here is to mount the (root) partition of Ubuntu and then chroot in it.

First give this command to list the partitions

sudo fdisk -l 

here is an example result

/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848    81922047    40857600    7  HPFS/NTFS/exFAT
/dev/sda3        81922048   625142447   271610200    5  Extended
/dev/sda5        81924096   140517375    29296640   83  Linux
/dev/sda6       140519424   433487871   146484224   83  Linux

If this does not work, you can also use gparted (open the dash and type gparted) to find what your root partition is.

I know that my Ubuntu (root) partition is /dev/sda5 (because I have a separate /home in /dev/sda6).

Now I will mount the /dev/sda5 in /mnt

sudo mount /dev/sda5 /mnt

Now I will connect to /mmt and mount some other folders that might be needed.

cd /mnt 
sudo mount -t proc proc proc/
sudo mount -t sysfs sys sys/
sudo mount -o bind /dev dev/
sudo mount -t devpts pts dev/pts/

Now I will chroot to my Ubuntu installation

sudo chroot /mnt 

Edit the file you want.

nano etc/default/grub 

Be careful the forward-slash here. etc not need forward-slash in the beginning because you will edit the wrong file then.

Now remove the entry nomodeset (or anything else)

save the file with CTRL + X , then Y(es) and then ENTER.

now update grub


Exit the chroot enviroment and unmount the folders - partitions

sudo umount {proc/,sys/,dev/pts,dev/}
cd .. ; sudo umount /mnt

The changes have been applied.. reboot your system.

source 1

source 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.