Linux陷入grub rescue模式,求助一次性获取所需全部.mod文件
Hey there, let's sort out this GRUB rescue mess for you. It’s super frustrating when it keeps asking for one module after another—here’s how to grab all the critical ones you need, plus the smarter way to fix the root problem instead of chasing individual files.
Core GRUB Modules You’ll Definitely Need
These are the essential modules GRUB relies on to boot normally, so you’ll want to make sure all of these are present:
normal.mod: You already have this one—it’s the foundation for loading the full GRUB menuterminal.mod: The one your system’s asking for right now, enables interactive terminal supportlinux.mod: Lets GRUB load your Linux kernelinitrd.mod: Handles loading the initramfs/initrd image required for bootpart_msdos.modorpart_gpt.mod: Depends on your disk’s partition table (MBR = msdos, GPT = gpt)ext2.mod/ext3.mod/ext4.mod: Match the filesystem of your/bootpartition (most modern systems use ext4)search.mod: Helps GRUB locate your system partitions and config filesconfigfile.mod: Loads yourgrub.cfgconfiguration file to show the boot menuecho.mod: Useful for debugging and printing status messages
The Smart Way: Don’t Download Modules Individually
Instead of hunting down each .mod file one by one (which risks version mismatches), do this:
- Boot from a Linux Live USB/CD: Grab a bootable disk for your distro (Ubuntu, Fedora, etc.)—this will let you access your system’s files.
- Mount your system partition: Once in the Live environment, mount your root partition (and
/bootseparately if it’s a dedicated partition) to a directory like/mnt. - Copy all GRUB modules: Navigate to
/mnt/boot/grub/<your-architecture>/(replace<your-architecture>withx86_64-efifor UEFI systems, ori386-pcfor BIOS). Copy all the.modfiles here to the same directory on your system (if the module folder was corrupted). - Reinstall GRUB entirely (even better): To fix the problem permanently, run the GRUB install command from the Live system. For example:
Replacegrub-install --root-directory=/mnt /dev/sda/dev/sdawith your actual disk device (not a partition like/dev/sda1). This will automatically deploy all necessary modules and rebuild the bootloader correctly.
If You Must Download Individual Modules
If you can’t use a Live system, make sure you download modules that match your GRUB version exactly (check with grub-install --version if you can access it). You can extract the modules from your distro’s GRUB package (e.g., grub2-common on Debian/Ubuntu, grub2 on RHEL/CentOS) instead of grabbing random files online—this avoids compatibility issues.
内容的提问来源于stack exchange,提问作者user781043

