首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在Kubuntu22.04 -Ubuntu22.04上修复GRUB2

如何在Kubuntu22.04 -Ubuntu22.04上修复GRUB2
EN

Ask Ubuntu用户
提问于 2022-12-06 20:28:44
回答 1查看 1.2K关注 0票数 0

我在修理我的电脑。修鞋帮不了我。

fdisk -l

不显示我的SSD,只有Windows;但是我可以使用实时usb访问它。由于某种原因,我在Kubuntu上的Grub文件夹是空的。

请帮我修理一下。下面是启动-reapir的转储:https://paste.ubuntu.com/p/7ZdFFG8XbC/

代码语言:javascript
运行
复制
============================== Boot Info Summary ===============================

 => No boot loader is installed in the MBR of /dev/nvme0n1.
 => Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for (hd0,msdos1)/boot/grub. It also embeds following components:
    
    modules
    ---------------------------------------------------------------------------
    biosdisk fshelp fat exfat ext2 ntfs ntfscomp part_msdos
    ---------------------------------------------------------------------------

nvme0n1p1: _____________________________________________________________________

    File system:       vfat
    Boot sector type:  Windows 8/10/11/2012: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/Boot/bkpbootx64.efi /efi/Boot/bootx64.efi 
                       /efi/Boot/fbx64.efi /efi/Boot/mmx64.efi 
                       /efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi 
                       /efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg 
                       /efi/Microsoft/Boot/bootmgfw.efi 
                       /efi/Microsoft/Boot/bootmgr.efi

nvme0n1p2: _____________________________________________________________________

    File system:       
    Boot sector type:  -
    Boot sector info: 

nvme0n1p3: _____________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/10/11/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /Windows/System32/winload.exe

nvme0n1p4: _____________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/10/11/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  MSWIN4.1: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /boot/grub/grub.cfg /efi/boot/bootx64.efi 
                       /efi/boot/grubx64.efi /efi/boot/mmx64.efi


================================ 1 OS detected =================================

OS#1:   Windows 7 on nvme0n1p3

================================ Host/Hardware =================================

CPU architecture: 64-bit
Video: Lucienne from Advanced Micro Devices, Inc. [AMD/ATI]
Live-session OS is Ubuntu 64-bit (Ubuntu 22.04.1 LTS, jammy, x86_64)

===================================== UEFI =====================================

BIOS/UEFI firmware: H6CN08WW(V1.01)(1.8) from LENOVO
The firmware is EFI-compatible, and is set in EFI-mode for this live-session.
SecureBoot disabled (confirmed by mokutil).
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000,2001,2002,2003,0004,0001
Boot0000* ubuntu    HD(1,GPT,2c4c1aa0-9548-4d7b-be83-adb3c94a72ff,0x800,0x82000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* Linpus lite   HD(1,MBR,0x12576f,0x800,0x729b800)/File(\EFI\Boot\grubx64.efi)RC
Boot0004* Windows Boot Manager  HD(1,GPT,2c4c1aa0-9548-4d7b-be83-adb3c94a72ff,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot2001* EFI USB Device    RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

728124f6ec8e22fbdbe7034812c81b95   nvme0n1p1/Boot/bkpbootx64.efi
728124f6ec8e22fbdbe7034812c81b95   nvme0n1p1/Boot/bootx64.efi
c152ec201c37b6e97bbc2207e49d1271   nvme0n1p1/Boot/fbx64.efi
fdafb5eece6caeccb788c946a28e6872   nvme0n1p1/Boot/mmx64.efi
3795ef72a4ed0369ca44e711527904bf   nvme0n1p1/ubuntu/grubx64.efi
fdafb5eece6caeccb788c946a28e6872   nvme0n1p1/ubuntu/mmx64.efi
728124f6ec8e22fbdbe7034812c81b95   nvme0n1p1/ubuntu/shimx64.efi
8059dea463802af4a57ae85af262520f   nvme0n1p1/Microsoft/Boot/bootmgfw.efi
13e60e65f1d1f8c642a61ed9be8e65bb   nvme0n1p1/Microsoft/Boot/bootmgr.efi

============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

nvme0n1 : is-GPT,   no-BIOSboot,    has---ESP,  not-usb,    not-mmc, has-os,    has-win,    2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

nvme0n1p1   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   not-far
nvme0n1p3   : is-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios
nvme0n1p4   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios

Partitions info (2/3): _________________________________________________________

nvme0n1p1   : is---ESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p3   : isnotESP, part-has-no-fstab,  no-nt,  haswinload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p4   : isnotESP, part-has-no-fstab,  no-nt,  no-winload, recovery-or-hidden, no-bmgr,    notwinboot

Partitions info (3/3): _________________________________________________________

nvme0n1p1   : not--sepboot, no-kernel,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p3   : not--sepboot, no-kernel,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p4   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1

fdisk -l (filtered): ___________________________________________________________

Disk nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk identifier: D39B5350-4EA6-493F-AE0B-63F37A2BAA42
              Start        End   Sectors   Size Type
nvme0n1p1      2048     534527    532480   260M EFI System
nvme0n1p2    534528     567295     32768    16M Microsoft reserved
nvme0n1p3    567296  998166527 997599232 475.7G Microsoft basic data
nvme0n1p4 998166528 1000214527   2048000  1000M Windows recovery environment
Disk sda: 57.3 GiB, 61530439680 bytes, 120176640 sectors
Disk identifier: 0x0012576f
      Boot Start       End   Sectors  Size Id Type
sda1  *     2048 120176639 120174592 57.3G  c W95 FAT32 (LBA)

parted -lm (filtered): _________________________________________________________

sda:61.5GB:scsi:512:512:msdos:SanDisk Ultra:;
1:1049kB:61.5GB:61.5GB:fat32::boot, lba;
nvme0n1:512GB:nvme:512:512:gpt:WDC PC SN530 SDBPMPZ-512G-1101:;
1:1049kB:274MB:273MB:fat32:EFI system partition:boot, esp;
2:274MB:290MB:16.8MB::Microsoft reserved partition:msftres;
3:290MB:511GB:511GB:ntfs:Basic data partition:msftdata;
4:511GB:512GB:1049MB:ntfs::hidden, diag;

blkid (filtered): ______________________________________________________________

NAME        FSTYPE   UUID                                 PARTUUID                             LABEL       PARTLABEL
sda                                                                                                        
└─sda1      vfat     19FC-2E4D                            0012576f-01                          KUBUNTU 22_ 
nvme0n1                                                                                                    
├─nvme0n1p1 vfat     E4F8-2FCA                            2c4c1aa0-9548-4d7b-be83-adb3c94a72ff SYSTEM_DRV  EFI system partition
├─nvme0n1p2                                               a560499c-3ea7-4caf-9e95-ba4f9dc3a86e             Microsoft reserved partition
├─nvme0n1p3 ntfs     30A8F95FA8F923CE                     542ad10c-327d-4c1c-9a1a-8e48154df069 Windows-SSD Basic data partition
└─nvme0n1p4 ntfs     DC88FA3588FA0E30                     e60780ff-9d53-414a-849a-694589567da5 WINRE_DRV   Basic data partition

Mount points (filtered): _______________________________________________________

                        Avail Use% Mounted on
/dev/nvme0n1p1         219.1M  14% /mnt/boot-sav/nvme0n1p1
/dev/nvme0n1p3          39.5G  92% /mnt/boot-sav/nvme0n1p3
/dev/nvme0n1p4         497.3M  50% /mnt/boot-sav/nvme0n1p4
/dev/sda1               33.1G  42% /cdrom

Mount options (filtered): ______________________________________________________


=================== nvme0n1p1/efi/ubuntu/grub.cfg (filtered) ===================

search.fs_uuid 9b14d5b4-2b05-4163-ac02-b297457779b4 root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

====================== sda1/boot/grub/grub.cfg (filtered) ======================

Try or Install Kubuntu
Kubuntu (safe graphics)
OEM install (for manufacturers)
Boot from next volume
UEFI Firmware Settings
Test memory

==================== sda1: Location of files loaded by Grub ====================

           GiB - GB             File                                 Fragment(s)
            ?? = ??             boot/grub/grub.cfg                             1

======================== Unknown MBRs/Boot Sectors/etc =========================


/dev/nvme0n1p1: unknown GPT attributes
8000000000000000

/dev/nvme0n1p2: unknown GPT attributes
8000000000000000

/dev/nvme0n1p4: unknown GPT attributes
8000000000000001

Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would not act on the MBR.
Additional repair would be performed:  win-legacy-basic-fix
EN

回答 1

Ask Ubuntu用户

发布于 2022-12-08 00:53:13

重要的是,您必须具有与重新安装grub所执行的系统相同的发行版live (20.04-20.04;22.04-22.04)。他们不能工作,反之亦然,你可能得不到想要的结果。

好吧,我终于重新安装了grub。我所做的方式是:确保您是管理员:

代码语言:javascript
运行
复制
sudo -i

首先通过: sdX找到您的fdisk -l。如果看起来像这样,我们走吧:

代码语言:javascript
运行
复制
Device       Start        End    Sectors   Size Type
/dev/sda1     2048    1230847    1228800   600M EFI System
/dev/sda2  1230848    7522303    6291456     3G Linux swap
/dev/sda3  7522304 1953523711 1946001408 927.9G Linux filesystem

让我们安装我们的SSD:

代码语言:javascript
运行
复制
mount /dev/sda2 /mnt

如您所见,我的EFI系统位于主Linux文件系统中,所以如果您尝试这样做的话:

代码语言:javascript
运行
复制
grud-install --boot-directory=/mnt/boot/ /dev/sda

将导致启动将被安装,但efi将得到此错误NO EFI found.

要将此挂载efi转义到boot位置:

代码语言:javascript
运行
复制
mount /dev/sda1 /mnt/boot/efi

现在我们可以这样做:

代码语言:javascript
运行
复制
grub-install --boot-directory=/mnt/boot --efi-directory=/mnt/boot/efi /dev/sda

在此操作之后,您应该在SSD上重新安装grub,并且可以尝试从它启动。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1444326

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档