I have a system dual booted with Windows 10 and Linux on it for some reason I'm getting "You need to load the kernel first" error on the grub menu so someone has advised me to boot from a live usb and chroot into the compromised system, but before chrooting they have also advised to mount the /run and /boot, So my question is how do I mount the /run filesystem? Since I've read it's type is tmpfs so do I need to do "sudo mount -t tmpfs run /mnt/run"? And what about the "/boot" cause I'm running an UEFI system and have already mounted "/boot/efi" partition on "/mnt/boot/efi".
1 Answer
The command would be:
sudo mount -t tmpfs run /mnt/run
since your root filesystem is mounted at /mnt
.
Here's what I'm usually using to chroot into Debian-like systems (incl. Ubuntu). You should execute these while in /mnt
or use absolute paths instead.
mount --bind /etc/resolv.conf etc/resolv.conf
mount --bind /dev dev
mount -t tmpfs tmpfs tmp
mount -t sysfs sys sys
mount -t proc proc proc
chroot .
mount -a
As you can see /run
is not there, although adding it could be a good idea. /boot
should get mounted by mount -a
, which mounts everything the system would mount on boot.
-
Apologies since I'm very new to the concept of chrooting, I'm a little confused on where to mount as you've said that the command should be
sudo mount -t tmpfs run /run
but on the other hand the person that suggested me to chroot said this "Try booting to the live usb, then mount the fedora / partition at /mnt, the /boot partition at /mnt/boot, and the /boot/efi partition at /mnt/boot/efi. Then you will need to mount /sys at /mnt/sys, /run at /mnt/run, /proc at /mnt/proc, and /dev at /mnt/dev to support the chroot environment."– ansmeCommented Mar 16, 2021 at 12:37 -
@ansme Ok, for some reason I've assumed you're already chrooted. If your root filesystem is mounted at
/mnt
then the path will indeed be/mnt/run
. Commented Mar 16, 2021 at 12:41