0

My ubuntu system fails to boot after modifying file /etc/default/grub, even if I withdraw the modification later.

I have a PC with four operating systems: 1. Ubuntu with grub2; 2, Centos; 3, Debian; and 4 gentoo.

The one that that crashes is Ubuntu. That is why I post the question here.

Due to a recent update from gentoo that requires the installation of systemd, I need to change the configuration of grub2 installed in ubuntu, specifically two steps:

Modfication 1: add extra lines:

    init=/usr/lib/systemd/systemd

to the menuentry of gentoo in /boot/grub/grub.cfg. This modification will definately not impact the boot of other systems.

Modfication 2: add

    GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"

in /etc/default/grub of Ubuntu system, which systemd is not installed. of course the second modification is not right to my case because in ubuntu there is no systemd installed (these is nothing in /usr/lib/systemd/systemd of ubuntu).

However, the second modification becomes a troublemaker. After adding this line, the system fails to boot into ubuntu (the grub menu still works). Realizing the problem, I decide to withdraw the second modification. However, when I boot ubuntu again, the system freezes with the following screen:

 Target filesystem desn't have requested /usr/lib/systemd/systemd
 busybox v1.20.2 (Debian 1:1.20.0-7) multi-call binary
 Usage: switch_root '-c /dev/console] NEW_ROOT NEW_INIT [ARGS}
 Free initramfs and switch to another root fs:
 Chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /.
 execute NEW_INIT. PID must be 1 NEW_ROOT must be a mountpoint. 

 -c DEV reopen stdio to DEV

The reset can only be done by switching off and then on the pc, not rather by ctrl+alt+del.

This problem is 100% reproducable. As ubuntu fails to work, I installed grub2 from debian system. The exactly the same screen appears after I conducted the modification 2 on /etc/default/grub in debian system and rebooted debian with modification withdrawn.

Can any one please give help on this issue? now only centos is working, from which I am writting this help question in askubuntu.

4
  • That doesn't seem right... I don't know how Grub will possibly know where /usr is, because the system hasn't started yet. In my opinion, all your problems come from that : GRUB should never have a commandline that requires an access to /something, hell I'm not even sure it can read that...
    – MrVaykadji
    Jan 31, 2014 at 15:39
  • actually I had a successful modification experience to my laptop which has a gentoo and Lubuntu installed. The only difference is Lubuntu in my laptop has a 2.00 grub2 but ubuntu in this problematic PC has a 1.99 grub2. But to be honest I just mechanically did the modification according to the website. Jan 31, 2014 at 15:46
  • Are you sure that systemd is installed in ubuntu? If so, is the location /usr/lib/systemd/systemd ??? Maybe try looking in /bin/systemd ? It is looking for systemd in that location, but it is saying that it doesn't exist? what does ls /usr/lib/systemd/systemd ; whereis systemd give?
    – jmunsch
    Jan 31, 2014 at 16:19
  • I didn't install systemd in ubuntu or debian, so there is nothing when using ls /usr/lib/systemd/systemd or whereis systemd in both crashed system . But I didn't expect such a modification could have tremendous consequence to the system. Jan 31, 2014 at 23:56

1 Answer 1

0

the file

 /etc/default/grub

is used to store the default grub parameters when using update-grub. as the comment line in /etc/default/grub says:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

Of course if you add:

 init=/usr/lib/systemd/systemd

in /etc/default/grub, after running update-grub, you will have init=/usr/lib/systemd/systemd for every menuentry. for example:

menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
    load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root ca645602-ca68-498a-87d2-46cf205285dc
echo    'Loading Linux 2.6.32-5-amd64 ...'
linux   /boot/vmlinuz-2.6.32-5-amd64 root=UUID=ca645602-ca68-498a-87d2-46cf205285dc ro init=/usr/lib/systemd/systemd quiet
echo    'Loading initial ramdisk ...'
initrd  /boot/initrd.img-2.6.32-5-amd64
}

which can not boot debian without systemd installed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .