1. Tech

Your suggestion is on its way!

An email with a link to:


was emailed to:

Thanks for sharing About.com with others!

Before Linux Installation

Part 1 of the Linux Newbie Administrator Guide

1.9 How do I partition my hard drive?
(continued after the ads...)

Related Resources
Linux Newbie Administrator Guide
0. Linux Benefit
1. Before Installation
2. Linux Resources/Help
3. Basic Operations FAQ
4. Newbie Admin FAQ
~ 4.1 Lilo
~ 4.2 Drives
~ 4.3 X-Windows
~ 4.4 Configurations
~ 4.5 Networking
5. Shortcuts / Commands
6. Linux Applications
7. Learn Linux Commands
A. How to Upgrade Kernel?

Before Linux installation, you might really want to know what a hard drive partition is. The concern is that you delete your MS Windows partition when you really don't want to--you want two separate partitions to dual boot. This means: MS Windows is on one partition, Linux is on a separate partition. You do not normally install Linux on free space on your MS Windows-allocated partition(s). It is possible to install Linux on a MS Windows partition, but we do not recommend it.

If you plan a dual boot (Linux and MS Windows on the same computer), first use your DOS/Win utility FDISK to make the MS Windows partition(s). Leave part of the hard drive(s) unpartitioned for Linux. You will make and format the Linux partitions during your RedHat (or Mandrake or whatever else) installation. Linux will recognize the free space on the harddrive.

Make the MS Windows partition "primary" and "bootable". Install, configure, and test your MS Windows before Linux installation. If you plan to run Linux only, you need just a clean hard drive (no partitions) to start with.

It is possible to have only one Linux partition (plus one for MS Windows if you dual-boot). But it is better to have more partitions so that you can keep users' data separate from the rest of the operating system. This way, if something ever goes wrong, or if you have to reformat or re-install the operating system, you don't lose the users' data. (You can perform a complete Linux re-install without losing the contents of the /home directory that contains all user data if you skip the "re-format" option given to you during installation. But for that, the /home directory must be on its own partition.)

During the Linux setup, you will be asked to partition the available space on your hard drive(s). There are many possible ways to partition, depending on your hard drive space, requirements, and taste. I like Linux hard drive partitions like this (for a modest total of 2 GB of hardrive space which I give to Linux in this example):
mount point type size
/ ext2 300 MB
/usr ext2 1200 MB
/home ext2 380 MB
swap swap 120 MB
In the above example, I dedicate 300 MB for the root partition that holds the base of the Linux operating system. I allocate 1200 MB to the mount point that will be visible on my filesystem as the /usr directory and will contain the user's programs (the programs that don't come with the base operating system and I install later, for example StarOffice). I dedicate 380 MB for the partition that will be visible as the directory /home and will contain the setting and data of all users on the machine. And I allocate 120 MB to a "raw" partition for the operating system to use as the virtual memory (extension of the physical, silicon memory on the hard drive, so-called swap). If your kernel is lower than 2.2 (this is the case with standard RH5.2 and earlier), your swap partition cannot be larger than approximately 127 MB. The rule of thumb is that the swap should be about twice the amount of the physical memory (RAM). If you need more (e.g. if you have lots of physical memory, or you expect to run custom programs with really large data structures) you might want to create a larger swap partition during the installation (or several smaller swap partitions) or add a swap file(s) later.

2 GB is a respectible amount of disk space and should be sufficient for users who like having many applications. (This is because Linux applications tend to be slimmer than their MS Windows equivalents). However, if you try to install everything that's available on the modern distribution CDs, you will surely run out of disk space. My experience is that however large the hard drive space, it will get filled and I regret I don't have more :-) .

If my space on the hard drive is really restricted, I may consider a two-partition setup like this (for a lean 650 MB total dedicated to Linux):
mount point type size
/ ext2 600 MB
swap swap 50 MB
In this example, I dedicate 600 MB to the base of the operating system, applications, and user documents/data, and allow 50 MB for the swap partition (for the operating system to use as the virtual memory). The 50-MB swap should be quite sufficient for medium duty operations. The limitation of 600 MB for the operating system, applications and user data means that you will have to be very selective as to which applications you install or else you risk running out of hard drive space. Try pressing when installing the optional software that comes on the Red Hat CD--it will give you a short description of what the software does so you could perhaps decide if you really need it. (Don't worry too much if you miss something you need, you can install the missing parts later). You can easily finish the RedHat installation with 200 MB free on your Linux partition (out of 600 MB used in this example) if you make reasonable choices. Please note that "bundling together" the root partition "/" and the /home directory will likely save you some disk space, but it is not the safest solution.

It is possible to install Linux on even less disk space than in the example above, but you will have to be really picky as to what you install.

For a larger available hard drive space, I may consider the following setup (for a comfortable total of 15 GB dedicated to Linux):
mount point type size
/ ext2 800 MB
/usr ext2 5000 MB
/usr/local ext2 3000 MB
/home ext2 5200 MB
swap swap 1000 MB
Please note that the the mount points can reside on different physical hard drives. Linux agglomarates all the hard drive space into a single directory tree.

Another consideration when setting up the partitions on older computers (486?). Many older BIOSes have the restriction that the boot partition cannot extend beyond the 1024th cylinder on your first physical hard drive. To overcome this limitation, simply make the first (bootable) partition so that it ends before the cylinder number 1023 (this makes this partition max approximately 512 MB in size, which is plenty for the "/" root partition). Once Linux boots, the BIOS restriction does not matter any more because Linux takes over the hardware management and it can access the partition(s) beyond the cylinder number 1023.

When installing and using Linux, your drives appear as devices with the following names: hda--first IDE drive (stands for "hard drive a", i.e. the master drive on the first IDE interface), hdb--second IDE drive (i.e., the slave drive on the first IDE interface), hdc--third IDE drive (i.e. the master drive on the second IDE interface), hdd--fourth IDE drive (i.e. the slave drive on the second IDE interface). The numbers mean the partitions on the physical drives: "hda1" means the first IDE hard drive (hd a), first partition (1); "hda2" is the first IDE hard drive, second partition; "hda3"--the first IDE hard drive, third partition; (and so on if you have more than 3 partitions on the first IDE hard drive); "hdb1"--second IDE hard drive, first partition (or just "hdb" if it is the CDROM installed as a slave on your first IDE interface). "hdc1"--third IDE hard drive, first partition, etc. SCSI drives have analogous names but start with the letters "sd" (="SCSI drive"), followed by the letter indicating the SCSI interface and by the number indicating the SCSI device id. For example, "sda4" means "first SCSI interface, id number 4". If you have an external zip drive attached to your parallel port, it will appear as SCSI device "sda4" (zip drives work in a SCSI-emulation mode).

The listing of partitions that your Linux setup program presents to you during installation will include any MS Windows partitions which you have. For example, I have the following MS Windows partition:

mount point type size comment

[no mount] vfat 1200 MB ["Win C drive, hda1]
/mnt/dos_hdd2 vfat 1600 MB ["Win D drive, hdd2]

Don't erase these MS Windows partitions during your Linux installation if you want a dual boot. If you erase the MS Windows partition, MS Windows is gone from your system! If not sure, backup your data from your MS Windows partitions before Linux installation. "msdos", "fat" and "vfat" and "ntfs" are typical filesystems used by DOS and MS Windows 3.x/95/98/NT.

As a quick reference, here is a brief summary of the standard linux partition types ("filesystems") with a short description. I copied the info from the linux manual pages: man fs and man mount (with some additions after I had a look at the source code files at /usr/src/linux/fs). The underlined filesystems are the ones that you are more likely to use. Other filesystems (not listed below) are available as add-ons (for example journaling filesystems, compressed, encrypted, ...).

minix is the filesystem used in the Minix operating system, the first to run under Linux. It has a number of shortcomings: a 64MB partition size limit, short filenames, a single time stamp, etc. It remains useful for floppies and RAM disks.

ext is an elaborate extension of the minix filesystem. It has been completely superseded by the second version of the extended filesystem (ext2) and will eventually be removed from the kernel.

ext2 is the high performance disk filesystem used by Linux for fixed disks as well as removable media. The second extended filesystem was designed as an extension of the extended file system (ext). ext2 offers the best performance (in terms of speed and CPU usage) of the filesystems supported under Linux. In short, ext2 is the main (default, typical) Linux filesystem.

ext3 is an extension of the ext2 filesystem with journaling. It is backwards and forward compatibile with ext2. It means that ext2 can be converted into ext3 without reformatting or data loss (just re-mounting the partion is required). ext3 can be changed back to ext2, also without data loss. I use ext3 extensively since Oct.2001--it is simple and trouble-free. It is included as an installation "option" since RedHat 7.2 and Mandrake 8.0. It is highly recommended that you use this filesystem.

xiafs was designed and implemented to be a stable, safe filesystem by extending the Minix filesystem code. It provides the basic most requested features without undue complexity. The xia filesystem is no longer actively developed or maintained. It is used infrequently.

msdos is the filesystem used by DOS, Windows, and some OS/2 computers. msdos filenames can be no longer than 8 characters followed by an optional period and 3 character extension.

umsdos is an extended DOS filesystem used by Linux. It adds capability for long filenames, UID/GID, POSIX permissions, and special files (devices, named pipes, etc.) under the DOS filesystem, without sacrificing compatibility with DOS.

vfat is an extended DOS filesystem used by Microsoft Windows95 and Windows NT. VFAT adds capability for long filenames under the MSDOS filesystem.

proc is a pseudo-filesystem which is used as an interface to kernel data structures rather than reading and interpreting /dev/kmem. In particular, its files do not take up disk space. See man 5 proc.

iso9660 is a CD-ROM filesystem type conforming to the ISO 9660 standard. Two extensions (listed below) are automatically supported.

High Sierra --Linux supports High Sierra, the precursor to the ISO 9660 standard for CD-ROM filesystems. It is automatically recognized within the iso9660 filesystem support under Linux.

Rock Ridge --Linux also supports the System Use Sharing Protocol records specified by the Rock Ridge Interchange Protocol. They are used to further describe the files in the iso9660 filesystem to a UNIX host, and provide information such as long filenames, UID/GID, POSIX permissions, and devices. It is automatically recognized within the iso9660 filesystem support under Linux.

hpfs is the High Performance Filesystem, used in OS/2. This filesystem is read-only under Linux due to the lack of available documentation.

sysv is an implementation of the SystemV/Coherent filesystem for Linux. It implements all of Xenix FS, SystemV/386 FS, and Coherent FS.

is the network filesystem used to access disks located on remote computers.

is a network filesystem that supports the SMB protocol, used by MS Windows for Workgroups, Windows NT, and Lan Manager. To use smb fs, you need a special mount program, which can be found in the ksmbfs package, found at ftp://sunsite.unc.edu/pub/Linux/system/Filesystems/smbfs. [Standard linux command "smbmount" will also do.]

ncpfs is a network filesystem that supports the NCP protocol, used by Novell NetWare.

devpts--is a pseudo file system, traditionally mounted on /dev/pts. In order to acquire a pseudo terminal, a process opens /dev/ptmx; the number of the pseudo terminal is then made available to the process and the pseudo terminal slave can be accessed as /dev/pts/.

fat --is not a separate filesystem, but a common part of the msdos, umsdos and vfat filesystems.

UFS --is a file system widely used in different operating systems.

--is a special partition type used for swapping data from memory to hard drive.

--is a brand new journaling filesystem available as standard with Linux kernel version 2.4.1 up (January 2001).

hfs (=hierarchical files system)--MacIntosh filesystem. It is a late beta version., i.e., not recommended for use with critical data, unless read-only.

--MS Windows NT filesytem. It is still "experimental" under Linux, i.e. not recommeded for production machines, unless read-only (Aug.2001).

Next > 1.10 The MS Windows partition occupies my whole harddrive. Can I shrink/split it without a re-install?

Can't find what you are looking for?
Search the

Stay up-to-date!

©2016 About.com. All rights reserved.