this post was submitted on 30 Sep 2024
25 points (96.3% liked)
Linux
48185 readers
1175 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
That's alright, I'll do my best to walk you through it.
Your drive contains multiple partitions (/dev/sda1 through /dev/sda3).
One of these drives is going to be your EFI partition. This is what your system can read before linux boots, your BIOS can't understand ext4 / btrfs / etc, but it can understand fat32.
If you run
lsblk -no FSTYPE /dev/sda1
it should return vfat if that's your EFI partition. That's what we're going to mount to /mnt/boot/efiI'm assuming that /dev/sda3 is your data partition, e.g. where your linux install is. You can find the filesystem format the same way as your EFI partition. Edit: After determining which partition is which, you're going to want to mount the root partition, and then the EFI partition
mount /dev/sda3 /mnt
mount /dev/sda1 /mnt/boot/efi
Unix systems have theology of "everything is a file", all devices and system interfaces are mounted as files. As such, to be able to properly chroot into an offline install, we need to make binds from our running system to the offline system. That's what's achieved by running
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
This is just a simple loop that mounts /dev, /dev/pts, /proc, /sys, and /run to your offline install. You're going to want to either add /sys/firmware/efi/efivars to that list, or mount it (with -B, which is shorthand for --bind, not a normal mount).
Once you've done this, you should be able to successfully chroot into /mnt (or /mnt/root if running btrfs)
At this point, you should be able to run your grub repair commands.
Here is what I'm getting after running through the steps you kindly gave me. The second part is the part where I'm probably not doing right..
Apologies, I think I got a bit ahead of myself in the description.
Once you've determined which partition is which (in your case, /dev/sda1 does appear to be the EFI partition, and /dev/sda3 appears to be your root partition), you need to mount them in this order
mount /dev/sda3 /mnt
mount /dev/sda1 /mnt/boot/efi
Here's what I'm getting:
Could you send me the output of
lsblk -no FSTYPE /dev/sda3
andll /mnt
?Hi again. Here is what it gave me:
Since you're using btrfs, there is likely another subfolder under /mnt. ll /mnt will tell you this, but the drive isn't still mounted from the other day. When you're mounting the EFI partition, you're going to want to mount it to that folder, and not /mnt itself (/mnt/root/boot/efi, instead of /mnt/boot/efi) same for the binds (/dev, /proc, /run, etc)
Here is what I'm getting.
I'm almost ready to give up on my dream of establishing a perfectly tuned version of Fedora that I can deploy on all my computer just through Clonezilla..
Interesting, both of my F40 installs with btrfs only have a root folder, but it looks like yours has created separate ones for /, /home, and /boot. run
ll /mnt/boot; ll /mnt/home; ll /mnt/root
so I can take a quick look at where things are located. My best guess is that sda1 gets mounted to /mnt/boot, while everything else (/dev, /sys, etc) gets mounted to /mnt/rootHere's what I'm getting:
I don't think I've set up anything particular, so I guess my install is different than yours because Fedora changed something. But clearly that change doesn't help me;-)