You are not logged in.
In an arch-chroot environment, I'm manually updating my initramfs image.
With
mkinitcpio -p linux
I'm getting this error:
ERROR: failed to detect root filesystem
With
pacman -S linux
I'm getting this error:
error: could not determine root mount point /
My question is, What is behind this error (what could cause it)? Where should I be looking for the problem?
Offline
Why are you in a chroot? And how exactly did you set up the chroot?
The errors are pretty clear: your root is not (properly) mounted. So in addition the answers to the above, you could post the output of `mount`.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
I'm assuming it's the same problem as https://bugs.archlinux.org/task/57251
If so, you're not on a setup you're going to be booting anyway, so why are you updating the initramfs?
Offline
Why are you in a chroot?
I'm restoring a btrfs snapshot that doesn't include a snapshot of /boot. I need to manually update the boot files to match the snapshot.
And how exactly did you set up the chroot?
arch-chroot /mnt
mount /dev/sda2 /boot
The errors are pretty clear: your root is not (properly) mounted. So in addition the answers to the above, you could post the output of `mount`.
Even with the error, after I exited the chroot environment and booted the system, it booted without errors. Once booted into the real system, I ran `mkinitcpio -p linux` again just to be sure, but there are no problems now. However, I want to understand the error. What I have gathered so far is that while in the chroot environment, I could have examined:
1. the output of `mount`
2. the contents of /etc/mtab
I am assuming I should expect to see something mounted at / in /etc/mtab while in chroot -- correct? However, the fact that in the above case, `mkinitcpio -g /boot/initramfs-linux.img -k 4.15.3-2-ARCH` created a bootable image in spite of the error probably means the root file system was actually mounted. Any thoughts? (Again, the issue is resolved in the since that my system booted up properly, but my reason for asking the question is to gain some understanding of what I should have been looking for.) Thanks
Last edited by MountainX (2018-02-21 03:41:14)
Offline
Not an Installation issue, moving to NC...
Offline
arch-chroot /mnt mount /dev/sda2 /boot
That's clearly incomplete. The arch-chroot command would have simply failed.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
MountainX wrote:arch-chroot /mnt mount /dev/sda2 /boot
That's clearly incomplete. The arch-chroot command would have simply failed.
See https://wiki.archlinux.org/index.php/Change_root
Enter a chroot
Run arch-chroot with the new root directory as first argument:
# arch-chroot /location/of/new/root
For example, in the installation guide this directory would be /mnt:
# arch-chroot /mnt
What's incomplete? I'm not sure what I'm missing or why you expect the command to have failed.
Offline
See my post, I already correctly identified the issue, it seems.
Offline
...you're not on a setup you're going to be booting anyway...
Your comment threw me. My setup is indeed intended to boot (and it does boot). I believe your second post implies that you think the issue reported at that link is still relevant even with those facts.
See my post, I already correctly identified the issue, it seems.
That bug report mentions:
run arch-chroot to a pacstrabbed directory, and / is missing from mtab.
I couldn't find any discussion of what a pacstrabbed directory is. In my case, /mnt contains a root file system on a mounted BTRFS subvolume. In that filesystem, boot is empty and it is mounted separately, as I showed.
However, my problem did start around the time of that bug report.
The bug report mentions that it is repeatable. In my case, I have seen it every time I have done this process in recent weeks. The process is restoring a BTRFS snapshot of a root filesystem where boot is on a separate volume and the kernel needs to be updated to match the root filesystem.
Last edited by MountainX (2018-02-21 14:20:48)
Offline
pacstrabbed was a typo, they meant pacstrapped. Essentially, if your root isn't a mountpoint, arch-chroot no longer takes care of that automatically for you.
Offline
pacstrabbed was a typo, they meant pacstrapped. Essentially, if your root isn't a mountpoint, arch-chroot no longer takes care of that automatically for you.
OK, thanks. I have a guess. If the contents of /etc/fstab in the mounted filesystem are important for mounting root, and both the running and the chroot environment use labels in fstab, and those labels are the same, maybe that causes the problem.
Can I manually mount the root filesystem once in the chroot environment?
Last edited by MountainX (2018-02-21 14:26:32)
Offline
When using arch-chroot, the root filesystem is being mounted at /etc/resolv.conf
The `mount` command shows:
/dev/mapper/rootsys on /etc/resolv.conf type btrfs (rw,noatime,nodiratime,compress=lzo,space_cache,subvolid=282,subvol=/@/etc/resolv.conf)
Last edited by MountainX (2018-02-24 09:45:17)
Offline
Which is correct and has nothing to do with your issue.
Offline