Bug 121266

Summary: autopartition fails on Mac
Product: [Fedora] Fedora Reporter: Guy Streeter <streeter>
Component: partedAssignee: Jeremy Katz <katzj>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: aldyh, bnocera, byte, clumens, dwmw2, memeyou, nobody+pnasrat, nobody
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Linux   
Whiteboard:
Fixed In Version: 1.6.21-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-02-21 04:28:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 121179    
Attachments:
Description Flags
Partial fix.
none
Fixed patch
none
Support for lvm (LVM2 or lvm1 with no 0x8E checking)
none
Updated mac lvm patch to fix get_flag none

Description Guy Streeter 2004-04-19 20:32:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040404 Firefox/0.8

Description of problem:
selecting "autopartition" when installing to an iMac doesn't result in
the creation of an Apple_BootStrap partition, which is necessary in
order for the iMac to boot.

Version-Release number of selected component (if applicable):
anaconda-9.92-5

How reproducible:
Always

Steps to Reproduce:
1. install to an iMac
2. select "autopartition"
3.
    

Actual Results:  no apple bootstrap partition

Expected Results:  apple bootstrap partition

Additional info:

Comment 1 Jeremy Katz 2004-04-19 22:16:12 UTC
Yes, Mac stuff is only partially implemented atm 

Comment 2 Guy Streeter 2004-04-19 22:20:05 UTC
I tried manually adding an Apple Bootstrap partition. It appeared to
let me do that, but the partition doesn't show up in the list.

Comment 3 Bastien Nocera 2004-06-10 09:57:43 UTC
I found that when adding the Apple Bootstrap partition by hand, it
would be added at the end of the list (ended up being hda4), even
though I create that partition first (should have been hda2, hda1
being the partition table). bug #125699.

Comment 4 Paul Nasrat 2004-07-05 14:44:07 UTC
Checked in a modification to do this onto HEAD.

Comment 5 W. Michael Petullo 2004-09-05 18:53:48 UTC
My understanding is that the Apple_Bootstrap partition type is not
required to boot.  I believe that the Apple_Bootstrap type was
arbitrarily chosen because Mac OS X will not try to mount it
automatically.  In this manner, the partition will remain "hidden" to
Mac OS X.

Comment 6 Colin Charles 2005-01-28 17:43:15 UTC
colin->nasrat: did this in anaconda HEAD make it into fc3? I think this still
doesn't happen with auto partitioning...

Comment 7 David Woodhouse 2005-02-18 23:11:00 UTC
Created attachment 111217 [details]
Partial fix.

This patch goes part of the way to fixing the problem. 

- Fix the check for PMac in getAutopartitionBoot().
- Don't use LVM on PMac (should we do this based on the disk's partition type
  instead of the platform)?
- Fix autoCreatePartitionRequests to work again, but do no LVM.
- Attempt to put Apple Bootstrap first, like PReP partitions
- Attempt to make isBootable() true for Apple Bootstrap partitions

The latter doesn't seem to have the desired effect, so the penultimate one
isn't happening either. I'm not sure why. 

Other than that, there are a couple of remaining problems.

- When we delete all existing partitions for autopartitioning, anaconda doesn't

realise that /dev/hda1 is actually the partition table itself, in the Mac
scheme. It attempts to create a real partition as /dev/hda1, when in fact the
first partition must be /dev/hda2.

- When we select 'delete only Linux partitions' for autopartitioning, it
doesn't remove the previous Apple Bootstrap partition. Might be nice if we
could detect that it's a yaboot partition.

Comment 8 David Woodhouse 2005-02-19 03:23:17 UTC
*** Bug 121384 has been marked as a duplicate of this bug. ***

Comment 9 David Woodhouse 2005-02-19 14:07:46 UTC
Created attachment 111228 [details]
Fixed patch

This patch should be complete. It does the following:

- Put Apple Bootstrap partitions first, like we do for PReP in fitSized()
- Fix typo in BOOTALPHA_NOT_BSD failure in doPartitioning()
- Don't let doClearPartAction() remove the partition table itself
- Fix autoCreatePartitionRequests() to accept (but ignore) asvol element
- Fix PMac detection in getAutopartitionBoot() and remove separate /boot
- Consider Apple Bootstrap partitions 'native' so they can be replaced
- Use autoCreatePartitionRequests() instead of the LVM version on PMac
- Make get_partition_file_system_type() detect Apple Bootstrap partitions
- Make getBootableRequest() treat Apple Bootstrap as bootable.
- Require Apple Bootstrap on PMac.

This seems to do the right thing in all cases I tested -- both with and without
an existing partition table, with automatic and manual partitioning.

Comment 10 Paul Nasrat 2005-02-19 17:49:09 UTC
Thanks for the patch commited

Comment 11 Paul Nasrat 2005-02-21 00:30:08 UTC
Created attachment 111244 [details]
Support for lvm (LVM2 or lvm1 with no 0x8E checking)

Liased with Jeremy and have reverted some of the above.

Fix parted to support LVM flags on mac partition tables.  I'm doing an install
with a libparted built from this in RHupdates right now and it seems to be
fine.

Caveat - LVM2 only unless partition type (0x8E) checking is not performed on
LVM1.

Comment 13 Paul Nasrat 2005-02-21 01:21:37 UTC
Linux localhost.localdomain 2.6.10-1.1146_FC4 #1 Sat Feb 19 00:28:29 EST 2005
ppc ppc ppc GNU/Linux

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/dev/hda10 on /boot type ext3 (rw)

Disk geometry for /dev/hda: 0.000-9736.945 megabytes
Disk label type: mac
Minor    Start       End     Filesystem  Name                  Flags
1          0.000      0.031              Apple
2          0.031      0.057              Macintosh
3          0.058      0.093              Macintosh
4          0.094      0.120              Macintosh
5          0.120      0.156              Macintosh
6          0.156      0.253              Macintosh
7          0.254      0.503              Macintosh
8          0.504      0.753              Patch Partition
9          0.754      1.753  hfs         untitled              boot
10         1.754    101.753  ext3        untitled
11       101.754   9736.945              lvm
Information: Don't forget to update /etc/fstab, if necessary.


Comment 14 Jeremy Katz 2005-02-21 01:36:42 UTC
flags should be getting set to include lvm for the partition with a volume name
of 'lvm'.

Comment 15 Paul Nasrat 2005-02-21 02:03:17 UTC
Created attachment 111246 [details]
Updated mac lvm patch to fix get_flag

Disk geometry for /dev/hda: 0.000-9736.945 megabytes
Disk label type: mac
Minor	 Start	     End     Filesystem  Name		       Flags
1	   0.000      0.031		 Apple
2	   0.031      0.057		 Macintosh
3	   0.058      0.093		 Macintosh
4	   0.094      0.120		 Macintosh
5	   0.120      0.156		 Macintosh
6	   0.156      0.253		 Macintosh
7	   0.254      0.503		 Macintosh
8	   0.504      0.753		 Patch Partition
9	   0.754      1.753  hfs	 untitled	       boot
10	   1.754    101.753  ext3	 untitled
11	 101.754   9736.945		 lvm		       lvm