efibootmgr

原来装的是fedora 30,升级到kernel 5.10后,发现bcc不能用了。提示说要升级到fedora 32。装完32后发现efiboomgr里面只有一个Fedora,也就是说原来的fedora 30不见了,虽然磁盘没有丢,但是没法启动了。可以用下面的命令添加一项:

efibootmgr -c -d /dev/sda -p 1 -L "fedora_30" -l "\EFI\fedora\grubx64.efi"
[root@dev-r630-03 ~]# efibootmgr  -v
BootCurrent: 0002
BootOrder: 0002,000B,0004,000A,0000,0005,0001,0009
Boot0000* EFI DVD/CDROM 1       PciRoot(0x0)/Pci(0x1f,0x2)/Sata(5,0,0)
Boot0001* EFI Fixed Disk Boot Device 2  PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/Ctrl(0x0)/SCSI(0,0)/HD(8,GPT,5ae86511-18c5-4cce-9c52-f043a8cc85b9,0x2e04a000,0x7d0000)
Boot0002* fedora_30     HD(1,GPT,4004c230-3cf3-4a82-be89-ec16eb03b8ee,0x800,0x200000)/File(\EFI\fedora\grubx64.efi)
Boot0004* Fedora        HD(10,GPT,355a9883-4efb-4a22-ac35-3a327f73d98d,0x2ea1a000,0x200000)/File(\EFI\fedora\shimx64.efi)
Boot0005* Integrated NIC 1 Port 1 Partition 1   VenHw(3a191845-5f86-4e78-8fce-c4cff59f9daa)
Boot0006* PLDS DVD-ROM DU-8D5LH BBS(CDROM,PLDS DVD-ROM DU-8D5LH,0x0)........................_...................................................... ......A.........................P.L.D.S. .D.V.D.-.R.O.M. .D.U.-.8.D.5.L.H...
Boot0007* Hard drive C: VenHw(d6c0639f-c705-4eb9-aa4f-5802d8823de6)............................f.........................................................A.....................P.E.R.C. .H.3.3.0. .M.i.n.i.(.b.u.s. .0.3. .d.e.v. .0.0.)...
Boot0008* BRCM MBA Slot 0100 v20.6.1    BBS(128,BRCM MBA Slot 0100 v20.6.1,0x0)................f...........K.........................................................A.....................B.R.C.M. .M.B.A. .S.l.o.t. .0.1.0.0. .v.2.0...6...1...
Boot0009* EFI Fixed Disk Boot Device 3  PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/Ctrl(0x0)/SCSI(0,0)/HD(9,GPT,d023a8f8-6ebe-4c32-95cb-9bbae2898a21,0x2e81a000,0x200000)
Boot000A* CentOS        HD(1,GPT,4004c230-3cf3-4a82-be89-ec16eb03b8ee,0x800,0x200000)/File(\EFI\centos\shimx64.efi)
Boot000B* debian        HD(1,GPT,4004c230-3cf3-4a82-be89-ec16eb03b8ee,0x800,0x200000)/File(\EFI\debian\shimx64.efi)
[root@dev-r630-03 ~]# lsblk -o name,label,partlabel,mountpoint,size,uuid,fstype
NAME                    LABEL          PARTLABEL            MOUNTPOINT   SIZE UUID                                   FSTYPE
sda                                                                    744.6G
├─sda1                                 EFI System Partition /boot/efi      1G 9EE3-0D4B                              vfat
├─sda2                                                                     5G a1087fdc-2a09-446f-9706-a5a660ecfc07   xfs
├─sda3                                                                     4G ifesXM-xZe0-cwvC-6n1j-3oBq-PVQh-fU3FNL LVM2_member
│ └─centos-swap                                                            4G d89ab943-ae5f-4d8f-9417-535664c16ea5   swap
├─sda4                                                                    60G eLQ58j-hVYE-nWOO-0FBA-9R6j-MwqD-djj4nF LVM2_member
│ └─centos75--trex-root                                                   60G b9dda5b2-e4e0-4bdd-a534-e068abbceb43   xfs
├─sda5                  fedora_30_boot                      /boot          5G 921afd5a-f634-40ff-abe4-dd111eb0ef15   ext4
├─sda6                                                                   200G g2aoog-09yr-UrEM-NHBT-SfTC-CnTT-eQlXPg LVM2_member
│ └─fedora_30-root                                          /            200G 0f0654b2-7f06-44d4-850c-5b04dd7d50b2   xfs
├─sda7                                 debian9.9                        93.1G 49239db6-e540-4e0e-84bd-13d7c04152f4   ext4
├─sda8                                 fedora                            3.9G 7B68-0C99                              vfat
├─sda9                                 EFI System Partition                1G D18C-DE2E                              vfat
├─sda10                                EFI System Partition                1G 1B0E-30D0                              vfat
├─sda11                                                                    5G f6136c0a-4620-45a6-9cd9-e08e0759f4b5   xfs
├─sda12                                                                  150G 4dvyap-RcbF-UyTH-ekR6-L591-oFfT-Q00cx8 LVM2_member
│ └─fedora_32-root                                                       150G 060dc6cb-9793-467a-8147-7adb10bc66c8   xfs
└─sda13                                                                 93.1G 61772f1e-0021-4aa1-a3b9-82f2322291e7   ext4
sr0                                                                     1024M

如果是ext2/3/4格式的文件系统,可以通过下面的命令添加label

e2label /dev/sda5 fedora_30_boot

用gdisk可以编辑PARTLABEL:

[root@dev-r630-03 ~]# gdisk
GPT fdisk (gdisk) version 1.0.4

Type device filename, or press <Enter> to exit: /dev/sda
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): ?
b       back up GPT data to a file
c       change a partition's name
d       delete a partition
i       show detailed information on a partition
l       list known partition types
n       add a new partition
o       create a new empty GUID partition table (GPT)
p       print the partition table
q       quit without saving changes
r       recovery and transformation options (experts only)
s       sort partitions
t       change a partition's type code
v       verify disk
w       write table to disk and exit
x       extra functionality (experts only)
?       print this menu

Command (? for help): i
Partition number (1-13): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 4004C230-3CF3-4A82-BE89-EC16EB03B8EE
First sector: 2048 (at 1024.0 KiB)
Last sector: 2099199 (at 1025.0 MiB)
Partition size: 2097152 sectors (1024.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'EFI System Partition'

Command (? for help): p
Disk /dev/sda: 1561591808 sectors, 744.6 GiB
Model: PERC H330 Mini
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 431FE424-5C77-48B8-94EE-0DE85E4E36D8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1561591774
Partitions will be aligned on 2048-sector boundaries
Total free space is 256774077 sectors (122.4 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         2099199   1024.0 MiB  EF00  EFI System Partition
   2         2099200        12584959   5.0 GiB     0700
   3        12584960        20981759   4.0 GiB     8E00
   4        20981760       146819071   60.0 GiB    8E00
   5       146819072       157304831   5.0 GiB     8300
   6       157304832       576743423   200.0 GiB   8E00
   7       576743424       772055039   93.1 GiB    8300  debian9.9
   8       772055040       780247039   3.9 GiB     0700  fedora
   9       780247040       782344191   1024.0 MiB  EF00  EFI System Partition
  10       782344192       784441343   1024.0 MiB  EF00  EFI System Partition
  11       784441344       794927103   5.0 GiB     8300
  12       794927104      1109508095   150.0 GiB   8E00
  13      1109508096      1304819711   93.1 GiB    8300
Command (? for help): c
Partition number (1-13): 13
Enter name: debian10.7
Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值