Handbook:PPC/Blocks/Disks/ru

Разделы
Although it is theoretically possible to use a full disk to house a Linux system, this is almost never done in practice. Instead, full disk block devices are split up in smaller, more manageable block devices. On most systems, these are called partitions.

Apple New World
Apple New World machines are fairly straightforward to configure. The first partition is always an Apple Partition Map. This partition keeps track of the layout of the disk. It is not possible to remove this partition. The next partition should always be a bootstrap partition. This partition contains a small (800k) HFS filesystem that holds a copy of the bootloader Yaboot and its configuration file. This partition is not the same as a partition as found on other architectures. After the boot partition, the usual Linux filesystems are placed, according to the scheme below. The swap partition is a temporary storage place for when the system runs out of physical memory. The root partition will contain the filesystem that Gentoo is installed on. To dual boot, the OSX partition can go anywhere after the bootstrap partition to insure that yaboot starts first.

Apple Old World
Apple Old World machines are a bit more complicated to configure. The first partition is always an Apple Partition Map. This partition keeps track of the layout of the disk. It is not possible to remove this partition. When using BootX, the configuration below assumes that MacOS is installed on a seperate disk. If this is not the case, there will be additional partitions for "Apple Disk Drivers" such as Apple_Driver63, Apple_Driver_ATA, Apple_FWDriver, Apple_Driver_IOKit, Apple_Patches and the MacOS install. When using Quik, it is necessary to create a boot partition to hold the kernel, unlike other Apple boot methods. After the boot partition, the usual Linux filesystems are placed, according to the scheme below. The swap partition is a temporary storage place for when the system runs out of physical memory. The root partition will contain the filesystem that Gentoo is installed on.

Example partition layout for Old World

Pegasos
The Pegasos partition layout is quite simple compared to the Apple layouts. The first partition is a Boot Partition, which contains kernels to be booted, along with an Open Firmware script that presents a menu on boot. After the boot partition, the usual Linux filesystems are placed, according to the scheme below. The swap partition is a temporary storage place for when the system runs out of physical memory. The root partition will contain the filesystem that Gentoo is installed on.

Example partition layout for Pegasos systems

IBM PReP (RS/6000)
The IBM PowerPC Reference Platform (PReP) requires a small PReP boot partition on the disk's first partition, followed by the swap and root partitions.

Example partition layout for the IBM PReP

Using mac-fdisk (Apple)
At this point, create the partitions using mac-fdisk:

If Apple's Disk Utility was used prior to leave space for Linux, first delete the partitions that might have been created previously to make room for the new install. Use in mac-fdisk to delete those partition(s). It will ask for the partition number to delete. Usually the first partition on NewWorld machines (Apple_partition_map) cannot be deleted. To start with a clean disk, simply initialize the disk by pressing. This will completely erase the disk, so use this with caution.

Second, create an Apple_Bootstrap partition by using. It will ask for what block to start. Enter the number of the first free partition, followed by a. For instance this is 2p.

Now create a swap partition by pressing. Again mac-fdisk will ask for what block to start this partition from. As we used 2 before to create the Apple_Bootstrap partition, now enter 3p. When sked for the size, enter 512M (or whatever size needed -- a minimum of 512MB is recommended, but 2 times the physical memory is the generally accepted size). When asked for a name, enter swap.

To create the root partition, enter, followed by 4p to select from what block the root partition should start. When asked for the size, enter 4p again. mac-fdisk will interpret this as "Use all available space". When asked for the name, enter root.

To finish up, write the partition to the disk using and  to quit mac-fdisk.

Using parted (Pegasos and RS/6000)
parted, the Partition Editor, can now handle HFS+ partitions used by Mac OS and Mac OS X. With this tool it is possible to resize the Mac partitions and create space for the Linux partitions. Nevertheless, the example below describes partitioning for Pegasos machines only.

To begin let's fire up parted:

If the drive is unpartitioned, run  to create a new disklabel for the drive.

It is possible to type  at any time in parted to display the current partition table. To abort parted, press.

If next to Linux, the system is also meant to have MorphOS installed, then create an affs1 filesystem at the start of the drive. 32MB should be more than enough to store the MorphOS kernel. With a Pegasos I, or when Linux will use any filesystem besides ext2 or ext3, then it is necessary to also store the Linux kernel on this partition (the Pegasos II can only boot from ext2/ext3 or affs1 partitions). To create the partition run  where START and END should be replaced with the megabyte range (e.g. 0 32) which creates a 32 MB partition starting at 0MB and ending at 32MB. When creating an ext2 or ext3 partition instead, substitute ext2 or ext3 for affs1 in the mkpart command.

Create two partitions for Linux, one root filesystem and one swap partition. Run  to create each partition, replacing START and END with the desired megabyte boundries.

It is generally recommended to create a swap partition that is two times bigger than the amount of RAM in the computer, but at least 512Mb is recommended. To create the swap partition, run  with START and END again denoting the partition boundries.

When done in parted simply type.