Hard Disk Partitioning

Using fips

If your machine is going to be dedicated to Linux, you can skip this step. But if you want to install it alongside your current operating system, you will need to make space on the hard disk for new partitions. To do this, create a DOS boot disk containing the FIPS program:
d:
cd \install\fips
format a: /s
copy *.exe a:
Additional information is in the files README.1ST and FIPS.DOC. However the procedure is basically as follows:
  1. Back up your hard disk in case anything goes wrong!
  2. Run a disk check on your hard disk (e.g. scandisk) as FIPS will refuse to run if it detects any inconsistencies
  3. Defragment your hard disk
  4. Reboot with the floppy you just created, and run FIPS
  5. Follow the prompts; you will be allowed to choose how much space to leave in your current partition, and how much space to allocate in the new one. I suggest you allocate 100-300MB to Linux depending on whether you are likely to install some of the bigger options (like the compilers and the X Window System)
  6. When you give final confirmation, FIPS will split your existing DOS or Windows partition into two. The second partition can be deleted during the Linux install and replaced with Linux partitions.

Running fdisk

fdisk is the program to modify a drive's partition table. You can run it from the Linux prompt; in the case of Red Hat installation, a menu of drives is given and you select the "Edit" button to run fdisk on that drive.

You can get a menu of commands by typing 'm', and a printout of the state of the partition table with 'p'. At any stage you can abort (Ctrl-C) and no changes will be made to the disk. It is a good idea to use 'p' frequently to check what you have done at each stage.

A typical partition session might look like this - but don't follow the exact keys given since you will have to choose appropriate commands for your system (e.g. depending on the size of the hard drive and how much space you have made available for Linux). A recommended size for the swap space is 20MB or twice the amount of RAM in your system, whichever is larger.

Hint: if you put your swap space before your root partition, it is easy to set that to a specific size in megabytes, and then leave all remaining space for your root partition.

# fdisk /dev/hda

Command (m for help): p              print the partition table

Disk /dev/hda: 128 heads, 63 sectors, 622 cylinders
Units = cylinders of 8064 * 512 bytes

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1            1        1      293  1181344+   6  DOS 16-bit >=32M
/dev/hda2          294      294      622  1326528    6  DOS 16-bit >=32M

Command (m for help): d              delete a partition
Partition number (1-2): 2            this one

Command (m for help): p              print the partition table again

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1            1        1      293  1181344+   6  DOS 16-bit >=32M

Command (m for help): n              create new partition (for swap)
Command action
   e   extended
   p   primary partition (1-4)
p                                    we want a primary partition
Partition number (1-4): 2
First cylinder (294-622): 294        use the lowest number given
Last cylinder or +size or +sizeM or +sizeK ([294]-622): +20M

Command (m for help): p              print the partition table again

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1            1        1      293  1181344+   6  DOS 16-bit >=32M
/dev/hda2          294      294      299    24160+  83  Linux native

Command (m for help): t              change partition type
Partition number (1-4): 2
Hex code (type L to list codes): 82  swap type

Command (m for help): p              print the partition table yet again

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1            1        1      293  1181344+   6  DOS 16-bit >=32M
/dev/hda2          294      294      299    24160+  82  Linux swap

Command (m for help): n              new partition (for root filesystem)
Command action
   e   extended
   p   primary partition (1-4)
p                                    primary partition
Partition number (1-4): 3
First cylinder (300-622): 300        first available
Last cylinder or +size or +sizeM or +sizeK ([300]-622): 622
      (use largest number shown to use all remaining space on hard disk)

Command (m for help): p              final check of partition table

   Device Boot   Begin    Start      End   Blocks   Id  System
/dev/hda1            1        1      293  1181344+   6  DOS 16-bit >=32M
/dev/hda2          294      294      299    24160+  83  Linux swap
/dev/hda3          300      300      622  1302304+  83  Linux native

If it looks good:

Command (m for help): w              write partition table to disk
The partition table has been altered!

Calling ioctl() to re-read partition table.
(Reboot to ensure the partition table has been updated.)
 hda: hda1 hda2 hda3
Syncing disks.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Ignore the warning about rebooting - it is not necessary unless you see any errors occur.

You can only have four primary partitions on your hard disk. If you need more, you can create up to three primary partitions plus one "extended partition" which uses up the rest of the space on the disk. Then you can created logical partitions numbered 5,6,7... (as many as you like). They will all reside within the space you allocated as an extended partition.


Last updated 4 Mar 1997