You are not logged in.

#1 2011-08-19 23:36:00

btouellette
Member
Registered: 2010-03-05
Posts: 23

Macbook Air 3.2 Install

Trying to get Arch up and running on my MBA following these here:
https://bbs.archlinux.org/viewtopic.php?id=111698
https://bbs.archlinux.org/viewtopic.php?id=119212

I partition the HD (sdb1: EFI system partition/sdb2: HFS+ OSX install/sdb3: ext2 Arch install), install refit, boot to USB key of archboot, and install just fine. I set mountpoints (no swap, root as /dev/sdb3) I go to install bootloader manually and I'm running into issues. I'm trying as follows:

mount -o bind /dev /tmp/install/dev
mkdir /tmp/install/proc
mount -t proc none /tmp/install/proc
chroot /tmp/install
grep -v rootfs /proc/mounts > /etc/mtab
grub-install /dev/sdb3 --no-floppy

Error: The file /boot/grub/stage1 not read correctly

From the grub prompt

grub> find /boot/grub/stage1

Error 15: File not found

But the file is present at /boot/grub/stage1 inside the chroot. Trying to set root as hd1,1 or even hd0,1 from inside the grub prompt reports no such partition. Any idea what is going on? I think it might be that the MBR doesn't have an entry for the new partition. Adding it to a hybrid via gdisk or the refit sync tool makes my USB key unbootable (Missing operating system error).

Last edited by btouellette (2011-08-20 01:47:19)

Offline

#2 2011-08-20 12:01:15

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Macbook Air 3.2 Install

The preferred way to install grub is not via grub-install, but as follows; enter your chroot, start grub and enter these:

$ grub
grub> root(hd0,2)
grub> setup(hd0,2)

see https://wiki.archlinux.org/index.php/GR … _partition

Last edited by Spider.007 (2011-08-20 12:01:30)

Offline

#3 2011-08-20 14:38:07

btouellette
Member
Registered: 2010-03-05
Posts: 23

Re: Macbook Air 3.2 Install

Spider.007 wrote:

The preferred way to install grub is not via grub-install, but as follows; enter your chroot, start grub and enter these:

$ grub
grub> root(hd0,2)
grub> setup(hd0,2)

see https://wiki.archlinux.org/index.php/GR … _partition

Thanks for the advice. As I understand it, grub-install is just a script that uses the GRUB prompt. Regardless, from the GRUB prompt root(hd0,2) reports no such partition.

Offline

#4 2011-08-20 16:09:37

tom.yan
Member
From: Hong Kong
Registered: 2011-04-29
Posts: 27

Re: Macbook Air 3.2 Install

since i saw efi systen partition in you scheme so i believe you're using gpt for your hdd?

I guess you need grub2:
https://wiki.archlinux.org/index.php/GU … tion_Table

Archlinux provides three bootloaders GRUB-Legacy, GRUB2 and Syslinux. The default bootloader of Archlinux installer - GRUB-Legacy, does not support GPT.

GRUB2 provides the ability to boot from GPT in both BIOS based systems and UEFI based systems. All partition defining commands remain the same ( like (hd0,8) ). Just load the part_gpt grub2 module from grub2 shell or include "insmod part_gpt" line before "set root=" line in grub.cfg file. Usually grub-probe will automatically add this module to core.img or grub.efi file if it detects the HDD to be using GPT.

Last edited by tom.yan (2011-08-20 16:11:33)

Offline

#5 2011-08-21 11:41:15

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Macbook Air 3.2 Install

btouellette wrote:
Spider.007 wrote:

The preferred way to install grub is not via grub-install, but as follows; enter your chroot, start grub and enter these:

$ grub
grub> root(hd0,2)
grub> setup(hd0,2)

see https://wiki.archlinux.org/index.php/GR … _partition

Thanks for the advice. As I understand it, grub-install is just a script that uses the GRUB prompt. Regardless, from the GRUB prompt root(hd0,2) reports no such partition.

Well, it has worked for me on multiple machines, did you have refit sync GPT<>MBR? If you did, there is no need to use GPT specific tools like tom.yan suggests smile

Can you post the output of `fdisk -l /dev/sda` and the contents of /boot/grub/device.map ?

Last edited by Spider.007 (2011-08-21 11:41:36)

Offline

#6 2011-08-22 03:22:26

btouellette
Member
Registered: 2010-03-05
Posts: 23

Re: Macbook Air 3.2 Install

Spider.007 wrote:

Well, it has worked for me on multiple machines, did you have refit sync GPT<>MBR? If you did, there is no need to use GPT specific tools like tom.yan suggests :)

Can you post the output of `fdisk -l /dev/sda` and the contents of /boot/grub/device.map ?

If I gptsync from refit after partitioning I can no longer boot to my USB key with Archboot to reattempt the install (just says "Missing operating system" after selecting it in refit). I would like to use this option and a legacy GRUB chainloaded since it is what I'm familiar with but I cannot boot to try to install GRUB to the partition directly.

Since the MBR only has the one entry spanning the entire disk (normal for GPT scheme AFAIK) I will have to use GRUB2 or some GPT aware bootloader unless I sync MBR and GPT. I can use gdisk from command-line post-install instead of gptsync from refit shell to sync MBR and GPT (hybrid) without reboot. This affected some change in manual GRUB (not GRUB2) install from inside chroot as I can now set the root device successfully

[root@archboot /]# grub-install --no-floppy /dev/sda3
The file /boot/grub/stage1 not read correctly
[root@archboot /]# grub
grub> device (hd0) /dev/sda
grub> root (hd0,2)
 Filesystem type unknown, partition type 0xef
grub> setup (hd0,2)
Error 17: Cannot mount selected partition

Installing GRUB2 from the Arch install menu fails however and my attempts to install it manually have been just as successful.

On trying to install GRUB2 from command-line after install (no chroot)

[Arch Linux: /]# grub_bios-install --boot-directory=/boot --no-floppy --recheck /dev/sda3
/sbin/grub-probe: error: cannot stat `rootfs'.

I cannot find anything about this error message online. Same error with grub_ef_x86_64-install. My mounts at this point are as follows

[Arch Linux: /]# cat /proc/mounts
rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
/sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=465902,mode=755 0 0
/run /run tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600,ptmxmode=000 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
/dev/sda3 /tmp/install ext2 rw,relatime,errors=continue 0 0
/dev/sdc /src iso9660 ro,relatime 0 0
/dev/loop0 /packages/core-x86_64 squashfs ro,relatime 0 0
/dev/loop1 /packages/core-any squashfs ro,relatime 0 0

This is how I've been setting up partitions

(parted) print
Model: ATA APPLE SSD TS128C (scsi)
Disk /dev/sda: 236978176s
Sector size (logical/physical): 512B/512B

Number Start       End         Size        File system  Name                  Flags
 1     40s         409639s     409600s                  EFI system partition  boot
 2     409640s     117597143s  117187504s  hfs+         Customer
 3     117600256s  236978142s  119377887s  ext2

And finally my device.map

[Arch Linux: /]# cat /boot/grub/device.map
(hd0)  /dev/disk/by-id/ata-APPLE_SSD_TS128C_207A41K1K0WK
(hd1)  /dev/disk/by-id/usb-SanDisk_Cruzer_452760190081701E-0:0

Last edited by btouellette (2011-08-22 03:24:14)

Offline

#7 2011-08-24 11:29:19

Chais
Member
Registered: 2011-08-08
Posts: 33

Re: Macbook Air 3.2 Install

I can't help you regarding the SSD specific adaptions. What I can tell you is, that Grub2 needs to be installed inside the HFS+ partition serving as EFI system partition. Apple uses a non-standard EFI that won't boot from FAT32 partitions without switching to compatibility mode. After Grub is installed the .efi file and the drive containing it need to be blessed from within OSX. Apple uses a non-standard way, again, of setting boot targets.
The problem is that hfsprogs from AUR doesn't seem to work properly on 3.x Kernels. At least I'm unable to get write access on my EFI partition. I'm writing this on my Macbook 4,1 running Arch solely.


--
Chais

Offline

#8 2011-08-26 18:09:32

btouellette
Member
Registered: 2010-03-05
Posts: 23

Re: Macbook Air 3.2 Install

Chais wrote:

I can't help you regarding the SSD specific adaptions. What I can tell you is, that Grub2 needs to be installed inside the HFS+ partition serving as EFI system partition. Apple uses a non-standard EFI that won't boot from FAT32 partitions without switching to compatibility mode. After Grub is installed the .efi file and the drive containing it need to be blessed from within OSX. Apple uses a non-standard way, again, of setting boot targets.
The problem is that hfsprogs from AUR doesn't seem to work properly on 3.x Kernels. At least I'm unable to get write access on my EFI partition. I'm writing this on my Macbook 4,1 running Arch solely.

This is only true if you aren't running dual-boot right? If I'm installing Arch and keeping the OS X install then I should be able to use rEFIt to boot into either partition and just chainload into the Linux bootloader on the appropriate partition, no?

A few people in this thread (https://bbs.archlinux.org/viewtopic.php?id=111698) seem to have gotten that setup working on a 3,2.

Offline

#9 2011-08-27 13:44:21

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Macbook Air 3.2 Install

btouellette wrote:
Spider.007 wrote:

Well, it has worked for me on multiple machines, did you have refit sync GPT<>MBR? If you did, there is no need to use GPT specific tools like tom.yan suggests smile

Can you post the output of `fdisk -l /dev/sda` and the contents of /boot/grub/device.map ?

If I gptsync from refit after partitioning I can no longer boot to my USB key with Archboot to reattempt the install (just says "Missing operating system" after selecting it in refit).

I don't see how your harddisk partitioning could affect the ability to boot from USB? Also, the "Missing operating system" comes from grub, you are not presented with a grub menu before receiving that error? Are you sure you are selecting the correct disk (usbstick) in rEFIt?

I would like to use this option and a legacy GRUB chainloaded since it is what I'm familiar with but I cannot boot to try to install GRUB to the partition directly.

Since the MBR only has the one entry spanning the entire disk (normal for GPT scheme AFAIK) I will have to use GRUB2 or some GPT aware bootloader unless I sync MBR and GPT. I can use gdisk from command-line post-install instead of gptsync from refit shell to sync MBR and GPT (hybrid) without reboot. This affected some change in manual GRUB (not GRUB2) install from inside chroot as I can now set the root device successfully

[...]

While you might be wanting to install GRUB2, I can tell you it is not required for the MBA to boot. I have installed Archlinux by sycing GPT > MBR, helping (c)fdisk to properly find all partitions, and completing a normal installation, installing GRUB (1) to the partition where Archlinux is installed and then syncing MBR > GPT. That was all I needed to do for me to successfully boot Arch smile

Offline

Board footer

Powered by FluxBB