Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kernel panic after adding init=/bin/bash to grub linux line
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 362
Location: Inner Space

PostPosted: Sun Oct 11, 2015 9:22 pm    Post subject: kernel panic after adding init=/bin/bash to grub linux line Reply with quote

i am using btrfs. the system boots normaly. when i was trying to reset the password once again via grub by adding 'rw init=/bin/bash' to the grub 'linux' line a kernel panic message was welcoming me (the one with the blinking caps lock on the keyboard)
Code:

could not find /bin/bash
...
Kernel panic - not syncing: Attempted to kill init!
...


could please anyone try to reproduce? or if you know the answer please tell!
_________________
((O.o))
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1330

PostPosted: Sun Oct 11, 2015 10:06 pm    Post subject: Reply with quote

Try instead use 'rw init=/bin/sh'.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Mon Oct 12, 2015 4:42 am    Post subject: Reply with quote

Which password do you want to change?

Ususually a sysrescue-cd is the way to go for such tasks.

if it is just booting the box, as said earlier, /bin/sh

you can do a bit but not much if you have added busybox to your initrd before. but the busybox binary is very very limited. uses ash shell.
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 362
Location: Inner Space

PostPosted: Mon Oct 12, 2015 7:03 am    Post subject: Reply with quote

yes i tried /bin/sh too. that could not be found either.
when i was playing with rootfstype i have got into busybox. i could mount / but i could not find the passwd command.

i already did reset the password with a gentoo admin cd after chrooting. but usually when i want to reset the root password the grub way of doing it was working also with /bin/bash.
_________________
((O.o))
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1330

PostPosted: Mon Oct 12, 2015 2:45 pm    Post subject: Reply with quote

If you get down into the busybox you must:
  • remount root fs in rw mode
  • edit /etc/shadow file and delete the hash field (second field) in the root entry
  • reboot
  • login as root (whitout password)
  • change the password whit password command
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum