Section A.3. Partitioning


A.3. Partitioning

As we noted in Section 11.1.3, x86-based Macintosh computers do not use the Apple partitioning scheme (also called Apple Partition Map, or APM)they use the GUID Partition Table (GPT) scheme, which is defined by EFI. Specifically, internal drives use GPT, whereas external drives use APM by default. We discussed GPT in Section 4.16.4.4. We also saw an example of working with GPT partitions using the gpt command in Section 11.4.4. We can use gptand other commands such as diskutil and hdiutilto display partitioning-related information about a volume, say, the root volume. Figure A2 shows an example.

Figure A2. Using command-line tools to display partitioning-related information

$ mount /dev/disk0s2 on / (local, journaled) $ sudo gpt -r show /dev/rdisk0       start       size  index  contents           0          1         PMBR           1          1         Pri GPT header           2         32         Pri GPT table          34          6          40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B      409640  311909984      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC   312319624     262151   312581775         32         Sec GPT table   312581807          1         Sec GPT header $ diskutil info disk0 ...    Partition Type:     GUID_partition_scheme    Media Type:         Generic    Protocol:           SATA ... $ sudo hdiutil pmap /dev/rdisk0 ...

We see in Figure A2 that the disk has two partitions, the second of which (disk0s2) is the root volume. The first partition, which is about 200MB (409600 512-byte blocks) in size, is a FAT32 partition that could be used by EFI as a dedicated on-disk system partition (see Section 4.16.4.4). You can normally mount this partition from Mac OS X.

$ mkdir /tmp/efi $ sudo mount_msdos /dev/disk0s1 /tmp/efi kextload: /System/Library/Extensions/msdosfs.kext loaded successfully $ df -k /tmp/efi Filesystem   1K-blocks Used  Avail Capacity  Mounted on /dev/disk0s1    201609    0 201608     0%    /private/tmp/efi





Mac OS X Internals. A Systems Approach
Mac OS X Internals: A Systems Approach
ISBN: 0321278542
EAN: 2147483647
Year: 2006
Pages: 161
Authors: Amit Singh

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net