You are not logged in.

#1 2022-03-02 18:09:25

Medeirox
Member
Registered: 2022-03-02
Posts: 8

[SOLVED]Power outage during upgrade

Hello, I ran 'pacman -Syuu' yesterday on my machine, and while it was upgrading, there was a power outage in my region, which turned my machine off unexpectedly. booting it up again, the following message is displayed:

Loading Linux linux...
error: file '/vmlinuz-linux' not found.
Loading initial ramdisk...
error: you need to load the kernel first

Following that, I tried to boot from another environment (the arch install medium thumb drive I have laying around) and tried to arch-chroot into the bricked system, only for it to return:

chroot: failed to run command ‘bin/bash’: Input/output error

I also tried running

pacman --sysroot /bricked-system -Syu

but it also didn't work, returning 'could not resolve host' for every single mirror, even though the machine was connected to the internet and ping worked just fine

Is this system recoverable at all? Any help is much appreciated.

Last edited by Medeirox (2022-03-03 01:30:37)

Offline

#2 2022-03-02 18:34:09

seth
Member
Registered: 2012-09-03
Posts: 50,000

Re: [SOLVED]Power outage during upgrade

pacman --sysroot /bricked-system -Syu

is the way to go in this situation, so let's focus on "returning 'could not resolve host' for every single mirror"

the machine was connected to the internet and ping worked just fine

ping
a) IPs (8.8.8.8)
b) domains (google.com)
c) the attempted mirrors (

You may want to inject a (reachable) mirror from https://archlinux.org/mirrors/status/#successful

Offline

#3 2022-03-02 18:55:39

Medeirox
Member
Registered: 2022-03-02
Posts: 8

Re: [SOLVED]Power outage during upgrade

Don't know if it matters much, but I've moved from using the arch install medium to using systemrescuecd for convenience. Anyways, here's the outputs of everything:

Ping Ips:

ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=13.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=11.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=13.0 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=11.8 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=57 time=86.7 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=57 time=16.9 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=57 time=12.5 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=57 time=12.9 ms

Ping domains:

ping archlinux.org
PING archlinux.org(archlinux.org (2a01:4f9:c010:6b1f::1)) 56 data bytes
64 bytes from archlinux.org (2a01:4f9:c010:6b1f::1): icmp_seq=1 ttl=48 time=241 ms
64 bytes from archlinux.org (2a01:4f9:c010:6b1f::1): icmp_seq=2 ttl=48 time=242 ms
64 bytes from archlinux.org (2a01:4f9:c010:6b1f::1): icmp_seq=3 ttl=48 time=243 ms
64 bytes from archlinux.org (2a01:4f9:c010:6b1f::1): icmp_seq=4 ttl=48 time=255 ms
^Z

pinging the mirrors also works just fine

ping archlinux.mailtunnel.eu
PING archlinux.mailtunnel.eu(2001:bc8:3600:100::2004 (2001:bc8:3600:100::2004)) 56 data bytes
64 bytes from 2001:bc8:3600:100::2004 (2001:bc8:3600:100::2004): icmp_seq=1 ttl=48 time=323 ms
64 bytes from 2001:bc8:3600:100::2004 (2001:bc8:3600:100::2004): icmp_seq=2 ttl=48 time=216 ms
64 bytes from 2001:bc8:3600:100::2004 (2001:bc8:3600:100::2004): icmp_seq=3 ttl=48 time=216 ms

I assume what you mean by injecting a mirror is just pasting it to /bricked_system/etc/pacman.d/mirrorlist is that correct?

Offline

#4 2022-03-02 19:03:14

Medeirox
Member
Registered: 2022-03-02
Posts: 8

Re: [SOLVED]Power outage during upgrade

I added another mirror after checking if it was reachable with ping and ran

pacman --sysroot /bricked_system -Syu

again and got the following:

[root@sysrescue ~]# pacman --verbose --sysroot /mnt -Syu
Root      : /
Conf File : /etc/pacman.conf
DB Path   : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/ 
Hook Dirs : /usr/share/libalpm/hooks/  /etc/pacman.d/hooks/ 
Lock File : /var/lib/pacman/db.lck
Log File  : /var/log/pacman.log
GPG Dir   : /etc/pacman.d/gnupg/
Targets   : None
:: Synchronizing package databases...
core.db failed to download
error: failed retrieving file 'core.db' from arch.mirror.constant.com : Could not resolve host: arch.mirror.constant.com
warning: too many errors from arch.mirror.constant.com, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.f4st.host : Could not resolve host: mirror.f4st.host
warning: too many errors from mirror.f4st.host, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.osbeck.com : Could not resolve host: mirror.osbeck.com
warning: too many errors from mirror.osbeck.com, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.pseudoform.org : Could not resolve host: mirror.pseudoform.org
warning: too many errors from mirror.pseudoform.org, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from archlinux.za.mirror.allworldit.com : Could not resolve host: archlinux.za.mirror.allworldit.com
warning: too many errors from archlinux.za.mirror.allworldit.com, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.cyberbits.asia : Could not resolve host: mirror.cyberbits.asia
warning: too many errors from mirror.cyberbits.asia, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from archlinux.thaller.ws : Could not resolve host: archlinux.thaller.ws
warning: too many errors from archlinux.thaller.ws, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from archlinux.uk.mirror.allworldit.com : Could not resolve host: archlinux.uk.mirror.allworldit.com
warning: too many errors from archlinux.uk.mirror.allworldit.com, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.theo546.fr : Could not resolve host: mirror.theo546.fr
warning: too many errors from mirror.theo546.fr, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.telepoint.bg : Could not resolve host: mirror.telepoint.bg
warning: too many errors from mirror.telepoint.bg, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from archlinux.mailtunnel.eu : Could not resolve host: archlinux.mailtunnel.eu
warning: too many errors from archlinux.mailtunnel.eu, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.chaoticum.net : Could not resolve host: mirror.chaoticum.net
warning: too many errors from mirror.chaoticum.net, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from phinau.de : Could not resolve host: phinau.de
warning: too many errors from phinau.de, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from archmirror.it : Could not resolve host: archmirror.it
warning: too many errors from archmirror.it, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from ftp.halifax.rwth-aachen.de : Could not resolve host: ftp.halifax.rwth-aachen.de
warning: too many errors from ftp.halifax.rwth-aachen.de, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from europe.mirror.pkgbuild.com : Could not resolve host: europe.mirror.pkgbuild.com
warning: too many errors from europe.mirror.pkgbuild.com, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from america.mirror.pkgbuild.com : Could not resolve host: america.mirror.pkgbuild.com
warning: too many errors from america.mirror.pkgbuild.com, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from asia.mirror.pkgbuild.com : Could not resolve host: asia.mirror.pkgbuild.com
warning: too many errors from asia.mirror.pkgbuild.com, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.lty.me : Could not resolve host: mirror.lty.me
warning: too many errors from mirror.lty.me, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.hackingand.coffee : Could not resolve host: mirror.hackingand.coffee
warning: too many errors from mirror.hackingand.coffee, skipping for the remainder of this transaction
error: failed retrieving file 'core.db' from mirror.ufscar.br : Could not resolve host: mirror.ufscar.br
warning: too many errors from mirror.ufscar.br, skipping for the remainder of this transaction
error: failed to synchronize all databases (invalid url for server)

Offline

#5 2022-03-02 19:12:05

seth
Member
Registered: 2012-09-03
Posts: 50,000

Re: [SOLVED]Power outage during upgrade

I assume what you mean by injecting a mirror is just pasting it to /bricked_system/etc/pacman.d/mirrorlist is that correct?

No, into the mirrorlist of the iso.
However the failing mirrors resolve fine here (sidenote, please use "code" tags for shell IO)

Why is the hostname "sysrescue" and what's

realpath /mnt/etc/resolv.conf
cat /mnt/etc/resolv.conf

Offline

#6 2022-03-02 19:17:55

Medeirox
Member
Registered: 2022-03-02
Posts: 8

Re: [SOLVED]Power outage during upgrade

realpath /mnt/etc/resolv.conf

returns /mnt/etc/resolv.conf and:

cat /mnt/etc/resolv.conf

returns

# Generated by NetworkManager
nameserver 192.168.15.1
nameserver fe80::f654:20ff:fe74:35b0%wlp2s0

the hostname is sysrescue because, as I told you in my second post, I moved from the arch install medium to sysrescuecd for convenience

Last edited by Medeirox (2022-03-02 19:18:18)

Offline

#7 2022-03-02 19:23:24

seth
Member
Registered: 2012-09-03
Posts: 50,000

Re: [SOLVED]Power outage during upgrade

Missed that - did you have the same resolution issues w/ the install iso?
Try to replace /mnt/etc/resolv.conf w/ /etc/resolv.conf

Offline

#8 2022-03-02 19:33:03

Medeirox
Member
Registered: 2022-03-02
Posts: 8

Re: [SOLVED]Power outage during upgrade

Yes, I did have the same issues with the iso, although I remember pacstrap and pacman throwing a corrupted pgp signature error when I ran

pacman -S linux-firmware

also, it seems like the mirrorlist pacman is using is in

/mnt/etc/pacman.d/mirrorlist

, since the I edited that file and the mirror I added showed up in the output of pacman -Syu

now, when I run

pacman --sysroot /mnt -S linux

it returns:

error: could not open file: /etc/mtab: No such file or directory
error: could not determine filesystem mount points
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

Last edited by Medeirox (2022-03-02 19:34:20)

Offline

#9 2022-03-02 19:36:53

seth
Member
Registered: 2012-09-03
Posts: 50,000

Re: [SOLVED]Power outage during upgrade

--sysroot chroots into the target root but I would have expected pacman to not draw critical infrastructure from there.
If replacing resolv.conf doesn't work, try "--root /mnt --cachedir /mnt/var/cache/pacman/pkg" (cachedir just needs to be somewhere w/ enough space)

Edit: /etc/mtab is a symlink to ../proc/self/mounts - something's severely going wrong there.

Last edited by seth (2022-03-02 19:40:14)

Offline

#10 2022-03-02 19:39:11

Medeirox
Member
Registered: 2022-03-02
Posts: 8

Re: [SOLVED]Power outage during upgrade

realpath /etc/resolv.conf

returns

/etc/resolv.conf

and

cat /etc/resolv.conf

returns

# Generated by NetworkManager
nameserver 192.168.15.1
nameserver fe80::f654:20ff:fe74:35b0%wlp2s0

Offline

#11 2022-03-02 19:43:19

Medeirox
Member
Registered: 2022-03-02
Posts: 8

Re: [SOLVED]Power outage during upgrade

replacing /mnt/etc/resolv.conf with /etc/resolv.conf didn't work, but the other command's output showed the package's architechtures were invalid, guess I'm off to using archiso again tongue

Offline

#12 2022-03-02 23:34:37

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED]Power outage during upgrade

If you post here again, please use [ code ] tags (not quote tags) when posting output. This makes the output easier to read and provides a scroll box for long output. You can also edit your previous posts to use code tags.

https://wiki.archlinux.org/title/Genera … s_and_code
https://bbs.archlinux.org/help.php#bbcode


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#13 2022-03-03 01:30:09

Medeirox
Member
Registered: 2022-03-02
Posts: 8

Re: [SOLVED]Power outage during upgrade

I went to do some other stuff but now that I came back to it it works perfectly.

pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg -Syu

didn't work at first, but that was because my gpg signatures were corrupted so the standard

pacman-key init && pacman-key --refresh-keys

made it work flawlessly
After that it was off to the corrupted packages. At this point I was already able to chroot into the bricked system, but using pacman told me a glibc file was missing. I tried doing many things but in the end I just reinstalled all the packages with

pacman --root /mnt -Qqn | pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg -S --overwrite='*'  -

and now everything works again

Thanks for your help!

Offline

Board footer

Powered by FluxBB