我的电脑是 HP Pavillion g4 笔记本电脑,我做了一些修改,例如安装 120GB SSD 驱动器、用 120GB HDD 驱动器替换 CD 驱动器以及将 RAM 从 4GB 扩展到 8GB。
当我安装 Ubuntu 时,我通常使用“擦除磁盘并安装 Ubuntu”选项,并且一直有效,直到上个月我尝试启动我的电脑时显示错误,当我返回 grub 时启动菜单出现故障所以我认为它需要重新安装,但是当我通过“擦除磁盘并安装 Ubuntu”安装 Ubuntu 时,我重新启动后它说unable to read and write outside of hd0
和error: you need to load the kernel first
。
我尝试了这里显示的一些解决方案:当我收到“尝试读取或写入磁盘‘hd0’之外的内容”错误并且启动修复无法解决问题时该怎么办?包括启动修复。
第一个:
grub rescue > ls
(hd0) (hd0, msdos9)
grub rescue > ls (hd0,msdos9)/
grub rescue > ls (hd0,msdos8)/
grub rescue > ls (hd0,msdos5)/ # suppose this is root and bootloader of Linux
grub rescue > ls (hd0,msdos5)/
grub rescue > set root=(hd0,msdos5)
grub rescue > set prefix=(hd0,msdos5)/boot/grub
grub rescue > insmod normal
grub rescue > normal
我的分区不同,但我设法使用ls
命令找到它们。
添加 19/11/2024:分区是 GPT,所以我认为它可能支持 UEFI,但我仍然无法启动。
我尝试的另一种解决方案是创建一个 1024MB 的 ext4 分区,/boot
该分区部分有效,但是......
- 启动时间太长了,说真的,我可以打开电脑,做早餐,看一些视频,但它仍然启动时出现黑屏,延迟太多才显示 Ubuntu plymouth 屏幕,有时会导致超时或内核崩溃。
- 破坏了一些工具,比如 haxeflixel(我认为),在此问题之前,我没有遇到任何问题,但当我使用
/boot
分区启动时。它可以工作,但有很多错误,其中之一是“分段错误”。
当我安装其他基于 Ubuntu 的发行版(如 Linux Mint 或 Elementary OS)时也会发生这种情况,我总是在 SSD 上安装 Ubuntu,我的 PC 不支持 GPT,所以我必须使用 mbr。我使用 Rufus 从 Windows 制作了启动驱动器。
编辑 19/11/2024:当我尝试https://paste.ubuntu.com/p/hw3vFSmpKs/时,我设法获得了一个 pastebin
============================= Boot Repair Summary ==============================
Recommended repair: ____________________________________________________________
The default repair of the Boot-Repair utility will purge (in order to reset grubenv) and reinstall the grub2 of
sda2 into the MBR of sda.
Grub-efi will not be selected by default because no ESP detected.
Additional repair will be performed: unhide-bootmenu-10s
chroot /mnt/boot-sav/sda2 apt-get -y update
Running in chroot, ignoring command 'start'
Purge the GRUB of /dev/sda2
grub-pc available
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 210 not upgraded.
DEBCHECK debOK, grub-pc
DEBCHECK debOK
Please type: sudo chroot "/mnt/boot-sav/sda2" dpkg --configure -ansudo chroot "/mnt/boot-sav/sda2" apt-get install -fynsudo chroot "/mnt/boot-sav/sda2" apt-get purge --allow-remove-essential -y grub-com*nsudo chroot "/mnt/boot-sav/sda2" apt-get purge --allow-remove-essential -y grub2-com*nsudo chroot "/mnt/boot-sav/sda2" apt-get purge --allow-remove-essential -y shim-signednsudo chroot "/mnt/boot-sav/sda2" apt-get purge --allow-remove-essential -y grub-common:*nsudo chroot "/mnt/boot-sav/sda2" apt-get purge --allow-remove-essential -y grub2-common:*n
Then type: sudo chroot "/mnt/boot-sav/sda2" apt-get install -y grub-pc
Unhide GRUB boot menu in sda2/etc/default/grub
====================== Reinstall the grub-pc of /dev/sda2 ======================
chroot /mnt/boot-sav/sda2 grub-install --version
grub-install (GRUB) 2.12-1ubuntu7
==> Reinstall the GRUB of /dev/sda2 into the MBR of /dev/sda
chroot /mnt/boot-sav/sda2 grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
chroot /mnt/boot-sav/sda2 update-grub
Sourcing file `/etc/default/grub'
Found linux image: /boot/vmlinuz-6.8.0-41-generic
Found initrd image: /boot/initrd.img-6.8.0-41-generic
Adding boot menu entry for UEFI Firmware Settings ...
Unhide GRUB boot menu in sda2/boot/grub/grub.cfg
Boot successfully repaired.
You can now reboot your computer.
Please do not forget to make your BIOS boot on sda (ATA HP SSD S600 120G) disk!
The boot files of [sda2 (end>100GB)] are far from the start of the disk. Your BIOS may not detect them. You may want to retry after creating a /boot partition (EXT4, >200MB, start of the disk). This can be performed via tools such as gParted. Then select this partition via the [Separate /boot partition:] option of [Boot Repair]. (https://help.ubuntu.com/community/BootPartition)
```none
============================ Boot Info After Repair ============================
=> Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 2048
of the same hard drive for core.img. core.img is at this location and
looks for (,gpt2)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_gpt biosdisk
---------------------------------------------------------------------------
=> Grub2 (v1.99-2.00) is installed in the MBR of /dev/sdb and looks at sector
58715260 of the same hard drive for core.img, but core.img can not be
found at this location.
=> Grub2 (v2.00) is installed in the MBR of /dev/sdc 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 part_msdos fshelp fat ntfs exfat
---------------------------------------------------------------------------
sda1: __________________________________________________________________________
File system: BIOS Boot partition
Boot sector type: Grub2's core.img
Boot sector info:
sda2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 24.04.1 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
sdb1: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sdc1: __________________________________________________________________________
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 (linux): Ubuntu 24.04.1 LTS on sda2
================================ Host/Hardware =================================
CPU architecture: 64-bit
Video: 2nd Generation Core Processor Family Integrated Graphics Controller from Intel Corporation
Live-session OS is Ubuntu 64-bit (Ubuntu 24.04.1 LTS, noble, x86_64)
===================================== UEFI =====================================
BIOS/UEFI firmware: F.66(15.102) from Insyde
This live-session is in Legacy/BIOS/CSM mode (not in EFI mode).
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : is-GPT, hasBIOSboot, has-noESP, not-usb, not-mmc, has-os, no-wind, 2048 sectors * 512 bytes
sdb : is-GPT, no-BIOSboot, has-noESP, not-usb, not-mmc, no-os, no-wind, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda2 : is-os, 64, apt-get, grub-pc , grub2, grub-install, grubenv-ng, update-grub, end-after-100GB
sdb1 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
Partitions info (2/3): _________________________________________________________
sda2 : isnotESP, fstab-without-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdb1 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot,
Partitions info (3/3): _________________________________________________________
sda2 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, std-grub.d, sda
sdb1 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdb
fdisk -l (filtered): ___________________________________________________________
Disk sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk identifier: 12D46356-934D-4D7E-9872-E4C77430651D
Start End Sectors Size Type
sda1 2048 4095 2048 1M BIOS boot
sda2 4096 234438655 234434560 111.8G Linux filesystem
Disk sdb: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk identifier: 4C9C1BF6-251D-4B61-86CC-7A7636193869
Start End Sectors Size Type
sdb1 2048 234438655 234436608 111.8G Linux filesystem
Disk sdc: 29.49 GiB, 31666995200 bytes, 61849600 sectors
Disk identifier: 0x0b08ce25
Boot Start End Sectors Size Id Type
sdc1 * 2048 61849599 61847552 29.5G c W95 FAT32 (LBA)
parted -lm (filtered): _________________________________________________________
sda:120GB:scsi:512:512:gpt:ATA HP SSD S600 120G:;
1:1049kB:2097kB:1049kB:::bios_grub;
2:2097kB:120GB:120GB:ext4::;
sdb:120GB:scsi:512:512:gpt:ATA FUJITSU MHW2120B:;
1:1049kB:120GB:120GB:::;
sdc:31.7GB:scsi:512:512:msdos:Generic Flash Disk:;
1:1049kB:31.7GB:31.7GB:fat32::boot, lba;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 858dfb0d-3d56-4566-b7d6-9ed8594070b7
└─sda2 ext4 81808195-6491-4c20-8ed7-35ebee622523 09f3ace7-51d7-4f26-aed4-3cde10f0f282
sdb
└─sdb1 bfe953ef-47e9-4e41-a55f-545178bede4c
sdc
└─sdc1 vfat D221-7693 0b08ce25-01 UBUNTU 24_0
Mount points (filtered): _______________________________________________________
Avail Use% Mounted on
/dev/sda2 93.9G 9% /mnt/boot-sav/sda2
/dev/sdc1 23.7G 20% /cdrom
Mount options (filtered): ______________________________________________________
/dev/sda2 ext4 rw,relatime
/dev/sdc1 vfat ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
====================== sda2/boot/grub/grub.cfg (filtered) ======================
Ubuntu 81808195-6491-4c20-8ed7-35ebee622523
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
========================== sda2/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during curtin installation
/dev/disk/by-uuid/81808195-6491-4c20-8ed7-35ebee622523 / ext4 defaults 0 1
/swap.img none swap sw 0 0
======================= sda2/etc/default/grub (filtered) =======================
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`( . /etc/os-release; echo ${NAME:-Ubuntu} ) 2>/dev/null || echo Ubuntu`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_OS_PROBER=false
==================== sda2: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
?? = ?? boot/grub/grub.cfg 1
28.141605377 = 30.216818688 boot/grub/i386-pc/core.img 1
11.531497955 = 12.381851648 boot/vmlinuz 1
11.531497955 = 12.381851648 boot/vmlinuz-6.8.0-41-generic 1
11.531497955 = 12.381851648 boot/vmlinuz.old 1
7.126949310 = 7.652503552 boot/initrd.img 2
7.126949310 = 7.652503552 boot/initrd.img-6.8.0-41-generic 2
7.126949310 = 7.652503552 boot/initrd.img.old 2
===================== sda2: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18133 Apr 4 2024 10_linux
-rwxr-xr-x 1 root root 43202 Apr 4 2024 10_linux_zfs
-rwxr-xr-x 1 root root 14513 Apr 4 2024 20_linux_xen
-rwxr-xr-x 1 root root 786 Apr 4 2024 25_bli
-rwxr-xr-x 1 root root 13120 Apr 4 2024 30_os-prober
-rwxr-xr-x 1 root root 1174 Apr 4 2024 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Apr 4 2024 40_custom
-rwxr-xr-x 1 root root 215 Apr 4 2024 41_custom
====================== sdc1/boot/grub/grub.cfg (filtered) ======================
Try or Install Ubuntu
Ubuntu (safe graphics)
Boot from next volume
UEFI Firmware Settings
Test memory
==================== sdc1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
?? = ?? boot/grub/grub.cfg
我的规格是:
英特尔酷睿 i5-2550M (4) 3.100GHz 第二代
8GB RAM
120GB SSD 和 120GB HDD
我正在尝试使用 gnome 安装 Ubuntu