Systemd: how to get into rescue mode
Volker Wysk
post at volker-wysk.de
Mon Jan 6 18:19:03 UTC 2020
Am Montag, den 06.01.2020, 17:58 +0100 schrieb Liam Proven:
> On Mon, 6 Jan 2020 at 13:30, Volker Wysk <post at volker-wysk.de> wrote:
> > Again, from that magazine article, I'd expect the rescue.target to
> > work, and spawn a shell. And this should be in single-user mode (as
> > far
> > as I can tell), although it isn't mentioned.
>
> Yes, I would too. So I do not know why it isn't working. That is what
> I was trying to say.
>
> > From what I've read on the web, there is the systemd target "multi-
> > user.target", which should do what you have in mind. But I really
> > don't
> > know much about systemd.
>
> AFAIK, it must be explicitly configured by the distro vendor, and
> again AFAIK, most do not.
If you are using Ubuntu, you're lucky. It's here:
/lib/systemd/system/multi-user.target
> > I've been exposed to systemd only a little so far, but I like it.
>
> I did when I first got it: my computer booted substantially quicker.
>
> Then I discovered that the result of dual-booting with Win10 and
> automatically mounting my Windows partition when in Linux was that
> systemd prevented my machine from booting.
>
> This is a known issue, due to choices by Microsoft, and I've now
> fixed
> it, but it took considerable troubleshooting at the time.
>
> > I
> > also like Gnome 3.
>
> Chacun à son goût.
Food for Babelfish. :-)
> > > [2] Familiarize yourself with booting the kernel and initrd from
> > > removable media, but mounting and running root from the hard
> > > disk.
> > > This is a real life-saver sometimes.
> >
> > What would be the benefit? It sounds complicated to set up.
>
> It is not difficult at all. It is merely a matter of editing the boot
> line in GRUB on your live media.
>
> What it means is that if your system is so screwed up that it won't
> boot, you can still boot it from external media but get at *your*
> installation.
>
> For instance, while experimenting with different methods to
> automatically remove old kernels after updating, I once accidentally
> removed _all_ kernels. Leaving me a complete, intact OS that could
> not
> boot.
>
> If you know how to start the PC from USB but load your installed
> copy's root filesystem, this is trivial to fix: boot, apt-install the
> current kernel, let it update GRUB and it's fixed.
>
> If you can't do that, it's very hard to fix and probably means a
> reinstall.
I see. So you can possibly fix issues from "within" the system, if it
doesn't boot any longer. In cases when accessing it from a live system
from an USB stick isn't enough. If editing some configuration files
isn't enough.
But you could alternatively use chroot to get into the damaged system,
and do something "within" it (such as grub-install). That's what I have
prepared my maintenance USB stick for.
Cheers,
Volker
More information about the ubuntu-users
mailing list