Although it is theoretically possible to use a full disk to house your Linux
system, this is almost never done in practice. Instead, full disk block devices
are split up in smaller, more manageable block devices. These are called
The number of partitions is highly dependent on your environment. For instance,
if you have lots of users, you will most likely want to have your
As you can see, it very much depends on what you want to achieve. Separate partitions or volumes have the following advantages:
However, multiple partitions have one big disadvantage: if not configured properly, you might result in having a system with lots of free space on one partition and none on another. There is also a 15-partition limit for SCSI and SATA.
All disks in an SGI System require an
The following is an example excerpt from an
# fdisk /dev/sda Command (m for help): x Expert command (m for help): m Command action b move beginning of data in a partition c change number of cylinders d print the raw data in the partition table e list extended partitions f fix partition order g create an IRIX (SGI) partition table h change number of heads m print this menu p print the partition table q quit without saving changes r return to main menu s change number of sectors/track v verify the partition table w write table to disk and exit Expert command (m for help): g Building a new SGI disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content will be irrecoverably lost. Expert command (m for help): r Command (m for help): p Disk /dev/sda (SGI disk label): 64 heads, 32 sectors, 17482 cylinders Units = cylinders of 2048 * 512 bytes ----- partitions ----- Pt# Device Info Start End Sectors Id System 9: /dev/sda1 0 4 10240 0 SGI volhdr 11: /dev/sda2 0 17481 35803136 6 SGI volume ----- Bootinfo ----- Bootfile: /unix ----- Directory Entries ----- Command (m for help):
Now that an SGI Disklabel is created, partitions may now be defined. In the
above example, there are already two partitions defined for you. These are the
special partitions mentioned above and should not normally be altered. However,
for installing Gentoo, we'll need to load a bootloader, and possibly multiple
kernel images (depending on system type) directly into the volume header. The
volume header itself can hold up to
The process of making the volume header larger isn't exactly straight-forward; there's a bit of a trick to it. One cannot simply delete and re-add the volume header due to odd fdisk behavior. In the example provided below, we'll create a 50MB Volume header in conjunction with a 50MB /boot partition. The actual layout of your disk may vary, but this is for illustrative purposes only.
Command (m for help): n Partition number (1-16): 1 First cylinder (5-8682, default 5): 51 Last cylinder (51-8682, default 8682): 101(Notice how fdisk only allows Partition #1 to be re-created starting at a ) (minimum of cylinder 5? Had you attempted to delete & re-create the SGI ) (Volume Header this way, this is the same issue you would have encountered. ) (In our example, we want /boot to be 50MB, so we start it at cylinder 51 (the ) (Volume Header needs to start at cylinder 0, remember?), and set its ending ) (cylinder to 101, which will roughly be 50MB (+/- 1-5MB). ) Command (m for help): d Partition number (1-16): 9(Delete Partition #9 (SGI Volume Header)) Command (m for help): n Partition number (1-16): 9 First cylinder (0-50, default 0): 0 Last cylinder (0-50, default 50): 50(Re-Create Partition #9, ending just before Partition #1)
If you're unsure how to use
Once this is done, you are safe to create the rest of your partitions as you
see fit. After all your partitions are laid out, make sure you set the
partition ID of your swap partition to
Now that your partitions are created, you can continue with
On Cobalt machines, the BOOTROM expects to see a MS-DOS MBR, so partitioning
the drive is relatively straightforward -- in fact, it's done the same way as
you'd do for an Intel x86 machine.
For that reason, I recommend creating a ~20MB
I will assume you have created
So, continuing on... To create the partitions you type
# fdisk /dev/sda The number of cylinders for this disk is set to 19870. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)(Start by clearing out any existing partitions) Command (m for help): o Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. The number of cylinders for this disk is set to 19870. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)(You can now verify the partition table is empty using the 'p' command) Command (m for help): p Disk /dev/sda: 10.2 GB, 10254827520 bytes 16 heads, 63 sectors/track, 19870 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System(Create the /boot partition) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1(Just press ENTER here to accept the default) First cylinder (1-19870, default 1): Last cylinder or +size or +sizeM or +sizeK (1-19870, default 19870): +20M(and now if we type 'p' again, we should see the new partition) Command (m for help): p Disk /dev/sda: 10.2 GB, 10254827520 bytes 16 heads, 63 sectors/track, 19870 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System /dev/sda1 1 40 20128+ 83 Linux(The rest, I prefer to put in an extended partition, so I'll create that) Command (m for help): n Command action e extended p primary partition (1-4) e Partition number (1-4): 2(Again, the default is fine, just press ENTER.) First cylinder (41-19870, default 41): Using default value 41(We want to use the whole disk here, so just press ENTER again) Last cylinder or +size or +sizeM or +sizeK (41-19870, default 19870): Using default value 19870(Now, the / partition -- I use separate partitions for /usr, /var, etc... so / can be small. Adjust as per your preference.) Command (m for help): n Command action l logical (5 or over) p primary partition (1-4) l First cylinder (41-19870, default 41):<Press ENTER> Using default value 41 Last cylinder or +size or +sizeM or +sizeK (41-19870, default 19870): +500M(... and similar for any other partitions ...) (Last but not least, the swap space. I recommend at least 250MB swap, preferrably 1GB) Command (m for help): n Command action l logical (5 or over) p primary partition (1-4) l First cylinder (17294-19870, default 17294): <Press ENTER> Using default value 17294 Last cylinder or +size or +sizeM or +sizeK (1011-19870, default 19870): <Press ENTER> Using default value 19870(Now, if we check our partition table, everything should mostly be ship shape except for one thing...) Command (m for help): p Disk /dev/sda: 10.2 GB, 10254827520 bytes 16 heads, 63 sectors/track, 19870 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks ID System /dev/sda1 1 21 10552+ 83 Linux /dev/sda2 22 19870 10003896 5 Extended /dev/sda5 22 1037 512032+ 83 Linux /dev/sda6 1038 5101 2048224+ 83 Linux /dev/sda7 5102 9165 2048224+ 83 Linux /dev/sda8 9166 13229 2048224+ 83 Linux /dev/sda9 13230 17293 2048224+ 83 Linux /dev/sda10 17294 19870 1298776+ 83 Linux(Notice how #10, our swap partition is still type 83?) Command (m for help): t Partition number (1-10): 10 Hex code (type L to list codes): 82 Changed system type of partition 10 to 82 (Linux swap)(That should fix it... just to verify...) Command (m for help): p Disk /dev/sda: 10.2 GB, 10254827520 bytes 16 heads, 63 sectors/track, 19870 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks ID System /dev/sda1 1 21 10552+ 83 Linux /dev/sda2 22 19870 10003896 5 Extended /dev/sda5 22 1037 512032+ 83 Linux /dev/sda6 1038 5101 2048224+ 83 Linux /dev/sda7 5102 9165 2048224+ 83 Linux /dev/sda8 9166 13229 2048224+ 83 Linux /dev/sda9 13230 17293 2048224+ 83 Linux /dev/sda10 17294 19870 1298776+ 82 Linux Swap(Now, we write out the new partition table.) Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. #
And that's all there is to it. You should now be right to proceed onto the next
stage:
Now that your partitions are created, it is time to place a filesystem on them.
If you don't care about what filesystem to choose and are happy with what we
use as default in this handbook, continue with
To create a filesystem on a partition or volume, there are tools available for each possible filesystem:
| Filesystem | Creation Command |
|---|---|
For instance, to have the boot partition (
# mkfs.ext2 /dev/sda1 # mkfs.ext3 /dev/sda3
Now create the filesystems on your newly created partitions (or logical volumes).
# mkswap /dev/sda2
To activate the swap partition, use
# swapon /dev/sda2
Create and activate the swap with the commands mentioned above.
Now that your partitions are initialized and are housing a filesystem, it is
time to mount those partitions. Use the
# mount /dev/sda3 /mnt/gentoo # mkdir /mnt/gentoo/boot # mount /dev/sda1 /mnt/gentoo/boot
We will also have to mount the proc filesystem (a virtual interface with the
kernel) on
Continue with