0

Linux noobie here.. i have a couple of things going..i have successfully loaded linux on my 2010 mbp. using this process:http://heeris.id.au/2014/ubuntu-plus-mac-pure-efi-boot/ it went very smooth. but there is a long ugly background to the mac & linux in regards to the video drivers, etc. after install, during a video, the machine froze up. cold boot, etc.. nothing going right.. so i am walking back thru the install process and notice 2 things:  (1) during boot with live usb, i escape to the grub command line and find grub (hd2,gpt2), set root, tell grub where linux is with UUID, set initrd, then boot from grub command line and get to a tty prompt in linux because.. "Failed to start the X server (your graphical interface). It is likely that it is not set up correctly....The X server is now disabled. Restart MDM when it is configured correctly.".. so off i go trying to google my way out but decide to type in sudo fdisk -l and find: 

sudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util
fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        2047        1023+  ee  GPT
/dev/sda2            2048     1023999      510976   af  HFS / HFS+
/dev/sda3   *     1024000   608757759   303866880   83  Linux
/dev/sda4       608757760   625141759     8192000   82  Linux swap /   Solaris

which is what i expected given the recent install...but then i reboot to a rescue disk all the way to the desktop and

run sudo gparted and see this:

(2) device (boot) - id - system
sda1 -  - hfs+ - ubuntu..... 500MB
sda2 -  - ext4.........289GB
sda3 - 82 - linux swap......7.8GB

cat /etc/fstab
overlayfs / overlayfs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sda3 swap swap defaults 0 0

i am very confused at what is going on at this point... why the differences for sda3? that is, is linux on sda2 ext4 or sda3 ext4?... i'm sure all of this ties to the x org crap but i don't know how.. any thoughts are appreciated.. this forum has been tremendously helpful.

here is the latest after i used gdisk to make a ef00 and an ef02 partition.

mint@mint  ~ $ sudo parted /dev/sda print

Error: Input/output error during read on /dev/sda                         
Retry/Ignore/Cancel? r                                                    
Error: Input/output error during read on /dev/sda                         
Retry/Ignore/Cancel? c                                                    
Error: The primary GPT table is corrupt, but the backup appears OK  so that will be used.
OK/Cancel? c                                                              

mint@mint ~ $ sudo gdisk -l /dev/sda

GPT fdisk (gdisk) version 0.8.8
Warning! Read error 0! Misbehavior now likely!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): DA332839-53FE-472E-94F4-4B731ED5D489
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
1            2048          411647   200.0 MiB   EF00  EFI System
2          411648          616447   100.0 MiB   EF02  BIOS boot partition
3          616448       608790527   290.0 GiB   8300  Linux filesystem
4       608790528       625142414   7.8 GiB     8200  Linux swap
mint@mint ~ $

now after i formatted with gparted it looks like this. a bit better..?

mint@mint ~ $ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.8

Warning! Read error 0! Misbehavior now likely!
Partition table scan:
MBR: hybrid
BSD: not present
APM: not present
GPT: present

Found valid GPT with hybrid MBR; using GPT.
Disk /dev/sda: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): DA332839-53FE-472E-94F4-4B731ED5D489
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
1            2048          411647   200.0 MiB   EF00  EFI System
2          411648          616447   100.0 MiB   EF02  BIOS boot partition
3          616448       608790527   290.0 GiB   8300  Linux filesystem
4       608790528       625142414   7.8 GiB     8200  Linux swap
mint@mint ~ $

1 Answers1

0

The differences between fdisk and parted output are because fdisk doesn't support the GUID Partition Table (GPT) used on your disk. In fact, fdisk tells you this quite explicitly:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util
fdisk doesn't support GPT. Use GNU Parted.

What fdisk is showing you is the MBR side of a hybrid MBR, which is an ugly and dangerous hack that Apple uses to support dual-booting between OS X and Windows. A hybrid MBR might or might not be necessary on your computer, depending on how Ubuntu was installed.

Of equal concern, you've shown no evidence that your computer has an EFI System Partition (ESP). This is a necessary part of a normal EFI boot process. I emphasize the word normal because Macs are weird, and can boot without an ESP -- but even Macs normally ship with an ESP available. If you've accidentally deleted your ESP, your OS X would probably boot, but it might cause Ubuntu to fail to boot, depending on how it was installed. That said, your parted information was a summary, not a complete cut-and-paste, so you might simply have omitted information on your ESP. (Tip: Don't summarize the output of programs like parted that give text-mode output. Cut-and-paste the relevant output, as you did for fdisk -- ideally, you should provide the complete program output, unless that's too large. Nine times out of ten, summaries of such program output omit the details that are most important.)

Overall, I'd say your partitioning setup is a bit suspect and may be the cause of some of your problems. Posting the complete output of parted /dev/sda print may help clarify things. (Edit your original post, then add a comment to this one so I'll notice it.) The output of sudo gdisk -l /dev/sda may also be helpful. Your video problems are likely to be unrelated to the disk issues. I recommend solving your boot problems and then create a separate question for your video issues.


EDIT:

Your edit shows that both parted and gdisk are reporting I/O errors when accessing the disk. This most likely indicates a hardware failure, which could well be the cause of your earlier problems, too. If you're lucky, the problem is nothing worse than a bad cable or loose connector; but it could be a much more serious problem. I recommend you check the SMART status of the disk. If that turns up problems, you should replace the disk immediately. If the SMART status looks OK, try re-seating the connectors and, if possible, replace the disk's data cable.

Rod Smith
  • 45,120
  • 7
  • 66
  • 108