0

My computer is a HP Pavillion g4 notebook PC I made some modifications like installing an 120GB SSD drive and replacing the CD drive by a 120GB HDD drive and expanding the RAM from 4GB to 8GB.

When I installed Ubuntu I usually used the "erase disk and install Ubuntu" option and always worked for me until the past month when I tried to boot my PC and it showed a error and when I went back to grub the boot menu was glitched so I thought it needed a reinstall, but when I installed Ubuntu vía "Erase disk and install Ubuntu" after I rebooted it said unable to read and write outside of hd0 and error: you need to load the kernel first.

I tried some solutions show here: What to do when I get an "attempt to read or write outside of disk 'hd0'" error and Boot Repair does not solve the problem? Including Boot-Repair.

The first one:

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

My partitions were different, but I managed to locate them using the ls command.

Additions 19/11/2024: The partitions were GPT, so it may support UEFI I think, but I'm still unable to boot.

Another solution I tried that partially worked is creating a 1024MB ext4 partition located on /boot which works but...

  1. The boot time is too long seriously I can turn the PC, make the breakfast, watch some videos, and its still booting with a black screen it delays too much to show the Ubuntu plymouth screen, sometimes this ends in a timeout or kernel panic.
  2. Break some tools like haxeflixel (I think) before this issue I didn't have problems with that took but when I boot using the /boot partition. It works, but with a lot of errors, one of them being "segmentation fault".

It also happen when I install other Ubuntu-based distros like Linux Mint or Elementary OS, I always install Ubuntu on the SSD, my PC does not support GPT so I have to use mbr. I made the boot drive from Windows using Rufus.

Edit 19/11/2024: I managed to get a pastebin when I tried https://paste.ubuntu.com/p/hw3vFSmpKs/

============================= 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-comnsudo chroot "/mnt/boot-sav/sda2" apt-get purge --allow-remove-essential -y grub2-comnsudo 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)

============================ 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                             
</code></pre>
<p>My specs are:</p>
<p>Intel core i5-2550M (4) 3.100GHz 2nd generation<br />
8gb of ram<br />
120gb SSD and 120gb HDD</p>
<p>I'm trying to install Ubuntu with gnome</p>

1 Answers1

0

Try this:

From a live Ubuntu session.

Rescue your important files from the hard drives.

Then, open a terminal and run:

sudo apt update
sudo apt install --reinstall gparted
sudo gparted

From Gparted, select the SSD.

Unmount it if it is mounted.

Delete partitions

Create a new gpt partition table

Create a 500 meg partition, bios-grub, vfat system

Create a 6 gig partition, ext4 system

Create a 24 gig partition, swap system

Create a partition of the rest of the gigs, ext4 system

Apply changes

Select the HDD

Unmount it if mounted

Delete your partitions

Create a new gpt partition table

Create an ext4 system partition

Apply changes

Close gparted

Close terminal

Start the installation

When you get to partitioning, choose manual

Select to mount the first ext4 partition on the SDD to /boot

Select to mount the swap partition on the SDD, to swap

Select to mount the second ext4 partition on the SDD, to /

Select to mount the HDD partition to /home

The default Grub will be installed on the SDD

Accept and complete the installation.

kyodake
  • 17,808