![]() |
James Thornton |
| Internet Business Consultant |
| Home | Blog | Bio | Projects | Contact | Latest Blog (new site): How to Get to Genius |
|---|
|
Creating a Partition
Before creating a partition, boot into rescue mode (or unmount any partitions on the device and turn off any swap space on the device). Start parted, where /dev/hda is the device on which to create the partition:
View the current partition table to determine if there is enough free space: If there is not enough free space, you can resize an existing partition. Refer to the Section called Resizing a Partition for details. Making the PartitionFrom the partition table, determine the start and end points of the new partition and what partition type it should be. You can only have four primary partitions (with no extended partition) on a device. If you need more than four partitions, you can have three primary partitions, one extended partition, and multiple logical partitions within the extended. For an overview of disk partitions, refer to the appendix An Introduction to Disk Partitions in the Official Red Hat Linux Installation Guide. For example, to create a primary partition with an ext3 file system from 1024 megabytes until 2048 megabytes on a hard drive type the following command:
The changes start taking place as soon as you type
After creating the partition, use the print command to confirm that it is in the partition table with the correct partition type, file system type, and size. Also remember the minor number of the new partition so that you can label it. You should also view the output of
to make sure the kernel recognizes the new partition. Formating the PartitionThe partition still does not have a file system. Create the file system:
Labeling the PartitionNext, give the partition a label. For example, if the new partition is /dev/hda3 and you want to label it /work:
By default, the Red Hat Linux installation program uses the mount point of the partition as the label to make sure the label is unique. You can use any label you want. Add to /etc/fstabAs root, edit the /etc/fstab file to include the new partition. The new line should look similar to the following:
The first column should contain LABEL= followed by the label you gave the partition. The second column should contain the mount point for the new partition, and the next column should be the file type (for example, ext3 or swap). If you need more information about the format, read the man page with the command man fstab. If the fourth column is the word defaults, the partition will be mounted at boot time. To mount the partition without rebooting, as root, type the command:
|
|
||||||||||||||||||||||||||
James Thornton, jamesthornton.com>Services: Software Programming |
Electric Speed: E-commerce Developer |