You are not logged in.

#1 2012-09-01 23:19:07

stefano
Member
Registered: 2011-04-09
Posts: 287

[SOLVED]System unbootable after pacman crashed in the middle of Syu up

Hi all,

my computer crashed while pacman was performing a routine update (i.e pacman -Syu). Now the system won't boot. I get a kernel panic with the dreaded line:

switch_root: failed to execute /sbin/init: Input/output error

Time to get the live cd out.

Here are the last few lines from pacman.log:

Running 'pacman -Syu'
Synchronizing package list
starting full system upgrade
removed libsystemd (188-2)
removed systemd-tools (188-2)
upgraded chromium (21.0.1180.81-2 -> 21.0.1180.89-1)

All the other packages that were supposed to be upgraded were not, and I ended up with a broken system. Rescuing it with the live cd does not work either, because I cannot  chroot into it. /bin/bash (or any other shell) won't be found. I guess this is because of the mess left by the removal of libsystemd?

I read several threads on the forums that are partially related to what I am experiencing, but they all seem to refer to the /lib --> /usr/lib transition, which I negotiated successfully a couple of weeks ago. Indeed my system was quite up to date (updated on 8/29/12) and I was running glibc 2.16.0-4. I  hesitate to follow  the advice given glibc-related threads, since they all seem quote destructive (for instance, retrieve the next-to-last glibc package from pacman's cache and expand it in the mounted root) and I don't want to make the situation worse.

Any help appreciated.


Stefano

Last edited by stefano (2012-09-02 02:15:40)

Offline

#2 2012-09-01 23:29:18

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

It seems like you need to do a chroot into your system and fix it.  Probably by simply reinstalling 'base' with the --needed flag.

Offline

#3 2012-09-01 23:52:08

stefano
Member
Registered: 2011-04-09
Posts: 287

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

Well, that's exactly the problem: I can't chroot into it :-(  Here is what I get:

$cd /mnt/arch
$chroot . /bin/bash

chroot: failed to run command /bin/bash: No such file or directory


Suggestions?

Offline

#4 2012-09-01 23:58:23

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

you can specify the the root when you use pacman as well as the cache so if your system is mounted on /mnt do

 # pacman -Sy -r /mnt
 # pacman -Su base -r /mnt --cachedir /mnt/var/cache/pacman/pkg 

The -r specifys the alternate root (obviously), and I would imagine that you would like you actual system's pacman to be keeping track of which packages are installed, hence the --cachedir

Last edited by WonderWoofy (2012-09-01 23:58:36)

Offline

#5 2012-09-02 00:30:52

bwat47
Member
Registered: 2009-10-07
Posts: 638

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

It sounds like it removed systemd (due to systemd packages now being consolidated in the repos), and then it crashed before the new systemd packages were installed. Chrooting in and reinstalling systemd should fix it.

Offline

#6 2012-09-02 00:33:22

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

bwat47 wrote:

It sounds like it removed systemd (due to systemd packages now being consolidated in the repos), and then it crashed before the new systemd packages were installed. Chrooting in and reinstalling systemd should fix it.

Apparently he cannot chroot into the system because of these lost tools.  That is why I instructed the OP to use pacman from the installer while specifying the root and cache directory.


Edit: replaced he/she with he... Stefano is surely male.

Last edited by WonderWoofy (2012-09-02 00:34:36)

Offline

#7 2012-09-02 01:30:32

stefano
Member
Registered: 2011-04-09
Posts: 287

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

WonderWoofy wrote:

you can specify the the root when you use pacman as well as the cache so if your system is mounted on /mnt do

 # pacman -Sy -r /mnt
 # pacman -Su base -r /mnt --cachedir /mnt/var/cache/pacman/pkg 

The -r specifys the alternate root (obviously), and I would imagine that you would like you actual system's pacman to be keeping track of which packages are installed, hence the --cachedir


Ah! I did not know that. However, pacman -Su base [etc.] fails with glibc related errors. Or conflicts, rather.

first, pacman warns me that it cannot open

/mnt/arch/var/lib/pacman/local/gilbc-2.16.0-4/desc

This is not surprising, I guess, since it is precisely while carrying out this upgrade that my system crashed. I thought pacman would reinstall glibc, in this case, but if I proceed with the installation I get a few screenfuls of glibc-related conflicts (e.g., the first one: "glibc:  /mnt/arch/etc/rc.d/ncsd exists in filesystem" and so on)


S.

Offline

#8 2012-09-02 01:37:27

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

Does https://wiki.archlinux.org/index.php/Pa … upgrade.21 help at all?

Though https://wiki.archlinux.org/index.php/Pa … stem.22.21 may be more helpful.

Last edited by cfr (2012-09-02 01:40:47)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2012-09-02 01:42:26

stefano
Member
Registered: 2011-04-09
Posts: 287

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up


Well, the suggestion there seems to be to reinstall glibc, which I have tried (that is: I have tried "pacman -Su glibc -r etc."). However, pacman won't do it because of the file conflicts (I get the same errors as when upgrading base. No surprises there). I guess I could force the upgrade, but I'm afraid to break things even further.

Suggestions?

Offline

#10 2012-09-02 02:06:07

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

since you are not actually booted from the system and it is *already* broken, why not try removing glibc (or whatever is left of it) before reinstalling it.  It couldn't hurt any more than it is already hurt.

Edit:  so do

 # pacman -R glibc -r /mnt 
# pacman -S glibc -r /mnt --cachedir /mnt/var/cache/pacman/pkg 

Last edited by WonderWoofy (2012-09-02 02:07:53)

Offline

#11 2012-09-02 02:15:00

stefano
Member
Registered: 2011-04-09
Posts: 287

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

So I forced the update of glibc, and it worked. I was able to reinstall base and the system now boots

Thanks to everyone for their help and for holding my hand.

S.

P.S. If anyone could tell me how to prepend [SOLVED] to the subject line, I'd be happy to oblige

edit: never mind, I found out.

Last edited by stefano (2012-09-02 02:16:18)

Offline

#12 2012-09-02 02:15:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

So I am not certain, but I think inaccessability to /var/lib/pacman/* indicates a problem with pacman istelf.  Maybe try a

 # pacman -Syy -r /mnt 

in order to completely rewrite the /var/lib/pacman directory?

Offline

#13 2012-09-02 02:27:30

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]System unbootable after pacman crashed in the middle of Syu up

Hey, good job, way to get your system back.  It is always better to see a fix rather than someone giving up and reinstalling.

Offline

Board footer

Powered by FluxBB