-1

I added init=/bin/bash in grub.conf file, so my linux system is always entering bash when booted. Is there a way to change the grub.conf file so that I can boot Linux again.

user3840170
  • 26,597
  • 4
  • 30
  • 62
Barinder Grewal
  • 49
  • 1
  • 1
  • 6

3 Answers3

0

TLDR; e, remove init=. ctrl+x

One of the options is to temporary change grub entry to fix booting problem, edit grub.conf and update-grub.

  1. Keep shift pressed during boot (if you don't see grub menu)
  2. Press e to edit menu item
  3. Edit to remove init=... phrase
  4. Press ctrl+x to boot
  5. Now you can edit grub.conf
  6. Run update-grub
  7. reboot
lovelinux
  • 29
  • 5
-1

After making changes to grub file run :

sudo update-grub

This will update your grub

Akhil Thayyil
  • 9,263
  • 6
  • 34
  • 48
-1

TLDR; mount -o remount,rw /dev/sda

It's possible that after booting with init=/bin/bash your filesystem is in readonly state. That means you cannot modify any config files.

Try to remount it as read-write (my disk is at /dev/sda). If you don't know the name, use lsblk

mount -o remount,rw /dev/sda

update-grub will not work if /boot is not mounted

mount /boot

Now you can edit grub.conf and run update-grub

lovelinux
  • 29
  • 5