X13/fedora_chroot.md

41 lines
633 B
Markdown

## Find root partition
```
sudo lsblk -f
```
## Enter
- `--bind` makes the contents accessible in both locations
- `-t` defines the filesystem type.
```
sudo mount /dev/nvme0n1p5 /mnt
sudo mount /dev/nvme0n1p1 /mnt/boot/efi
sudo mount --bind /dev /mnt/dev
sudo mount -t proc /proc /mnt/proc
sudo mount -t sysfs /sys /mnt/sys
sudo mount -t tmpfs tmpfs /mnt/run
sudo mount --bind /etc/resolv.conf /mnt/etc/resolv.conf
sudo chroot /mnt
```
### Grub
```
lsblk -f -p
dnf reinstall shim-* grub2-*
grub2-mkconfig -o /boot/grub2/
```
## Exit
```
exit
umount /mnt/dev
umount /mnt/proc
umount /mnt/sys
umount /mnt/run
umount /mnt
```