2

The mentioned error message greets me often when I start up my laptop. I have tried many methods mentioned in some answers, nothing helped.

Facts:

  • Installed dual boot for the second time (reinstalled because of same reason) following How can I dual-boot Windows 10 and Ubuntu on a UEFI HP notebook? as closely as possible.
  • Following that guide I have created a ~2 GB boot-partition with flags esp and boot (Note: the boot flag is now on the Windows-partition, I have no idea how it got there.), then the Windows partition, followed by the swap, the 20 GB Ubuntu "/" and the remaining as "/home" partition.

    Number  Start   End     Size    Type      File system     Flags
     1      1049kB  2149MB  2147MB  primary   fat32           esp
     2      2149MB  378GB   376GB   primary   ntfs            boot
     3      378GB   384GB   6000MB  primary   linux-swap(v1)
     4      384GB   500GB   116GB   extended
     5      384GB   404GB   20,0GB  logical   ext4
     6      404GB   500GB   96,1GB  logical   ext4
    
  • I used boot-repair to restore grub after installing Windows (could not reach Ubuntu on my HDD, I used an USB-version). After that, for 3 days it worked well.

  • Having had the dreaded error message again (no grub rescue, only "Press any key to continue"), I checked gParted and noticed the boot flag is on the wrong disk.
  • Looking for the grub folder, I found it to be in the 20 GB "/" partition as it should be. On the Windows partition, however, two strange folders appeared: Boot and boot-sav. The former contains folders like bg-BG (languages) with bootmgr.exe.mui and often, but not always, memtest.exe.mui:

    BCD           cs-CZ  es-MX  hu-HU        nb-NO      ro-RO       tr-TR
    BCD.LOG       da-DK  et-EE  it-IT        nl-NL      ru-RU       uk-UA
    BCD.LOG1      de-DE  fi-FI  ja-JP        pl-PL      sk-SK       zh-CN
    BCD.LOG2      el-GR  Fonts  ko-KR        pt-BR      sl-SI       zh-HK
    bg-BG         en-GB  fr-CA  lt-LT        pt-PT      sr-Latn-CS  zh-TW
    BOOTSTAT.DAT  en-US  fr-FR  lv-LV        qps-ploc   sr-Latn-RS
    bootvhd.dll   es-ES  hr-HR  memtest.exe  Resources  sv-SE
    

The boot-sav is related to boot-repair, log and mbr_backups (empty) are in it.

  • Using sudo fdisk -l, I got a warning: Partition 4 does not start on physical sector boundary.

My questions:

  • Could my partitioning theoretically work? (Somewhere I read the boot files should all be within the first 137 GB.)
  • Should I simply change the boot flag back to the first, esp partition?
  • Does having an SSHD have anything to do with my issue?
  • Of course, what should I try to make my computer bootable without issues most of the time?

Other, maybe useful info from parted -l:

Model: ATA ST500LM000-1EJ16 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
mitlabence
  • 23
  • 4

1 Answers1

1

Your disk uses the MBR partitioning system (called msdos by parted). Windows installs in BIOS/CSM/legacy mode on such disks, so you're almost certainly booting Windows in BIOS mode.

An EFI can boot from an MBR disk, and you can create an ESP on such a disk. In parted, an ESP on an MBR disk has the esp flag set, whereas the boot flag identifies a partition to which the DOS/Windows boot loader will chainload. On a GPT disk, the boot and esp flags are synonymous; they both identify an ESP. Thus, your disk has separate ESPs and Windows-bootable partitions. Chances are the output you showed is as it should be. You should not try to move either the esp or the boot flags.

That said, there's a good chance that your ESP is doing no good, since you've probably installed Ubuntu in BIOS mode, too. I can't be sure of that without more data, though. (The RESULTS.txt file generated by the Boot Info Script would be helpful.)

The warning about /dev/sda4 (your extended partition) not starting on a physical sector boundary is harmless; you can ignore it.

You haven't said what your problem is, or if you have one at all, aside from not understanding how all these pieces fit together. If you're having a problem of some sort, please specify what it is, and provide that Boot Info Script output. (Post it to a pastebin site and post the URL to your document here.)

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • Thank you a lot for your help! The pastebin link with the results of Boot Info Script: http://paste.ubuntu.com/23359976/ – mitlabence Oct 21 '16 at 16:03
  • The problem is the occasional "Attempt to read or write outside of disk 'hd0'" error message greeting instead of grub - sometimes with grub rescue, sometimes "press any key to continue". After that, booting again might help, but often not. I did a reinstall a week ago, since then only one such occasion occured, but I fear it will happen soon again, that's why I finally decided to ask the question. The "boot" flag moving to the Windows partition also bothered me (bullet #2), as I created the first 2 GiB partition just for the booting process (bullet #1) and now it is almost empty. – mitlabence Oct 21 '16 at 16:09
  • You are, as I suspected, booting in BIOS mode, so your ESP (/dev/sda1) is doing no good. If you're seeing occasional error messages about attempts to read or write outside of hd0 (GRUB's name for your hard disk), then that suggests a hardware problem to me. I recommend you run a SMART utility on your disk to see if it might be likely to fail soon; and if so, replace the disk ASAP. – Rod Smith Oct 21 '16 at 20:13
  • I got these results: https://postimg.org/image/j9x406upf/ A bit scary. Should I look for a new HDD? – mitlabence Oct 23 '16 at 13:08
  • Yeah, I'd replace it. For more on this error, see here (or do a Web search). I recommend replacing the disk ASAP; some types of disk failure can get much worse very quickly. I'm not sure this is one of those types, but I wouldn't take chances myself, especially not if the disk held important data. – Rod Smith Oct 23 '16 at 13:32
  • Thank you once again for your help, I made sure to have fresh backup of the HDD, and replacement is already on its way. – mitlabence Oct 24 '16 at 13:06