PDA

View Full Version : [ubuntu] New install of 16.04 boots to grub rescue



bill-linux
July 5th, 2016, 05:08 PM
I am installing Ubuntu 16.04 on to a Dell Optiplex 780. (It is not a dual boot: it is a fresh install with only Ubuntu 16.04.) I replaced the original dell hard drive with a new 4TB disk. When I install 16.04 from a DVD the computer, when rebooted, always goes to grub rescue with the message "error: attempt to read or write outside of disk 'ho0'." I have spent a lot of time reading and learned that a 4TB disk is GPT. I've followed some of the instructions for using a GPT disk with Ubuntu. (e.g., https://help.ubuntu.com/community/UEFI#Identifying_if_the_computer_boots_the_HDD_in_ EFI_mode). The computers bios is A15 and does not seem to support UEFI booting. I have tried varies partitioning of the disk, including having a "a dedicated BIOS boot partition with a recommended size of at least 1 MiB." I used the boot repair disk to attempt to fix it, but this didn't work. The URL generated by that repair disk is http://paste.ubuntu.com/18550507/.

I got it to boot by doing this. a) installing 16.04 from the DVD. I use "something else" to partition the disk. I choose a 1MB boot section, 3.8 TB ext4 for the root system, and about 16 GB for the swap. When I restart it boots to grub rescue as I described above. b) I then use the ubuntu boot repair disk (see https://help.ubuntu.com/community/Boot-Repair). I follow the directions to repair the boot problems. When I reboot the system it still goes to grub rescue, but .... d) when I reinstall from the DVD and repeat step a -- including using the "something else" and partitioning as described -- the system now boots from the 4TB hard drive as it should. What is happening? Is the boot repair disk wiping something from the drive?

oldfred
July 5th, 2016, 05:19 PM
Years ago grub would not boot from any drive over about 650GB. Supposedly fixed.

But I still suggest that ESP and/or bios_grub be at beginning of all new drives. And if drive may later be used on an UEFI system, include ESP now as not large compared to drive size and difficult to add at beginning of drive later. UEFI recommended ESP be first, but even Windows makes it second or third partition, but still near beginning of drive.

I always partition with ESP, FAT32 with boot flag and 300 to 500MB, bios_grub unformatted 1 or 2MB, / (root) at 25GB or so, unless server then maybe more, and rest of drive as either /home and/or /mnt/data partition(s). I typically have several / (root) partition created as soon as I format drive or leave lots unallocated for future / partitions.

If you have 4GB or more of RAM, then just make swap 2GB, unless hibernating which is not really recommended anyway. My 4GB RAM system never used swap, but I do not load lots of apps at once, nor run video editing software. Many with larger RAM do not have swap, but I suggest some.

bill-linux
July 5th, 2016, 05:47 PM
Oldfred: Thanks -- I did format it with a bios_grub at the beginning (1 MB) -- well near the beginning, the partition managers seemed to like to leave 1 mb of free space at the very beginning. This did not work (I used both the partition manger with Ubuntu's install and gpartd) UNTIL I tried to fix the boot record with the repair disk and THEN reinstalled. This tells me there was something on that hard drive -- but perhaps I am wrong. I have a second (identical) system to set up and would like to understand what is going on.

oldfred
July 6th, 2016, 12:25 AM
You have to leave the 1MB at beginning of drive.
And gpt has partition tables at beginning & end of drive which you cannot use, but occasionally we see a system with partition overlapping partition table.

https://www.ibm.com/developerworks/linux/library/l-linux-on-4kb-sector-disks/
http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/index.html
Alignment 2048 sectors Advanced Format drives
http://askubuntu.com/questions/201164/proper-alignment-of-partitions-on-an-advanced-format-hdd-using-parted
Technical details - from 2010 so now newer kernel resolve linux issues
https://ata.wiki.kernel.org/index.php/ATA_4_KiB_sector_issues

bill-linux
July 6th, 2016, 01:41 PM
Indeed it does. Still ... does anyone have an insight into why I have to follow the procedure I did?

oldfred
July 6th, 2016, 04:17 PM
Just to see all the details post this:

Post the link to the Create BootInfo summary report. Is part of Boot-Repair:
https://help.ubuntu.com/community/Boot-Info