error attempt to read or write outside of disk 'hd0' [Solved] (unclear how)

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Locked
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 140
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

error attempt to read or write outside of disk 'hd0' [Solved] (unclear how)

Post by cabbagetreemo »

I have seen a few posts with similar issues but they have either not been resolved or it has been unclear which suggested solution actually worked so in the interest of not just trying every possible solution I find and hoping that no further damage is caused I am starting a new thread.

I have a Lenovo ThinkPad T530 which has been running Windows 7 Home Premium. I want to keep Windows on this computer because it has a full (not 365) version of Microsoft Office and I have not yet found a replacement for PowerPoint which is to my liking (but that's a topic for another time), but I also want to run Linux (I am using 18.2 Cinnamon 64-bit).

I followed the guide here https://kompjuteras.com/en/how-to-insta ... h-windows/ and made my Linux partition ~100 GB. Immediately after install I booted both Windows and Linux and everything seemed fine so I went about installing software and making the theme the way I like it on Linux. Afterwards I decided to check that everything was still OK and tried to boot Windows, the screen was black for a few minutes (not sure exactly how long) and then I got an option to either boot Windows in safe mode or run memtest or press esc to cancel. I cancelled and tried to check the Linux install. Now I consistently see the message

Code: Select all

error attempt to read or write outside of disk 'hd0'
Press any key to continue...
but Linux does mange to boot after pressing enter.

There is a recovery partition installed by Lenovo on the HDD but I don't have any Windows install disks since this is an OEM licence (I know, even worse than a retail licence). However, I do have an older HDD which was cloned to the current HDD in the past due to signs of failure so the Windows install can probably be recovered from there if necessary.

If I do have to reinstall Linux, is it possible to move all my installed programs and changed settings over? I am using Julia and atom which are a bit of a pain (but doable) to install and, for example, texlive-full just takes a really long time to install.
Last edited by cabbagetreemo on Mon Oct 09, 2017 12:33 am, edited 1 time in total.
Mute Ant
Level 14
Level 14
Posts: 5111
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: error attempt to read or write outside of disk 'hd0'

Post by Mute Ant »

Debian-Ubuntu-Mint switched from /dev/hd0 to /dev/sd0 many years ago... I guess that message is from GRUB.
1] Start Mint, install GRUB, update GRUB might be all you need to do.
2] If you copy the /home /usr and /var folders into Windows-Space, most of your OS with all your extras will be copied too. A real backup would be better.
3] Here's a download for owners of a Windows7 license... https://www.microsoft.com/en-gb/softwar ... d/windows7
4] Here's a download for people who just want to try it out... https://pcriver.com/operating-systems/w ... nload.html

I did [4] last year and they still owe me 29.5 days of free trial...12 hours was all I could take.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".
syg00
Level 4
Level 4
Posts: 211
Joined: Fri Jul 21, 2017 4:00 am

Re: error attempt to read or write outside of disk 'hd0'

Post by syg00 »

Better to know the situation before attempting anything IMHO. Boot the live media and get into a terminal. Run this and post the output (in code tags).

Code: Select all

sudo parted /dev/sda "print free"
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 140
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Re: error attempt to read or write outside of disk 'hd0'

Post by cabbagetreemo »

@Mute Ant, I don't know what you mean by install grub, the grub menu appears to be working fine, it is only after selecting Windows that boot fails (it didn't immediately after installing Mint) or selecting Mint that the error message appears before a reluctant boot.

@syg00 I don't know if it would have made a difference whether I booted mint on the HDD or the live media but here is the output you requested from the live media

Code: Select all

mint@mint ~ $ sudo parted /dev/sda "print free"
Model: ATA ST500LM021-1KJ15 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
        32.3kB  1049kB  1016kB            Free Space
 1      1049kB  1574MB  1573MB  primary   ntfs            boot
 2      1574MB  377GB   376GB   primary   ntfs
        377GB   377GB   1048kB            Free Space
 4      377GB   482GB   105GB   extended
 5      377GB   474GB   96.6GB  logical   ext4
 6      474GB   482GB   8271MB  logical   linux-swap(v1)
 3      482GB   500GB   17.9GB  primary   ntfs
        500GB   500GB   24.6kB            Free Space
Mute Ant
Level 14
Level 14
Posts: 5111
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: error attempt to read or write outside of disk 'hd0'

Post by Mute Ant »

The proper dual-boot installation sequence is...

o Get Windows working to its own satisfaction.

o Install Mint, or start your installed Mint partition. You can use the Live Session Mint DVD to start the OS in /dev/sda5 for example.

o Install GRUB... sudo grub-install /dev/sda ... sudo update-grub

It's normal for Windows to get upset when there's foreign code booting the OS, because it looks like malware. If you must have Windows, and Windows insists on 'repairing' GRUB, work with that. Add a Linux Loader to the options offered by the Windows boot-loader, for example.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 140
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Re: error attempt to read or write outside of disk 'hd0'

Post by cabbagetreemo »

@ Mute Ant, thank you for the suggestion. The laptop in question is not mission critical for me so I will wait a while longer to see if I get another response from @ syg00 regarding the output I posted, otherwise I will try that and see what happens.
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 140
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Re: error attempt to read or write outside of disk 'hd0'

Post by cabbagetreemo »

After not having time to look at this computer since my last post, I came to try reinstalling Grub but before I did so I decided to try booting Windows... To my surprise, it worked perfectly (I dare say even booting faster than it used to, which was usually around 2 minutes). I rebooted Windows several times then booted Linux and did not get any error message. Then I booted Windows again, then Linux again, then left the computer powered off for some time, then Windows again and finally Linux again, from which I am writing this post.

I did not change anything since starting this thread so I cannot say what fixed it or if it is permanently fixed (fingers crossed that it is).

At any rate I will mark the thread solved but I am of course curious about any input as to why there were problems and why there are no longer problems (best candidate right now is ghosts).
Locked

Return to “Installation & Boot”