使用 bootadm 命令的 remove-entry 子命令从 GRUB 菜单删除指定项或以逗号分隔的项列表。如果指定带有同一标题的多个项,则会删除带有此标题的所有项。
# bootadm list-menu
# bootadm remove-entry [-P pool] [{entry-title [,entry-title...] | -i entry-number[,entry-number...]}
# bootadm list-menu
以下示例显示了从 GRUB 菜单删除项编号 2 的操作。
# bootadm list-menu The location of the boot loader configuration file is /rpool/boot/grub default 2 console graphics timeout 30 0 Oracle Solaris 11/11 1 Oracle Solaris 11.2 2 Oracle Solaris 11_test bootadm remove-entry -i 2 1 entry removed # bootadm list-menu The location of the boot loader configuration file is /rpool/boot/grub default 2 console graphics timeout 30 0 Oracle Solaris 11/11 1 Oracle Solaris 11.2