You are not logged in.
Pages: 1
Problem background: Arch was previously sharing a drive with Windows. When I removed Windows, I used gparted to move boot and / "left", allowing / to be expanded into the newly free space. I was aware this might cause failure to boot, but it seemed it would be a simple matter to chroot in from a live USB and fix it afterward. It did break, of course, but now chroot seems to be broken as well. I'm doing the following from an Arch live USB, made today using the .iso from archlinux.org with GNOME Disk Utility.
root@archiso ~ # mkdir /mnt/arch
root@archiso ~ # cryptsetup luksOpen /dev/sdb4 encrypted-volume
Enter passphrase for /dev/sdb4:
root@archiso ~ # mount /dev/mapper/encrypted-volume /mnt/arch
root@archiso ~ # mount /dev/sdb3 /mnt/arch/boot
mount: /mnt/arch/boot: more filesystems detected on /dev/sdb3: use -t <type> or wipefs(8).
1 root@archiso ~ # arch-chroot /mnt/arch
chroot: failed to run command ■/bin/bash■: No such file or directoryI confirmed that /mnt/arch/bin/bash exists, so this isn't the problem.
I remember reading that the chroot failure can be caused by damaged libraries that bash depends on, but everything worked fine before I moved the partition, and I haven't tried to upgrade or install/remove anything since.
Any ideas would be greatly appreciated!
Offline
What is the output of
ls /mnt/archWhat happens when you run /mnt/arch/bin/bash ?
And did chroot always work the way you’re setting it up now?
If bash in /mnr/arch doesn’t work, you can always reinstall bash without chroot. Pacman has —root option:
pacman —root /mnt/arch -S bashLast edited by Soptik (2019-07-26 05:30:40)
Offline
do you have a separate partition for /usr? if so, you have to mount that, too. (all binaries are on /usr and / is just an empty shell... this is the reason we don't do separate / and /usr anymore)
also check what is going in with your /boot
Offline
What is the output of
ls /mnt/arch
bin boot dev proc run sys tmp usrWhat happens when you run
/mnt/arch/bin/bash?
root@archiso ~ # /mnt/arch/bin/bash
[root@archiso] ~]#It appears to work.
Did chroot always work the way you're setting it up now?
I use it so infrequently that I couldn't say whether I'm doing it the same as last time.
Do you have a separate partition for /usr?
No.
Also check what is going on with your /boot
Before mounting sdb3 to /mnt/arch/boot:
root@archiso ~ # ls /mnt/arch/boot
grub initramfs-linux.img initramfs-linux-fallback.img vmlinuz-linuxWhich doesn't seem right, as I have a separate boot partition that isn't mounted yet.
wipefs /dev/sdb3* returns:
DEVICE OFFSET TYPE UUID LABEL
sdb3 0x438 ext2 cebddc73-a4cc-4685-8328-c0cf9f102229
sdb3 0x3 ntfs 925AC7F45AC7D2E1 System ReservedThat's weird... Why's there an ntfs filesystem on my boot partition?
Offline
That's weird... Why's there an ntfs filesystem on my boot partition?
Did you install it in accordance with the official documentation? If so, you made an error.
Or, perhaps, did you use any kind of install script?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I did use the official documentation. That was about four years ago, and I don't remember much detail, but I just followed the wiki instructions. It's worked fine since.
Offline
Windows could have rambo'd the FS header in there after you attempted to make it extfs?
I'd compare the timestamps resp. "file vmlinuz-linux" outputs of the files in umounted and mounted /boot and check which partition you're actually booting from (re*naming* the files in the unmounted /boot should not change anything if you're booting from sdb3)
If the up-to-date kernel is on sdb4 and some dated ones on sdb3 you simply forgot to mount that partition before updating.
Offline
I've confirmed that the up to date kernel is on sdb3. Looks like /boot was created accidentally at some point in 2017, and isn't what I've been using to boot from.
I did the following to see if I could chroot after mounting the correct boot partition:
(using live USB)
mkdir /mnt/arch
cryptsetup luksOpen /dev/sdb4 encrypted-volume
mount /dev/mapper/encrypted-volume /mnt/arch
mv /mnt/arch/boot /mnt/arch/boot2 #rename the boot partition that shouldn't be there
mkdir /mnt/arch/boot
mount -t ext2 /dev/sdb3 /mnt/arch/boot
arch-chroot /mnt/archThis results in the same old error about /bin/bash.
After learning a bit more about the GRUB2 command line, I tried to attack the problem from a different angle:
(in GRUB rescue mode)
set prefix=(hd0,3)/grub
insmod normal
normalThis gets me out of rescue mode into the normal GRUB command line, where I can specify the initrd and kernel to use:
linux (hd0,3)/vmlinuz-linux cryptdevice=/dev/sdb4:root root=/dev/mapper/root
initrd (hd0,3)/initramfs-linux.img
bootAfter entering the password, I get the following:
:: performing fsck on '/dev/mapper/root'
/dev/mapper/root: clean, 522756/2542736 files, 3141005/10162688 blocks
******************** WARNING ***********************
* *
* The root device is not configured to be mounted *
* read-write! It may be fsck'd again later. *
* *
****************************************************
:: mounting '/dev/mapper/root' on real root
:: running cleanup hook [udev]
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on your own. Good luck.
sh: can't access tty; job control turned off
[rootfs ]#stat /sbin/init shows that it does exist, and appears to be a symlink to busybox.
Trying the above procedure with the lts or zen kernels, which were also kept up to date, results in the same output.
It seems that solving either the chroot problem OR the /sbin/init problem could get me to the point of being able to fix this. Should I start a new thread for this, or keep it all here?
Offline
From the rootfs prompt
stat /new_root/sbin/initOffline
From the rootfs promp
stat /new_root/sbin/init
No such file or directory.
Ah, that's where the contents of / are...
Offline
sbin should be a symlink to usr/bin and usr/bin/init a symlink to ../lib/systemd/systemd is one of those two links or their targets missing?
Offline
/lib/systemd/systemd is missing
/lib/systemd contains libsystemd-shared-240.so and systemd-udevd
When I add init=/lib/systemd/systemd-udevd in the kernel line in grub, I get the same error as before, but now claiming that systemd-udevd does not exist.
Offline
From the live media
pacman --root=/mnt/ -Qkk &> pacman-qkk.logThen please post the contents of pacman-qkk.log to a pastebin (see the tip box to post from the live media)
Offline
No need for a pastebin here:
error: failed to initialize alpm library
(could not find or read directory: /mnt/arch/var/lib/pacman/)/mnt/arch/var doesn't exist.
root@archiso /mnt/arch # find . -name "pacman"
./usr/share/bash-completion/completions/pacman
./usr/share/pacman
./usr/bin/pacmanLast edited by Empanada (2019-07-27 21:43:32)
Offline
According to #4 there isn't even a /var directory - is /var usually an extra partition?
Offline
Pages: 1