Sunday, 24 December 2017

linux - skip init scripts - boot freezes at "setting system clock"


I have a debian system that's freezing in the boot sequence at "Setting system clock". Several sites I looked at recommended changing the init scripts to disallow hardware access to the clock. But, I can't boot! Is there a parameter I can pass to the kernel at boot so that it will skip init scripts?



Answer



There are two main ways of booting in a maintenance mode. Both require editing the kernel boot line in the bootloader (e.g., grub). At the end of the line that looks like kernel /vmlinuz root=/dev/sda1 ro, you can add:




  • single to skip starting most services (this boots into runlevel 1; writing 1 instead of single is synonymous); or




  • init=/bin/sh to skip absolutely everything after the mounting of the root filesystem and run a shell as the single process. This is an extremely minimal environment. Chances are that you'll want to first mount -t proc proc /proc (lots of things depend on /proc being available) and mount -o remount,rw / (the root filesystem starts out mounted read-only).




Since your problem seems to be with the hwclock invocations, which are part of the system boot, single won't help, you need to go all the way to init=/bin/sh.


Alternatively, you could boot a live CD (or USB stick) and repair your system from there.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...