首页 > 其他 > 详细

支持UEFI和LEGACY的多系统安装U盘

时间:2020-04-02 11:02:24      阅读:151      评论:0      收藏:0      [点我收藏+]

bootloader

# https://www.slant.co/topics/4820/~linux-bootloaders
1. GNU GRUB
2. Syslinux
3. rEFInd
4. Clover Bootloader
5. BURG
6. systemd-boot (Gummiboot)
7. LILO

disk partion

1. gparted
设置分区表GPT,新建主分区FAT32,格式化分区FAT32,设置分区flag为boot

2. gdisk
剩余1M空间创建分区, GUID设置为ef02(BIOS boot partition),不需要格式化

3. 分区信息
sudo parted /dev/sdd print
Number  Start   End     Size    File system  Name                 Flags
 1      1049kB  61.5GB  61.5GB  fat32                             boot, esp
 2      61.5GB  61.5GB  1032kB               BIOS boot partition  bios_grub

install grub

# 挂载分区
sudo mount /dev/sdd1 /mnt -o uid=$USER,gid=$USER

# x86_64: grub-efi-amd64-bin
sudo grub-install --target=i386-pc --boot-directory=/mnt/boot /dev/sdd --recheck
sudo grub-install --target=x86_64-efi --efi-directory=/mnt --boot-directory=/mnt/boot /dev/sdd --removable

# arm64: grub-efi-arm64-bin
sudo grub-install --target=i386-pc --boot-directory=/mnt/boot /dev/sdd --recheck
sudo grub-install --target=arm64-efi --efi-directory=/mnt --boot-directory=/mnt/boot /dev/sdd --removable

Kylin桌面安装光盘grub.cfg

# Kylin-4.0.2-desktop-sp2-181112.J1-arm64
set default=liveinstall
set timeout=3

if loadfont /boot/grub/font.pf2 ; then
    set gfxmode=auto
    insmod efi_gop
    insmod efi_uga
    insmod gfxterm
    terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Try Kylin without installing" --id liveinstall {
    set gfxpayload=keep
    linux    /casper/Image boot=casper rootwait ro KEYBOARDTYPE=pc KEYTABLE=us ignore_uuid quiet 
    initrd    /casper/initrd.img
}

Kylin服务器安装光盘grub.cfg

# Kylin-4.0.2-desktop-sp2-181112.J1-arm64
set default=install
set timeout=3

if loadfont /boot/grub/font.pf2 ; then
    set gfxmode=auto
    insmod efi_gop
    insmod efi_uga
    insmod gfxterm
    terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Start to Install Kylin OS" --id install {
    set gfxpayload=keep
    linux    /casper/Image rootwait ro KEYBOARDTYPE=pc KEYTABLE=us console=tty1 ignore_uuid quiet 
    initrd    /casper/initrd.img
}

支持UEFI和LEGACY的多系统安装U盘

原文:https://www.cnblogs.com/liujitao79/p/12617544.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!