Page 1 of 1

Proxmox/Debian: attempt to read or write outside of disk hd0

Posted: Tue Sep 20, 2016 7:23 pm
by ^rooker
[PROBLEM]
Proxmox installation on a HP Proliant Server fails to boot and drops to "grub rescue" with the following message:
Attempting Boot from USB DriveKey (C:)
error: attempt to read or write outside of disk 'hd0'.
Entering rescue mode...
grub rescue>
To be continued...


Links:

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

Posted: Sun Sep 25, 2016 9:10 pm
by gilthanaz
Tried installing a minimum Debian 8.4.0 and ran into the exact same issue...

The debian installer allows for more options when partitioning the disks (compared to the proxmox installer), so we've tried manual setup to make sure that the /boot is indeed in the beginning of the device. The manual setup of the 32GB Stick was:

Layout (make sure to create each partition in the beginning of the available space):
/dev/sda1: 1GB, ext2, bootable-flag: true, mount-point: /boot
/dev/sda2: 29GB, ext4, mount-point: /
/dev/sda3: 2GB, swap

Installation went normal, reboot showed the exact same problem (attempt to read or write outside of disk hd0). However, the above might help in other situations...

Re: Proxmox/Debian: attempt to read or write outside of disk

Posted: Wed Sep 28, 2016 11:17 pm
by gilthanaz
To make sure there's nothing clawing itself to the stick, we've zeroed it out with dd:

Code: Select all

# dd if=/dev/zero of=/dev/sdX iflag=nocache oflag=direct bs=4096
(Source: https://wiki.archlinux.org/index.php/Securely_wipe_disk)

"[Solution"]
Unfortunately this issue could not be solved in a reasonable amount of time :/ While not pretty, the "Solution" in this case was to simply use a different USB Stick / Micro SD Card and things went smooth without a hitch. The few bucks to buy a 32GB+ size SDCard/USB Stick are a good way to go from here :)

On a sidenote: The 32GB Stick that could not boot is perfectly useable for storing data, as long as you don't try to run the OS from it.

Re: Proxmox/Debian: attempt to read or write outside of disk

Posted: Fri Sep 30, 2016 8:57 pm
by gilthanaz
Wow, this thing is a bitchy princess! Ordered SDCard did also not boot while the replacement stick did, also the performance was pretty bad (tried to do a MDRaid 32GB SD Card + 32GB USB Stick, both on the internal connectors). So... trying now the (confirmed to boot) new USB Stick on the internal port + the USB Stick that we couldn't boot from earlier to work as a 28GB RAID1 for the root filesystem and 2GB for swapping. Not using the max space as 32GB devices can differ several hundred MB's in size ...

Debian Installer went nuts on the grub install step and tried to install to /dev/md - which obviously is nonsense and failed. We had to manually set it to install to the internal boot stick (in our case that was /dev/sdb - in your setup, make sure to get the right device).

I'm not sure if it's the HP Hardware, Debian version, Grub version or Installer, but something sure is picky about what it works on (compared to the Ubuntu Server 16.04.1 LTS which did install fine on the first device already). If it wasn't for a proxmox test installation I would've given up a while ago and use Virtualbox, KVM or ESXi for the virtualisation needs :/

The good is that the two sticks work perfectly as a RAID-1 for the system and swap area and we can finally get to the actual thing - experimenting with Proxmox :)

For the sake of complete documentation, here a few things that we've tried to get the SDCard+USBStick RAID1 to work after it wouldn't boot:

Booted debian installer CD and loaded up Rescue System, assembling the RAIDS and launching a shell in /dev/md0:
!!! WARNING - DESTRUCTIVE !!!

Code: Select all

# grub-mkdevicemap -n
# update-grub
# grub-install /dev/sdb
# grub-install /dev/sdc
Or, alternatively:

Code: Select all

# dpkg-reconfigure grub-pc
It was also tried to delete all Information from the boot sector and partition tables using dd to wipe all devices. That of course required to try another complete installation run.

Sources:
https://kupschke.net/2012/02/20/grub2-a ... stallieren
http://www.linuxquestions.org/questions ... ry-606489/