PDA

View Full Version : [SOLVED] Problem with bootloader on fresh Ubuntu install



mechengineer
July 20th, 2011, 05:51 PM
I recently received a new custom computer from NCIX, and ordered it without an OS with the intention of running only Ubuntu. I've installed Ubuntu from a USB flash drive and the installation appears to succeed and does not produce any errors. On restarting, however, the system appears to be unable to find the bootloader and just hangs with a black screen and blinking cursor.

Booting live from the USB drive I used for installation has let me try to diagnose/fix the problem, but I'm stuck.

Here's the output of boot_info_script.sh (http://sourceforge.net/projects/bootinfoscript/) when I install Ubuntu from the USB drive (live), and run the script before restarting the computer:


Boot Info Script 0.60 from 17 May 2011


============================= Boot Info Summary: ===============================

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector
124068394 of the same hard drive for core.img, but core.img can not be
found at this location.
=> Syslinux MBR (3.61-4.03) is installed in the MBR of /dev/sdb.

sda1: __________________________________________________ ________________________

File system: vfat
Boot sector type: -
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

sda2: __________________________________________________ ________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 11.04
Boot files: /boot/grub/grub.cfg /etc/fstab

sdb1: __________________________________________________ ________________________

File system: vfat
Boot sector type: SYSLINUX 4.02 debian-20101016 ...........>...r>..........V...0...~.k...~...f...M.f.f....f..8~....>2}
Boot sector info: Syslinux looks at sector 1469768 of /dev/sdb1 for its
second stage. SYSLINUX is installed in the directory.
The integrity check of the ADV area failed. According
to the info in the boot sector, sdb1 starts at sector
0. But according to the info from fdisk, sdb1 starts
at sector 63.
Operating System:
Boot files: /boot/grub/grub.cfg /syslinux.cfg /ldlinux.sys

============================ Drive/Partition Info: =============================

Drive: sda __________________________________________________ ___________________

Disk /dev/sda: 64.0 GB, 64023257088 bytes
255 heads, 63 sectors/track, 7783 cylinders, total 125045424 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 1 125,045,423 125,045,423 ee GPT


GUID Partition Table detected.

Partition Start Sector End Sector # of Sectors System
/dev/sda1 34 195,346 195,313 EFI System partition
/dev/sda2 195,347 125,044,956 124,849,610 Data partition (Windows/Linux)

Drive: sdb __________________________________________________ ___________________

Disk /dev/sdb: 1027 MB, 1027416576 bytes
255 heads, 63 sectors/track, 124 cylinders, total 2006673 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sdb1 * 63 2,006,612 2,006,550 b W95 FAT32


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/sda1 F85A-81FA vfat
/dev/sda2 ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c ext4
/dev/sdb1 6237-C1B5 vfat New Volume

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/loop0 /rofs squashfs (ro,noatime)
/dev/sdb1 /cdrom vfat (ro,noatime,fmask=0022,dmask=0022,codepage=cp437,i ocharset=iso8859-1,shortname=mixed,errors=remount-ro)


=========================== sda2/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
}

insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c
set locale_dir=($root)/boot/grub/locale
set lang=en_CA
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c ro quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.38-8-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-8-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c
echo 'Loading Linux 2.6.38-8-generic ...'
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-8-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda2/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda2 during installation
UUID=ebbb79d9-f6f0-47b1-a8b0-007cb3d89e3c / ext4 errors=remount-ro 0 1
/dev/sda1 /boot/efi vfat defaults 0 1
--------------------------------------------------------------------------------

=================== sda2: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

56.228105068 = 60.374468096 boot/grub/grub.cfg 1
0.597577572 = 0.641644032 boot/initrd.img-2.6.38-8-generic 2
56.225965023 = 60.372170240 boot/vmlinuz-2.6.38-8-generic 1
0.597577572 = 0.641644032 initrd.img 2
56.225965023 = 60.372170240 vmlinuz 1

=========================== sdb1/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------

if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Try Ubuntu without installing" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
initrd /casper/initrd.lz
}
menuentry "Install Ubuntu" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash --
initrd /casper/initrd.lz
}
menuentry "Check disc for defects" {
set gfxpayload=keep
linux /casper/vmlinuz boot=casper integrity-check quiet splash --
initrd /casper/initrd.lz
}
--------------------------------------------------------------------------------

============================== sdb1/syslinux.cfg: ==============================

--------------------------------------------------------------------------------
default menu.c32
prompt 0
menu title UNetbootin
timeout 100

label unetbootindefault
menu label Default
kernel /ubnkern
append initrd=/ubninit file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --

label ubnentry0
menu label ^Help
kernel /ubnkern
append initrd=/ubninit

label ubnentry1
menu label ^Try Ubuntu without installing
kernel /casper/vmlinuz
append initrd=/casper/initrd.lz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --

label ubnentry2
menu label ^Install Ubuntu
kernel /casper/vmlinuz
append initrd=/casper/initrd.lz file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash --

label ubnentry3
menu label ^Check disc for defects
kernel /casper/vmlinuz
append initrd=/casper/initrd.lz boot=casper integrity-check quiet splash --

label ubnentry4
menu label Test ^memory
kernel /install/mt86plus
append initrd=/ubninit

label ubnentry5
menu label ^Boot from first hard disk
kernel /ubnkern
append initrd=/ubninit

label ubnentry6
menu label Try Ubuntu without installing
kernel /casper/vmlinuz
append initrd=/casper/initrd.lz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --

label ubnentry7
menu label Install Ubuntu
kernel /casper/vmlinuz
append initrd=/casper/initrd.lz file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash --

label ubnentry8
menu label Check disc for defects
kernel /casper/vmlinuz
append initrd=/casper/initrd.lz boot=casper integrity-check quiet splash --

--------------------------------------------------------------------------------

=================== sdb1: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

?? = ?? boot/grub/grub.cfg 1

================= sdb1: Location of files loaded by Syslinux: ==================

GiB - GB File Fragment(s)

?? = ?? ldlinux.sys 1
?? = ?? menu.c32 1
?? = ?? syslinux.cfg 1

============== sdb1: Version of COM32(R) files used by Syslinux: ===============

menu.c32 : COM32R module (v4.xx)

========= Devices which don't seem to have a corresponding hard drive: =========

sdc sdd sde sdf

=============================== StdErr Messages: ===============================

./boot_info_script.sh: line 1579: [: 2.73495e+09: integer expression expected


From what I can make of this, it can't find core.img, which explains why it won't boot. I have tried using grub-install to fix it, but it doesn't help.

Specifically, the hard drive onto which I'm installing Ubuntu is a 64GB SSD, if that makes any difference. Does anyone have any idea what might be going wrong here?

madhavhmk
July 20th, 2011, 06:23 PM
is the bootloader working if yu plug in the USB flash device?

mechengineer
July 20th, 2011, 07:19 PM
is the bootloader working if yu plug in the USB flash device?

The bootloader for the live Ubuntu image on the USB flash drive works fine (I can run Ubuntu live off the USB flash drive), but the installed copy on the SSD doesn't work at all.

Quackers
July 20th, 2011, 07:27 PM
It appears that you have a GUID Partition Table with an EFI system partition. This requires different installation steps, but I don't know the details, I'm afraid.
Is there any particular reason that you're using GPT?

At the moment grub is installed to the mbr of the drive but it is looking at sector 124068394 for /boot/grub/core.img. Sector 124068394 is in the middle of sda2, but core.img is not showing on the boot script output as being installed anywhere that I can see.

srs5694
July 20th, 2011, 07:35 PM
First, your /dev/sda is not properly aligned for optimum performance with SSDs. These normally require alignment on some power-of-2 multiple for the sector number, but /dev/sda2 begins on sector 195,347, which will likely degrade performance. (Check with your SSD's manufacturer for the details.) Therefore, I recommend you re-install from scratch, and this time be sure to properly align your partitions. Your configuration is a bit odd, since I was under the impression that Ubuntu 11.04 created partitions aligned to 2048-sector (1 MiB) values by default. Did you partition with something other than the Ubuntu installer before beginning?

Second, your partition layout on /dev/sda suggests the use of a UEFI firmware; however, the presence of GRUB in the MBR of that disk suggests use of a BIOS firmware. This discrepancy is peculiar, but might be explained by re-use of the disk from an earlier installation or by preparation of the disk prior to Ubuntu installation. If either of these is the case, please elaborate. (Perhaps the disk came pre-partitioned from the manufacturer, even though it came without an OS?) Note that many modern UEFI-capable computers support booting with a BIOS compatibility mode, which can confuse and complicate things.

You might also say what model motherboard you've got, since that will tell us (with a bit of research) if the motherboard uses UEFI or a conventional BIOS. If it uses an Intel Sandy Bridge CPU, chances are it's got a UEFI-capable firmware.

Another question: Do you intend to dual-boot this computer with Windows? Your /dev/sdb1 has a FAT filesystem, and it's unclear what's on this disk. Is it a regular feature of the computer, or an external spare/emergency disk?

Generally speaking:



Windows requires GPT on UEFI installations and MBR on BIOS installations, at least for its boot disk. (Windows Vista and later are more flexible about non-boot disks.)
Linux can boot from either GPT or MBR disks on either BIOS-based or UEFI-based computers; however....
On BIOS-based computers, GRUB works best with a BIOS Boot Partition, which you don't have.
UEFI-based computers generally require an EFI System Partition (ESP) to boot. You've got such a partition (/dev/sda1), but it's unclear if Ubuntu installed using it (but probably not, given that GRUB is present in the first sector of the disk).



My hunch at this point is that your vendor pre-partitioned /dev/sda1 using GPT (and got the alignment wrong) but you booted the Ubuntu installer in BIOS mode, so Ubuntu did the best that it could but bungled the GRUB installation because of the lack of a BIOS Boot Partition. If I'm right, you have the option of re-installing in BIOS mode with either an MBR partition table or GPT with a BIOS Boot Partition; or re-installing in UEFI mode with an ESP. Either way, you should repartition to get the alignment set correctly.

mechengineer
July 20th, 2011, 07:44 PM
It appears that you have a GUID Partition Table with an EFI system partition. This requires different installation steps, but I don't know the details, I'm afraid.
Is there any particular reason that you're using GPT?


I have made no conscious choice to use either GUID or EFI, I was just trying to do a vanilla Ubuntu install and accept whatever defaults. When that didn't work, I tried playing around with setting up my own partitions. What is the usual way to install Ubuntu?


At the moment grub is installed to the mbr of the drive but it is looking at sector 124068394 for /boot/grub/core.img. Sector 124068394 is in the middle of sda2, but core.img is not showing on the boot script output as being installed anywhere that I can see.

I also haven't been able to find where core.img ended up.

Quackers
July 20th, 2011, 07:46 PM
See srs5694's post above :-)

mokrates
July 20th, 2011, 07:52 PM
mmolle@mokbook:~$ apt-cache search grub | grep ^grub
grub - GRand Unified Bootloader (Legacy version)
grub-common - GRand Unified Bootloader, version 2 (common files)
...
grub-efi - GRand Unified Bootloader, version 2 (dummy package)
grub-efi-amd64 - GRand Unified Bootloader, version 2 (EFI-AMD64 version)
grub-efi-ia32 - GRand Unified Bootloader, version 2 (EFI-IA32 version)

as you can see, there is an extra-version of grub for use with EFI, perhaps the wrong version was installed?

mechengineer
July 20th, 2011, 08:08 PM
First, your /dev/sda is not properly aligned for optimum performance with SSDs. These normally require alignment on some power-of-2 multiple for the sector number, but /dev/sda2 begins on sector 195,347, which will likely degrade performance. (Check with your SSD's manufacturer for the details.) Therefore, I recommend you re-install from scratch, and this time be sure to properly align your partitions. Your configuration is a bit odd, since I was under the impression that Ubuntu 11.04 created partitions aligned to 2048-sector (1 MiB) values by default. Did you partition with something other than the Ubuntu installer before beginning?

So in general, when using an SSD, I should try to set up the partitions such that they begin on sector numbers of powers-of-2? I originally let Ubuntu do the partitioning automatically (I've reinstalled probably five times already, trying different configurations), but this particular time I've specified only a 100MB boot partition and the rest as root. I've neglected swap space because the system has 16GB of RAM and I've read that swap space isn't ideal for SSDs.

The only partitioning tool I used here was the Ubuntu installer.


Second, your partition layout on /dev/sda suggests the use of a UEFI firmware; however, the presence of GRUB in the MBR of that disk suggests use of a BIOS firmware. This discrepancy is peculiar, but might be explained by re-use of the disk from an earlier installation or by preparation of the disk prior to Ubuntu installation. If either of these is the case, please elaborate. (Perhaps the disk came pre-partitioned from the manufacturer, even though it came without an OS?) Note that many modern UEFI-capable computers support booting with a BIOS compatibility mode, which can confuse and complicate things.

Ubuntu is the first thing I've tried to install on this system, but I believe it was tested under Windows by the assembly crew at NCIX. They told me that they would wipe the drive before shipping it, and I also wiped it myself for the Ubuntu install. Is it possible that some part of the Windows installation remains and is causing problems?


You might also say what model motherboard you've got, since that will tell us (with a bit of research) if the motherboard uses UEFI or a conventional BIOS. If it uses an Intel Sandy Bridge CPU, chances are it's got a UEFI-capable firmware.

Another question: Do you intend to dual-boot this computer with Windows? Your /dev/sdb1 has a FAT filesystem, and it's unclear what's on this disk. Is it a regular feature of the computer, or an external spare/emergency disk?

The motherboard is an MSI 990FXA-GD80, with an AMD Phenom II X6 1090T processor installed. RAM is maxed out at 16GB, and there is presently one Radeon HD 6950 installed (two more to be added once I get Ubuntu working). I intend for the SSD to have only the operating system files on it, with /home/ residing on a pair of larger disks in a RAID 1 configuration. At the moment, I have disconnected the RAID disks and am focusing on installing only on the SSD, to try to simplify the setup in case this is a hardware problem we're dealing with.

I do not intend to run Windows on this computer, or dual-boot with any other operating system. Our research lab uses Linux more-or-less exclusively, and in our experience Windows has caused us more trouble than it's worth.

/dev/sdb is the USB flash drive, which is running the live image of Ubuntu and what I have been using for the installation. Would it make more sense to have the USB drive formatted as EXT rather than FAT for this purpose?



Generally speaking:


Windows requires GPT on UEFI installations and MBR on BIOS installations, at least for its boot disk. (Windows Vista and later are more flexible about non-boot disks.)
Linux can boot from either GPT or MBR disks on either BIOS-based or UEFI-based computers; however....
On BIOS-based computers, GRUB works best with a BIOS Boot Partition, which you don't have.
UEFI-based computers generally require an EFI System Partition (ESP) to boot. You've got such a partition (/dev/sda1), but it's unclear if Ubuntu installed using it (but probably not, given that GRUB is present in the first sector of the disk).


My hunch at this point is that your vendor pre-partitioned /dev/sda1 using GPT (and got the alignment wrong) but you booted the Ubuntu installer in BIOS mode, so Ubuntu did the best that it could but bungled the GRUB installation because of the lack of a BIOS Boot Partition. If I'm right, you have the option of re-installing in BIOS mode with either an MBR partition table or GPT with a BIOS Boot Partition; or re-installing in UEFI mode with an ESP. Either way, you should repartition to get the alignment set correctly.

I think you may be on the right track. While trying to manually install GRUB (after seeing from the boot info script that there's no bootloader found), I got errors saying that there's no BIOS boot partition on which to place GRUB.

What is the best way to repartition in order to guarantee alignment and and use only UEFI or GPT?

Thanks for all the responses so far!

mokrates
July 20th, 2011, 08:20 PM
as i understand it, the alignment is of no relevance for finding the core.img. it's only relevant for performance and lifetime issues regarding the ssd

(the ssd can only be read in blocks, so if filesystem clusters cross block borders there have to be 2 blocks read to read 1 cluster. also to write one cluster, there have to be 2 blocks wiped and rewritten, which ages the drive.)

try to find out which grub-version is installed by the ubuntu-installer (live-cd -> chrooting into the system -> asking apt.)

mo

Quackers
July 20th, 2011, 08:22 PM
I think it's pretty much decided that core.img is not installed.

srs5694
July 21st, 2011, 12:15 AM
So in general, when using an SSD, I should try to set up the partitions such that they begin on sector numbers of powers-of-2?

Yes. Most partitioning tools today create partitions on 2048-sector (1 MiB) boundaries, which works well with most SSDs, RAID arrays, and Advanced Format disks.


The only partitioning tool I used here was the Ubuntu installer.

In that case, it's either re-using partitions created with some other tool that the PC manufacturer used or it's getting it wrong. In case of the latter, I recommend you boot the Ubuntu installer in its "try it now" mode or use an emergency disc like Parted Magic (http://partedmagic.com) to create a partition table that you know is properly aligned. You can use gdisk to repartition the disk. (You'll need to do an "apt-get install gdisk" to install it in Ubuntu, but it comes with Parted Magic.) Use gdisk to wipe the partitions and create new ones:



Type "sudo gdisk /dev/sda" to launch the program on the disk. (Omit "sudo" if you use Parted Magic.)
Type "p" to view the partition table and verify you're working on the correct disk, based on its size and predefined partitions. (You don't want to accidentally wipe out your flash drive.)
Type "o" to create a new and empty partition table.
Type "n" to create a new partition. Give it a number of 1, a starting sector of 2048, a final sector of "+200M", and a hex code of EF00. This creates an EFI System Partition, which you might or might not use -- but better to have one and not need it than not have one but need it.
Type "n" to create a second new partition. Give it a number of 2, a starting sector of the default value, a final sector of "+1M", and a hex code of EF02. This creates a BIOS Boot Partition. Again, you might or might not need it, but it's better to have it and not need it than to not have it but need it.
Type "n" to create another new partition, for the Linux root (/) filesystem. Give it a number of 3, a starting sector of the default value, a final sector of either the default value (for the whole disk) or whatever size you want to make it, and a hex code of 8300. (The hex code will be changed to 0700 in pre-0.7.2 versions of gdisk; "8300" is a new GPT Linux-specific filesystem type code.)
If desired, create additional partitions on the disk.
Type "p" to view the partition table. You should see the three (or more) partitions you created and some free space (as shown on the "Total free space" line) reflecting the amount you left unused or just a bit under 1 MiB if you filled the disk.
If all looks OK, type "w" to write the partition table and exit.
Type "sudo mkdosfs -F 32 -n ESP /dev/sda1" to create a FAT32 filesystem on the ESP.
Type "sudo mkfs -t ext4 /dev/sda3" to create an ext4 filesystem on the Linux root (/) partition.



(You could do the above with GParted or GNU Parted, but I'm less familiar with them so I wrote the above for gdisk.)

Your system is now ready for installation. Use the "other" option to specify your partitions. Set /dev/sda3 as the root (/) partition, and if you created any others (except for the BIOS Boot Partition and ESP), give them suitable mount points. You might need to do something with the ESP if you install in UEFI mode (see below). You don't need to do anything explicit with the BIOS Boot Partition; GRUB will detect it and, if necessary, use it.


Ubuntu is the first thing I've tried to install on this system, but I believe it was tested under Windows by the assembly crew at NCIX. They told me that they would wipe the drive before shipping it, and I also wiped it myself for the Ubuntu install. Is it possible that some part of the Windows installation remains and is causing problems?

Depending on how you wiped it, the partition table might have survived. GPT places data at both the start of the disk and the end of the disk. If you wiped just the first few sectors (or worse, just the first sector), then a partitioning tool might have interpreted that as damage and automatically "fixed" it by using the backup data at the end of the disk. That just explains why the disk is in GPT format and why the old partitions survived, though; it doesn't (by itself) explain your boot problems. Those are most likely caused by either the lack of a BIOS Boot Partition or firmware boot options that are trying to get the system to boot in UEFI mode when no UEFI boot loader exists.

FWIW, the procedure I just provided intentionally keeps the disk in GPT format for several reasons, including the fact that it's easier to do this than to describe how to wipe it and create a new MBR and the fact that GPT is preferred if you elect to use UEFI booting. For BIOS-based booting on a Linux-only system, IMHO GPT is superior, too, although its advantages over MBR are relatively minor.


The motherboard is an MSI 990FXA-GD80,

I've downloaded the manual from MSI's Web site. (http://www.msi.com/service/download/manual-16832.html) It sounds as if the board is UEFI-based rather than BIOS-based, although the manual uses the word "BIOS" the way I'd use the word "firmware," which can be confusing. I use "BIOS" to refer only to the old-style firmware that does not include the UEFI boot features. On p. 3-2 (p. 42 as xpdf counts them), there's a notice about how to find the firmware version, and the first character in the version is "E" for (U)EFI support, so you could check that to be sure of what you've got.


/dev/sdb is the USB flash drive, which is running the live image of Ubuntu and what I have been using for the installation. Would it make more sense to have the USB drive formatted as EXT rather than FAT for this purpose?

No, don't worry about that.


What is the best way to repartition in order to guarantee alignment and and use only UEFI or GPT?

First, understand this:



"BIOS", "EFI", and "UEFI" refer to firmware types -- code that's written to a flash chip on the motherboard to control the initial stages of the boot process, among other things. BIOS is the old style code that's been around for (literally) 30 years. EFI is a firmware type that was invented about ten years ago and that's used in Macs and some servers. UEFI is a variant of EFI (essentially, it's EFI 2.x) that's used in many new PCs.
"MBR" and "GPT" refer to partition table types -- MBR is the traditional type on PCs, whereas GPT is a newer system that was invented along with EFI, although it can be used on non-EFI systems, too.



Windows ties BIOS to MBR and UEFI to GPT. Linux is much more flexible; you can use either partition table type with either firmware type. Because GPT has some (mostly minor) advantages over MBR, I recommend its use with either firmware type on both BIOS- and (U)EFI-based systems. It does, however, require (or at least benefit from) special boot partitions -- a BIOS Boot Partition on BIOS-based computers or an EFI System Partition (ESP) on (U)EFI-based computers.

Most (perhaps all) modern UEFI implementations support both BIOS-style and EFI-style booting. Both methods work, but sometimes one or the other will work better, depending on your needs. The "Boot" section of your firmware setup utility includes options that affect the boot mode, although the manual description (on p. 3-19/p. 59) isn't very clear about precisely what the options are.

It sounds like your Ubuntu installer is booting in BIOS mode right now. This may be fine if you install with a BIOS Boot Partition and if the computer is configured to boot in BIOS mode from the hard disk when the installation is complete.

You could look over your boot options and see if there are "EFI" or "UEFI" boot options for the hard disk and/or optical disc. It's entirely possible there won't be hard disk UEFI boot options until after you install Ubuntu, though.

Fortunately, Linux itself requires no reconfiguration for BIOS vs. UEFI booting once it's installed; you need only install a suitable boot loader for the boot method. Thus, the simplest course of action is probably to install in BIOS mode, since you know the installer works like that. If that fails to boot after you re-install with the BIOS Boot Partition in place, you can then install a UEFI boot loader in the ESP and see if you can get it to boot in that way. You could try that right now, but given that your partitions aren't properly aligned (unless the alignment has changed since you posted your Boot Info Script output), it's better to correct the partition alignment (as described in my numbered procedure above) now than to try to get the system booting when you'll just have to move or re-install it anyhow.

If you install in UEFI mode (by changing optical disc boot options), you must be sure to tell Ubuntu that the ESP (/dev/sda1 if you followed my procedure above) is the ESP. IIRC, you do this by marking the partition as an "EFI boot partition" or some similar not-quite-standard term. If you don't do this, then GRUB won't be installed.

If you find you need to install a UEFI boot loader, I personally recommend ELILO, (http://elilo.sourceforge.net) which I've found to be more reliable than GRUB 2 on UEFI systems. You can download it from its Sourceforge page or install the elilo package in Ubuntu. Either way, you need to copy the elilo.efi file to a subdirectory for ELILO in the EFI directory on the ESP. The ESP is normally mounted at /boot/efi in Linux, so you might create /boot/efi/EFI/elilo and copy elilo.efi there. You must also copy the Linux kernel file (/boot/vmlinuz*) and the Linux initial RAM disk (/boot/initrd*) to that directory. You'd then create an elilo.conf file, like this:


prompt
timeout=50
default=ubuntu
#chooser=textmenu

image=vmlinuz-2.6.39
label=ubuntu
initrd=initrd.img-2.6.39
read-only
root=/dev/sda3
append="reboot=a,w"


You need to change the kernel name, the initrd name, and the root device filename. You might also want to tweak your kernel options -- I've just got "reboot=a,w" here, which fixes a bug with reboots on some systems. Note that if you use ELILO, you'll probably have to manually copy new kernels to the ESP and update ELILO whenever you upgrade your kernel.

Alternatively, you can try GRUB 2's EFI package (grub-efi rather than grub-pc in the Ubuntu package system); however, I've found GRUB 2 to be unreliable on UEFI systems. I've had better luck with locally-compiled versions, as described here, (https://help.ubuntu.com/community/UEFIBooting) than with prebuilt binaries.

Whichever boot loader you choose, you'll have to tell your firmware to use it. The Boot screen in the firmware setup may locate it, or you may need to use the efibootmgr program in Ubuntu -- but you'll need to boot the Ubuntu installer in UEFI mode to get that to work.

mechengineer
July 22nd, 2011, 03:10 AM
I followed all of the steps in srs5694's detailed and informative posts, but I still couldn't manage to find a way to make it work. The machine would just keep throwing me to a black screen with blinking cursor on boot after every install attempt. After several days losing hair over this, I decided to try installing from a burned CD instead of the USB flash drive.

And it worked. Flawlessly.

I've never had trouble installing from an image on a USB flash drive before, and since it was allowing me to install and not presenting any error messages, I assumed that couldn't have been the problem. But it was. I feel a little dumb now, but I do feel like I learned quite a bit from all the googling and the excellent responses I've had here.

Thanks to everyone for your help!

YannBuntu
July 22nd, 2011, 03:52 AM
Happy end :)
Please could you re-run the BootInfoScript (http://sourceforge.net/projects/bootinfoscript/) so that we can try to find an explanation ?

srs5694
July 22nd, 2011, 02:27 PM
After several days losing hair over this, I decided to try installing from a burned CD instead of the USB flash drive.

And it worked. Flawlessly.

My suspicion is that switching the installation medium switched you from a BIOS boot to a UEFI boot (or maybe the other way around). This would change the boot loader that Ubuntu installed, which in turn could easily affect the system's bootability.

mechengineer
July 22nd, 2011, 05:13 PM
Here is the new output from the boot info script:


Boot Info Script 0.60 from 17 May 2011


============================= Boot Info Summary: ===============================

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector
319660 of the same hard drive for core.img. core.img is at this location
and looks for (,gpt1)/grub on this drive.
=> Windows is installed in the MBR of /dev/sdb.
=> Windows is installed in the MBR of /dev/sdc.
=> Syslinux MBR (3.61-4.03) is installed in the MBR of /dev/sdi.

sda1: __________________________________________________ ________________________

File system: ext2
Boot sector type: -
Boot sector info:
Operating System:
Boot files: /grub/grub.cfg /grub/core.img

sda2: __________________________________________________ ________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 11.04
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sdi1: __________________________________________________ ________________________

File system: vfat
Boot sector type: FAT32
Boot sector info: According to the info in the boot sector, sdi1 starts
at sector 0. But according to the info from fdisk,
sdi1 starts at sector 63.
Operating System:
Boot files:

============================ Drive/Partition Info: =============================

Drive: sda __________________________________________________ ___________________

Disk /dev/sda: 64.0 GB, 64023257088 bytes
255 heads, 63 sectors/track, 7783 cylinders, total 125045424 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 1 125,045,423 125,045,423 ee GPT


GUID Partition Table detected.

Partition Start Sector End Sector # of Sectors System
/dev/sda1 34 390,659 390,626 Data partition (Windows/Linux)
/dev/sda2 390,660 125,044,956 124,654,297 Data partition (Windows/Linux)

Drive: sdb __________________________________________________ ___________________

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System



Drive: sdc __________________________________________________ ___________________

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System



Drive: sdi __________________________________________________ ___________________

Disk /dev/sdi: 1027 MB, 1027416576 bytes
255 heads, 63 sectors/track, 124 cylinders, total 2006673 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sdi1 * 63 2,006,612 2,006,550 b W95 FAT32


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/sda1 c00241e2-3702-4cda-bdc6-1870352e5b16 ext2
/dev/sda2 781ad586-613b-4cba-88cf-06b3d404f465 ext4
/dev/sdi1 3021-AE29 vfat YOSHI

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/sda1 /boot ext2 (rw)
/dev/sda2 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sdi1 /media/YOSHI vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000, shortname=mixed,dmask=0077,utf8=1,showexec,flush)


============================= sda1/grub/grub.cfg: ==============================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root 781ad586-613b-4cba-88cf-06b3d404f465
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
set locale_dir=($root)/grub/locale
set lang=en_CA
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 2.6.38-10-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
linux /vmlinuz-2.6.38-10-generic root=UUID=781ad586-613b-4cba-88cf-06b3d404f465 ro quiet splash vt.handoff=7
initrd /initrd.img-2.6.38-10-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-10-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
echo 'Loading Linux 2.6.38-10-generic ...'
linux /vmlinuz-2.6.38-10-generic root=UUID=781ad586-613b-4cba-88cf-06b3d404f465 ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.38-10-generic
}
submenu "Previous Linux versions" {
menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
linux /vmlinuz-2.6.38-8-generic root=UUID=781ad586-613b-4cba-88cf-06b3d404f465 ro quiet splash vt.handoff=7
initrd /initrd.img-2.6.38-8-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-8-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
echo 'Loading Linux 2.6.38-8-generic ...'
linux /vmlinuz-2.6.38-8-generic root=UUID=781ad586-613b-4cba-88cf-06b3d404f465 ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.38-8-generic
}
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu, with Linux 2.6.38-8-generic (on /dev/sdh6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(/dev/sdh,msdos1)'
search --no-floppy --fs-uuid --set=root 92d476cb-ccc5-4146-be32-5a356d92362c
linux /vmlinuz-2.6.38-8-generic root=UUID=78ffcdf6-d07d-43b5-a821-47d0a6fa110a ro quiet splash vt.handoff=7
initrd /initrd.img-2.6.38-8-generic
}
menuentry "Ubuntu, with Linux 2.6.38-8-generic (recovery mode) (on /dev/sdh6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(/dev/sdh,msdos1)'
search --no-floppy --fs-uuid --set=root 92d476cb-ccc5-4146-be32-5a356d92362c
linux /vmlinuz-2.6.38-8-generic root=UUID=78ffcdf6-d07d-43b5-a821-47d0a6fa110a ro single
initrd /initrd.img-2.6.38-8-generic
}
menuentry "Ubuntu, with Linux 2.6.35-28-generic (on /dev/sdh6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(/dev/sdh,msdos1)'
search --no-floppy --fs-uuid --set=root 92d476cb-ccc5-4146-be32-5a356d92362c
linux /vmlinuz-2.6.35-28-generic root=UUID=78ffcdf6-d07d-43b5-a821-47d0a6fa110a ro quiet splash vt.handoff=7
initrd /initrd.img-2.6.35-28-generic
}
menuentry "Ubuntu, with Linux 2.6.35-28-generic (recovery mode) (on /dev/sdh6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(/dev/sdh,msdos1)'
search --no-floppy --fs-uuid --set=root 92d476cb-ccc5-4146-be32-5a356d92362c
linux /vmlinuz-2.6.35-28-generic root=UUID=78ffcdf6-d07d-43b5-a821-47d0a6fa110a ro single
initrd /initrd.img-2.6.35-28-generic
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=================== sda1: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

0.152450562 = 0.163692544 grub/core.img 2
0.152457237 = 0.163699712 grub/grub.cfg 1
0.043902397 = 0.047139840 initrd.img-2.6.38-10-generic 59
0.022812843 = 0.024495104 initrd.img-2.6.38-8-generic 56
0.027048111 = 0.029042688 vmlinuz-2.6.38-10-generic 21
0.011267662 = 0.012098560 vmlinuz-2.6.38-8-generic 21

=========================== sda2/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root 781ad586-613b-4cba-88cf-06b3d404f465
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
set locale_dir=($root)/grub/locale
set lang=en_CA
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 2.6.38-10-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
linux /vmlinuz-2.6.38-10-generic root=UUID=781ad586-613b-4cba-88cf-06b3d404f465 ro quiet splash vt.handoff=7
initrd /initrd.img-2.6.38-10-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-10-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
echo 'Loading Linux 2.6.38-10-generic ...'
linux /vmlinuz-2.6.38-10-generic root=UUID=781ad586-613b-4cba-88cf-06b3d404f465 ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.38-10-generic
}
submenu "Previous Linux versions" {
menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
linux /vmlinuz-2.6.38-8-generic root=UUID=781ad586-613b-4cba-88cf-06b3d404f465 ro quiet splash vt.handoff=7
initrd /initrd.img-2.6.38-8-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-8-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
echo 'Loading Linux 2.6.38-8-generic ...'
linux /vmlinuz-2.6.38-8-generic root=UUID=781ad586-613b-4cba-88cf-06b3d404f465 ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.38-8-generic
}
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt1)'
search --no-floppy --fs-uuid --set=root c00241e2-3702-4cda-bdc6-1870352e5b16
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu, with Linux 2.6.38-8-generic (on /dev/sdh6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(/dev/sdh,msdos1)'
search --no-floppy --fs-uuid --set=root 92d476cb-ccc5-4146-be32-5a356d92362c
linux /vmlinuz-2.6.38-8-generic root=UUID=78ffcdf6-d07d-43b5-a821-47d0a6fa110a ro quiet splash vt.handoff=7
initrd /initrd.img-2.6.38-8-generic
}
menuentry "Ubuntu, with Linux 2.6.38-8-generic (recovery mode) (on /dev/sdh6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(/dev/sdh,msdos1)'
search --no-floppy --fs-uuid --set=root 92d476cb-ccc5-4146-be32-5a356d92362c
linux /vmlinuz-2.6.38-8-generic root=UUID=78ffcdf6-d07d-43b5-a821-47d0a6fa110a ro single
initrd /initrd.img-2.6.38-8-generic
}
menuentry "Ubuntu, with Linux 2.6.35-28-generic (on /dev/sdh6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(/dev/sdh,msdos1)'
search --no-floppy --fs-uuid --set=root 92d476cb-ccc5-4146-be32-5a356d92362c
linux /vmlinuz-2.6.35-28-generic root=UUID=78ffcdf6-d07d-43b5-a821-47d0a6fa110a ro quiet splash vt.handoff=7
initrd /initrd.img-2.6.35-28-generic
}
menuentry "Ubuntu, with Linux 2.6.35-28-generic (recovery mode) (on /dev/sdh6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(/dev/sdh,msdos1)'
search --no-floppy --fs-uuid --set=root 92d476cb-ccc5-4146-be32-5a356d92362c
linux /vmlinuz-2.6.35-28-generic root=UUID=78ffcdf6-d07d-43b5-a821-47d0a6fa110a ro single
initrd /initrd.img-2.6.35-28-generic
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda2/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda2 during installation
UUID=781ad586-613b-4cba-88cf-06b3d404f465 / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=c00241e2-3702-4cda-bdc6-1870352e5b16 /boot ext2 defaults 0 2
--------------------------------------------------------------------------------

=================== sda2: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

0.338715553 = 0.363693056 boot/grub/core.img 2
0.338722229 = 0.363700224 boot/grub/grub.cfg 1
0.230167389 = 0.247140352 boot/initrd.img-2.6.38-10-generic 59
0.209077835 = 0.224495616 boot/initrd.img-2.6.38-8-generic 56
0.213313103 = 0.229043200 boot/vmlinuz-2.6.38-10-generic 21
0.197532654 = 0.212099072 boot/vmlinuz-2.6.38-8-generic 21
0.230167389 = 0.247140352 initrd.img 59
0.209077835 = 0.224495616 initrd.img.old 56
0.213313103 = 0.229043200 vmlinuz 21
0.197532654 = 0.212099072 vmlinuz.old 21

========= Devices which don't seem to have a corresponding hard drive: =========

sdd sde sdf sdg

=============================== StdErr Messages: ===============================

unlzma: Decoder error



My suspicion is that switching the installation medium switched you from a BIOS boot to a UEFI boot (or maybe the other way around). This would change the boot loader that Ubuntu installed, which in turn could easily affect the system's bootability.

After going back into the firmware to see how it presents the USB flash drive I was using (and now seeing the confusion between BIOS and EFI in the way this motherboard works), it is clear that it was booting it as UEFI. When booting from the USB flash drive, the install interface it presented was different from what I got from the burned CD, even though they were both made from the same image.

Edit: I suppose I should add some more information about the results from the boot info script. /dev/sda is 64GB SSD, on which I installed Ubuntu. /dev/sdb and /dev/sdc are the two 1TB drives which I intend to use in a RAID1 configuration for /home (haven't set it up yet), and at the moment it appears that Windows is installed on both of them, probably left over from the testing done at NCIX. This would have had no effect on the problems earlier, because they weren't yet connected. /dev/sdi is the 1GB USB flash drive I was attempting to install from earlier.

srs5694
July 22nd, 2011, 06:55 PM
It's good that it's working now; however, you've still got at least two problems:



Your partitions are not properly aligned. /dev/sda1 begins on sector #34, which is divisible by 2; and /dev/sda2 begins on sector 390,660, which is divisible by 4. You'll have to check with your SSD manufacturer to discover what's optimal for it, but chances are you need the sector values to be divisible by much higher power-of-2 values, such as 256, 512, 1024, or even 2048. The current standard is to create partitions that are aligned on 2048-sector (1 MiB) values, so whatever you're using is flying in the face of the current standard. This is bad because it will degrade performance and quite possibly reduce the useful lifetime of your SSD.
Your /dev/sda2 partition seems to contain a /boot directory with kernel, initial RAM disk, and GRUB files; however, your /dev/sda1 appears to be a separate /boot partition with these files and is configured in /etc/fstab to be mounted. GRUB seems to be using the files in /dev/sda2, though. This will likely cause problems in the future when you upgrade your kernel or upgrade to a new version of Ubuntu. It can probably be fixed by unmounting /dev/sda1 and removing its entry from /etc/fstab, but I haven't studied your configuration all that carefully, so it could be I'm missing an important detail.



It appears that your system is booting in BIOS mode right now. This is working, but with a GPT disk, it's best to have a BIOS Boot Partition, which you don't currently have. It's possible that future upgrades (kernel updates, GRUB updates, etc.) will cause the system to stop booting.

Overall, I recommend that you re-install again. This time, set up your partitions before you begin, using the procedure I outlined in my post #12, (http://ubuntuforums.org/showpost.php?p=11069130&postcount=12) or its equivalent using parted or GParted; or use one of these tools to wipe the disk of GPT data and create properly aligned MBR partitions using fdisk, parted, or GParted. If you stick with GPT, be sure to create a BIOS Boot Partition, and I strongly recommend also creating an EFI System Partition (ESP); even if you don't use EFI booting right now, having the partition there will give you the option to switch to EFI booting in the future if that becomes desirable.

Luke M
July 22nd, 2011, 07:32 PM
Is there any advantage to using GPT with a smaller than 2.2TB drive?

srs5694
July 23rd, 2011, 01:15 AM
Is there any advantage to using GPT with a smaller than 2.2TB drive?

Yes:



GPT does not use MBR's primary/extended/logical split of partition types; you've got a pool of 128 partition (which can be increased if necessary) and so you don't need to mess with the layout issues and limitations of MBR's primary/extended/logical distinctions.
GPT stores a backup of all critical partitioning data at the end of the disk, so that if something wipes out the data at the start of the disk, your partitions will remain intact. (This is useful against accidents with dd or the like, but not against bugs in or user errors with partitioning tools, of course.)
GPT includes CRCs of important data structures, which enables the OS and partitioning tools to detect corruption of the partition table.
GPT includes partition labels, which are independent of filesystem labels. These can be used to identify what partitions are for in partitioning tools that don't look inside filesystems (e.g., gdisk, parted).
GPT stores all partition start and end points as 64-bit LBA values. In addition to enabling >2TiB support, this means that there's no trace of the outmoded CHS codes in GPT (except in the protective MBR, which is a minor issue). As a practical matter, this isn't very important for most modern tools; but CHS/LBA issues were once common on MBR disks, and still crop up from time to time when using older utilities, particularly on sub-8GB disks. Of course, those same utilities would be useless on GPT disks.
GPT has a clearly-defined standards document, vs. MBR, which just sort of evolved over time. In theory, this makes for less ambiguity about how GPT works and therefore greater reliability of GPT tools, particularly when dealing with each others' partition tables. Unfortunately, this is more of a theoretical advantage than a real one; there are buggy GPT partitioning tools and outright violations of the standard that have become commonplace (such as hybrid MBRs (http://www.rodsbooks.com/gdisk/hybrid.html)).



GPT's biggest drawback is that it's not well supported by older OSes. Windows Vista and 7 can't boot from a GPT disk on a BIOS-based computer, and older versions of Windows, OS/2, BeOS, DOS, etc., can't read GPT at all. GPT is also not as well-understood by most end users, so it's easier to go astray by, for example, not including a BIOS Boot Partition on a disk that's to be booted using GRUB on a BIOS-based computer.

IMHO, for a Linux-only installation GPT's advantages outweigh its disadvantages, at least once you know enough about it to use it properly. (There's not all that much to learn -- mainly just forget about the primary/extended/logical partition annoyances and create a BIOS Boot Partition or EFI System Partition, as necessary for your firmware.) When dual-booting with Windows, though, the partition table type should be determined by your firmware: Use MBR for BIOS-based installations and GPT for UEFI-based installations.