0

There are two disk on my pc,windows and debian already installed in /dev/sdb,/dev/sda left for archlinux.Show all my script during archlinux installation.

mount  /dev/sda1  /mnt
swapon /dev/sda2
pacstrap /mnt base linux linux-firmware vim nano
getfstab -U /mnt >>  /mnt/etc/fstab
arch-chroot /mnt
mkdir /boot/efi
mount  /dev/sda3  /boot/efi   
pacman -S grub efibootmgr os-prober
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-di=grub
grub-mkconfig -o /boot/grub/grub.cfg
passwd

After installation,i reboot my pc ,the grub gui contains no startup menu for my windows and debian ,i can enter into archlinux only from the grub gui,how to write the proper grub command for my purpose?

1
  • Are Windows & Debian also installed in UEFI boot mode? Lets see details, use ppa version with your live installer (2nd option) or any working install, not Boot-Repair ISO: Please copy & paste the pastebin link to the Boot-info summary report ( do not post report), do not run the auto fix till reviewed. help.ubuntu.com/community/Boot-Repair – oldfred Jan 25 at 3:29
0

Reboot into archlinux and execute:

grub-mkconfig -o /boot/grub/grub.cfg

The grub.cfg contains the main content(omit many unimportant lines):

menuentry 'Arch Linux (on /dev/sda1)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-6a89fa29-fbc4-4f75-9615-c3cd537f688f' {
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  6a89fa29-fbc4-4f75-9615-c3cd537f688f
    else
      search --no-floppy --fs-uuid --set=root 6a89fa29-fbc4-4f75-9615-c3cd537f688f
    fi
    linux /boot/vmlinuz-linux root=UUID=6a89fa29-fbc4-4f75-9615-c3cd537f688f rw loglevel=3 quiet
    initrd /boot/initramfs-linux.img
}

menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-8006ce1b-3c44-4248-acd7-5a14a7bb1e49' {
    load_video
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt4'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  8006ce1b-3c44-4248-acd7-5a14a7bb1e49
    else
      search --no-floppy --fs-uuid --set=root 8006ce1b-3c44-4248-acd7-5a14a7bb1e49
    fi
    echo    'Loading Linux 4.19.0-13-amd64 ...'
    linux   /boot/vmlinuz-4.19.0-13-amd64 root=UUID=8006ce1b-3c44-4248-acd7-5a14a7bb1e49 ro  quiet
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-4.19.0-13-amd64
}

menuentry 'Windows Boot Manager (on /dev/sdb2)' --class windows --class os $menuentry_id_option 'osprober-efi-A4BB-9CC3' {
    insmod part_gpt
    insmod fat
    set root='hd1,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  A4BB-9CC3
    else
      search --no-floppy --fs-uuid --set=root A4BB-9CC3
    fi
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

I am not satisfied with the solution,during debian's installation , at the end stage,it will be detected all os installed and write them all into grub.cfg,maybe archlinux can do too.The key commands are:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-di=grub
grub-mkconfig -o /boot/grub/grub.cfg 

Maybe they lack some argument(s).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.