You are not logged in.

#1 2015-07-25 05:39:26

kabads
Member
Registered: 2012-09-22
Posts: 271
Website

mkinitcpio in chroot not working

So, it's finally happened. One of my laptops isn't booting so I want to rescue it with an cdrom. I created an .iso disk from the 2015-07-01 release and the cdrom boots fine.

mkdir /mnt/arch
mount /dev/sda5 /mnt/arch
arch-chroot /mnt/arch

I get a prompt in the chroot, but this is where things get a little strange. I cannot 'ls' any files. They are there as I can change directory etc. but cannot see files.

So when I try

mkinitcpio -p linux

I get:

==> ERROR: Unable to write to path: `/boot/initramfs-linux-fallback.img'

I didn't mount my /boot partition as it is already on /dev/sda5.
What might be going wrong here?

Last edited by kabads (2015-07-25 05:39:39)

Offline

#2 2015-07-25 07:10:00

Awebb
Member
Registered: 2010-05-06
Posts: 6,304

Re: mkinitcpio in chroot not working

If you "cannot $VERB $ACTION", don't just tell us. Give us an error message or a description of the failure.

Offline

#3 2015-07-25 07:10:11

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: mkinitcpio in chroot not working

kabads wrote:

So when I try

mkinitcpio -p linux

I get:

==> ERROR: Unable to write to path: `/boot/initramfs-linux-fallback.img'

I didn't mount my /boot partition as it is already on /dev/sda5.

Do you mean you do NOT have a separate boot partition? Then, what is the output of the following command outside the chroot?

# lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,MODE
kabads wrote:

I get a prompt in the chroot, but this is where things get a little strange. I cannot 'ls' any files. They are there as I can change directory etc. but cannot see files.

That's weird, can you post the output of the following commands when executed inside the chroot?

# ls -a -l /
# dir -a -l /
# uname -a
# which ls
# pacman -Qkk

--edit: Sorry Awebb, we were posting at the same time tongue

Last edited by mauritiusdadd (2015-07-25 07:11:48)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#4 2015-07-25 08:21:26

kabads
Member
Registered: 2012-09-22
Posts: 271
Website

Re: mkinitcpio in chroot not working

I do not have a separate boot partition.

$ lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,MODE
lsblk: error while loading shared libraries: /usr/lib/libudev.so.1: file too short
$ ls -al /

(no output)

$ dir -a -l 

(no output)

$ uname -a

(no output)

$ which ls 
/usr/bin/ls
$ pacman -Qkk
pacman: error while loading shared libraries: /usr/lib/libcrypto.so.1.0.0: file too short

Last edited by kabads (2015-07-25 08:22:33)

Offline

#5 2015-07-25 09:16:16

Awebb
Member
Registered: 2010-05-06
Posts: 6,304

Re: mkinitcpio in chroot not working

Exit the chroot environment and try looking up those files in /mnt/arch. This problem goes beyond mkinitcpio not working in a chroot, this is probably the reason the laptop refuses to boot.

Now would be a good time to do some standard diagnostics. Try salvaging the logs from the damaged system, fsck all partitions, backup files.

Offline

#6 2015-07-25 16:20:21

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: mkinitcpio in chroot not working

And after that, it can be useful to understand how much the damage is extended and if the system is recoverable:  if the database files are not corrupted you can use the following command in the live-cd to check what files are damaged:

# pacman --root /mnt/arch --dbpath /mnt/arch/var/lib/pacman -Qkk

You may also want to check if your drive is failing: https://wiki.archlinux.org/index.php/S.M.A.R.T.


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

Board footer

Powered by FluxBB