多系统引导故障:安装Kali Linux与Ubuntu后Grub无法识别Arch Linux
Hey there, let's get your Arch Linux back in the Grub boot menu! I’ve dealt with this exact multi-boot headache before, so let’s walk through the fix step by step, tailored to your Btrfs setup on /dev/sda2.
Step 1: Mount your Arch Linux partition
First, boot into either Ubuntu or Kali (whichever you can access right now) and open a terminal. We need to mount your Arch partition to access its boot files:
- Create a temporary mount point:
sudo mkdir /mnt/arch - Mount the Btrfs partition. If you didn’t use subvolumes when setting up Arch, run:
sudo mount /dev/sda2 /mnt/arch - If you did use subvolumes (super common for Arch Btrfs setups, usually named
@or@root), first check what subvolumes exist after mounting the raw partition:sudo btrfs subvolume list /mnt/arch
Then mount the correct subvolume, for example:sudo mount -o subvol=@ /dev/sda2 /mnt/arch
Step 2: Locate Arch’s kernel and initramfs files
Next, confirm the exact names of your Arch kernel and initramfs—they live in the /boot directory of your Arch install:ls /mnt/arch/boot
You’ll see files like vmlinuz-linux and initramfs-linux.img (there might be a fallback version too, but we’ll use the default ones). Jot these names down if you need to.
Step 3: Add a custom Grub entry for Arch
We’ll edit Grub’s custom configuration file (this won’t get overwritten by future update-grub runs):
- Open the custom file with nano:
sudo nano /etc/grub.d/40_custom - Scroll to the end of the file and paste the following entry, adjusting it to match your setup:
menuentry "Arch Linux" { # Load the right partition module (use part_gpt if your disk uses GPT, part_msdos for MBR) insmod part_msdos insmod btrfs # Set the root to your Arch partition: hd0 is your first disk, msdos2 is the 2nd partition on MBR; use gpt2 for GPT set root='hd0,msdos2' # Point to your kernel, set root partition, and add subvolume flag if needed linux /vmlinuz-linux root=/dev/sda2 rw rootflags=subvol=@ # Point to your initramfs file initrd /initramfs-linux.img }
Quick notes on adjustments:
- If your disk uses GPT instead of MBR, replace
part_msdoswithpart_gptandmsdos2withgpt2in theset rootline. - If you don’t use subvolumes, remove the
rootflags=subvol=@part from thelinuxline. - Double-check the kernel/initramfs filenames match what you saw in
/mnt/arch/boot.
Save the file by pressing Ctrl+O, then exit nano with Ctrl+X.
Step 4: Update Grub and test
Finally, update the Grub configuration to include your new custom entry:sudo update-grub
You should see a line saying it detected your custom Arch entry. Now reboot your system—Arch Linux should show up in the Grub menu!
If something doesn’t work, double-check that you mounted the correct partition/subvolume and that the paths in the menu entry match your actual files.
备注:内容来源于stack exchange,提问作者Aditya Singh

