Difference between revisions of "Mac HD Partitions"

From FreekiWiki
Jump to navigation Jump to search
(wrote some more)
(→‎The Partitions: a little more tabel detail)
Line 16: Line 16:
 
Note that this looks different from the x86 (PC) fdisk partition table, but the contents are essentially the same.  One major difference is that the PPC partition table listing actually contains a reference to the table itself.  Another difference is the partition type names. Let's examine the table a little closer.
 
Note that this looks different from the x86 (PC) fdisk partition table, but the contents are essentially the same.  One major difference is that the PPC partition table listing actually contains a reference to the table itself.  Another difference is the partition type names. Let's examine the table a little closer.
  
 +
* The table has several lines.  The first line shows the device being examined, in this case '''/dev/hda'''. The second line contains column titles.  The names are pretty much self explanatory; the '#' represents 'partition number'.
 +
* There is one line for each defined partition.  If there is any unused space on the disk after all partitions are defined,  there will be a line for that, also.
 
* The disk size in blocks is shown at the end of the listing, along with the block size.  Multiplying these numbers together gives the size of the disk in bytes, in this case, about 7.5GB.
 
* The disk size in blocks is shown at the end of the listing, along with the block size.  Multiplying these numbers together gives the size of the disk in bytes, in this case, about 7.5GB.
 
* The first partition, '''/dev/hda1''', contains the partition table (called '''partition map''' here).  It starts at block 1 and is 63 blocks long. It has no formal filesystem (i.e., it is raw data).
 
* The first partition, '''/dev/hda1''', contains the partition table (called '''partition map''' here).  It starts at block 1 and is 63 blocks long. It has no formal filesystem (i.e., it is raw data).
Line 24: Line 26:
 
During Ubuntu installation from CD, at the partition creation step, the size of the swap partition is calculated from the memory size, and the size of the Linux partition is caclulated as whatever is left over.
 
During Ubuntu installation from CD, at the partition creation step, the size of the swap partition is calculated from the memory size, and the size of the Linux partition is caclulated as whatever is left over.
 
This information will be used later in this article when talking about [[#Manual Partitioning|Manual Partitioning]].  Notice that the '''base''', or start, block of a partition can be calculated by adding the lengths of all previous partitions, and then adding one to that total.
 
This information will be used later in this article when talking about [[#Manual Partitioning|Manual Partitioning]].  Notice that the '''base''', or start, block of a partition can be calculated by adding the lengths of all previous partitions, and then adding one to that total.
 
 
  
 
==Manual Partitioning==
 
==Manual Partitioning==
  
 
[[Category:Macintosh]]
 
[[Category:Macintosh]]

Revision as of 16:25, 12 February 2007

The Partitions

The discussion here assumes that the reader might be familiar with partitions on PC (x86) hard drives.

The Ubuntu install process on PowerPC machines (iMac, PowerMac, etc) creates four partitions. Using the command sudo fdisk -l /dev/hda in a terminal (assuming that the device is a hard drive and has been formatted by Ubuntu), the partition table can be printed out. Here is a typical example:

/dev/hda
        #                 type name           length   base     ( size )  system
/dev/hda1  Apple_partition_map Apple              63 @ 1        ( 31.5k)  Partition map
/dev/hda2      Apple_Bootstrap untitled         1954 @ 64       (977.0k)  NewWorld bootblock
/dev/hda3      Apple_UNIX_SVR2 untitled     13931641 @ 2018     (  6.6G)  Linux native
/dev/hda4      Apple_UNIX_SVR2 swap           734631 @ 13933659 (358.7M)  Linux swap

Block size=512, Number of Blocks=14668290
DeviceType=0x0, DeviceId=0x0

Note that this looks different from the x86 (PC) fdisk partition table, but the contents are essentially the same. One major difference is that the PPC partition table listing actually contains a reference to the table itself. Another difference is the partition type names. Let's examine the table a little closer.

  • The table has several lines. The first line shows the device being examined, in this case /dev/hda. The second line contains column titles. The names are pretty much self explanatory; the '#' represents 'partition number'.
  • There is one line for each defined partition. If there is any unused space on the disk after all partitions are defined, there will be a line for that, also.
  • The disk size in blocks is shown at the end of the listing, along with the block size. Multiplying these numbers together gives the size of the disk in bytes, in this case, about 7.5GB.
  • The first partition, /dev/hda1, contains the partition table (called partition map here). It starts at block 1 and is 63 blocks long. It has no formal filesystem (i.e., it is raw data).
  • The second partition, /dev/hda2, contains the boot information. Its type and system designations indicate this. This partition is created as an hfs filesystem. (hfs is the original Apple filesystem type). It contains three files: ofboot.b, yaboot, and yaboot.conf. The partition can actually be mounted in Linux with type hfs, and the files manipulated. This partition starts at block 64, the first block after the end of the first partition, and is 1954 blocks long.
  • The third partition, /dev/hda3, is the Linux partition. It starts at block 2018, the fist block after the end of the second partition. It's length is almost the entire rest of the disk, except for the space reserved for the swap partition. The Ubuntu installation partitioning process installs an ext3 filesystem here by default.
  • The fourth partition, /dev/hda4, is the swap partition. It start immediately after the Linux partition, and it's length represents approximately 1.5 times memory size.

During Ubuntu installation from CD, at the partition creation step, the size of the swap partition is calculated from the memory size, and the size of the Linux partition is caclulated as whatever is left over. This information will be used later in this article when talking about Manual Partitioning. Notice that the base, or start, block of a partition can be calculated by adding the lengths of all previous partitions, and then adding one to that total.

Manual Partitioning