Stable version to be found:

And other formats as well (may be) on the Stable HOWTOs page

If necessary use the Discussion page to give comments.

Discussion Page Content if any

Linux Partition HOWTO


      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
      Version 1.2 or any later version published by the Free Software
      Foundation; with no Invariant Sections, no Front-Cover Texts and
      no Back-Cover Texts.  A copy of the license is included in the
      section entitled "GNU Free Documentation License".

GNU Free Documentation License

Important note

This HOWTO is a complete rewrite of the "Partition" HOWTO, last maintained by Athony Lissot. It uses many parts of the original HOWTO, but is largely modified, so the original one is still kept. I want to thank Athony and Kristian Koehntopp for the work done in previous documents. My full name is Jean-Daniel Dodin and I'm very easy to find on the net if necessary. jdd.

This HOWTO is mostly a summary of the various HOWTOs speaking about partitionning, that all begin by the words "Partition-Mass-storage".

Mass Storage Involved Here

Mass storage involved in the present HOWTO are rewritable random access ones. Most of them are magnetic rotating disks (floppies, Hard Drive) or flash memory (USB key or any kind of memory card).

For example, cdroms and dvds are not concerned by this HOWTO (see Wikipedia). Tapes are not either.

Mass storage are used by the kernel, so the basic doc can be found on the kernel Web site

Reference site should be the International Disk drive Equipment and Materials Association. Should because this Web site is not very friendly.

Work in Progress

All after this have to be rewriten

1. Introduction

Why have multiple partitions?

1.2. Other Partitioning Software:

4. Partitioning requirements

4.1. What Partitions do I need?

For the Boot Drive: If you want to boot your operating system from the drive you are about to partition, you will need:

4.2. Discussion:

Boot Partition::: Your boot partition ought to be a primary partition, not a logical partition. This will ease recovery in case of disaster, but it is not technically necessary. It must be of type 0x83 "Linux native". If you are using a version of '''lilo''' before 21-3 (ie, from the 1990s), your boot partition must be contained within the first 1024 cylinders of the drive. (Typically, the boot partition need only contain the kernel image.) If you have more than one boot partition (from other OSs, for example,) keep them all in the first 1024 cylinders (All DOS partitions must be within the first 1024). If you are using a modern version of lilo, or a means other than lilo to load your kernel (for example, a boot disk or the LOADLIN.EXE MS-DOS based Linux loader), the partition can be anywhere. See the Large-disk HOWTO for details.Swap Partition::: Unless you swap to files (see Section 9.2) you will need a dedicated swap partition. It must be of type 0x82 "Linux swap". It may be positioned anywhere on the disk (but see Section 4.4.3). Either a primary or logical partition can be used for swap. More than one swap partition can exist on a drive. 8 total (across drives) are permitted. See notes on swap size below (Section 4.4).Logical Partition::: A single primary partition must be used as a container (extended partition) for the logical partitions. The extended partition can go anywhere on the disk. The logical partitions must be contiguous, but needn't fill the extended partition.

4.3. File Systems

4.3.1. Which file systems need their own partitions?

Everything in your linux file system can go in the same (single) partition. However, there are circumstances when you may want to restrict the growth of certain file systems. For example, if your mail spool was in the same partition as your root fs and it filled the remaining space in the partition, your computer would basically hang.

/var:: This fs contains spool directories such as those for mail and printing. In addition, it contains the error log directory. If your machine is a server and develops a chronic error, those msgs can fill the partition. Server computers ought to have /var in a different partition than /./usr:: This is where most executable binaries go. In addition, the kernel source tree goes here, and much documentation./tmp:: Some programs write temporary data files here. Usually, they are quite small. However, if you run computationally intensive jobs, like science or engineering applications, hundreds of megabytes could be required for brief periods of time. In this case, keep /tmp in a different partition than /./home:: This is where users home directories go. If you do not impose quotas on your users, this ought to be in its own partition./boot:: This is where your kernel images go. See discussion above for placement on old systems.

4.3.2. File lifetimes and backup cycles as partitioning criteria

With ext2, partitioning decisions should be governed by backup considerations and to avoid external fragmentation Section 10.4 from different file lifetimes.

Files have lifetimes. After a file has been created, it will remain some time on the system and then be removed. File lifetime varies greatly throughout the system and is partly dependent on the pathname of the file. For example, files in /bin, /sbin, /usr/sbin, /usr/bin and similar directories are likely to have a very long lifetime: many months and above. Files in /home are likely to have a medium lifetime: several weeks or so. File in /var are usually short lived: Almost no file in /var/spool/news will remain longer than a few days, files in /var/spool/lpd measure their lifetime in minutes or less.

For backup it is useful if the amount of daily backup is smaller than the capacity of a single backup medium. A daily backup can be a complete backup or an incremental backup.

You can decide to keep your partition sizes small enough that they fit completely onto one backup medium (choose daily full backups). In any case a partition should be small enough that its daily delta (all modified files) fits onto one backup medium (choose incremental backup and expect to change backup media for the weekly/monthly full dump - no unattended operation possible).

Your backup strategy depends on that decision.

When planning and buying disk space, remember to set aside a sufficient amount of money for backup! Unbackuped data is worthless! Data reproduction costs are much higher than backup costs for virtually everyone!

For performance it is useful to keep files of different lifetimes on different partitions. This way the short lived files on the news partition may be fragmented very heavily. This has no impact on the performance of the / or /home partition.

4.4. Swap Partitions

4.4.1. How large should my swap space be?

Conventional wisdom creates swap space equal to the amount of RAM.

But keep in mind that this is just a rule of thumb. It is easily possible to create scenarios where programs have extremely large or extremely small working sets (see Section 3.5). For example, a simulation program with a large data set that is accessed in a very random fashion would have almost no noticeable locality of reference in its data segment, so its working set would be quite large.

On the other hand, a graphics program with many simultaneously opened JPEGs, all but one iconified, would have a very large data segment. But image transformations are all done on one single image, most of the memory occupied by the program is not accessed. The same is true for an editor with many editor windows where only one window is being modified at a time. These programs have - if they are designed properly - a very high locality of reference and large parts of them can be kept swapped out without too severe performance impact. A user who never never quits programs once launched would want a lot of swap space for the same reason.

Servers typically are configured with more swap space than their desktop counterparts. Even though a given amount of swap is sufficient for its operations, the server might come under transient heavy loads which cause it to page out at a high rate. Some administrators prefer this to the server crashing altogether. In these cases, swap might be several times the size of ram.

4.4.2. How large ''can'' my swap space be?

Currently, the maximum size of a swap partition is architecture-dependent. For i386, m68k, ARM and PowerPC, it is "officially" 2Gb. It is 128Gb on alpha, 1Gb on sparc, and 3Tb on sparc64. An opteron on the 2.6 kernel can write to a 16 Tb swap partition. For linux kernels 2.1 and earlier, the limit is 128Mb. The partition may be larger than 128 MB, but excess space is never used. If you want more than 128 MB of swap for a 2.1 and earlier kernel, you have to create multiple swap partitions (8 max). After 2.4, 32 swap areas are "officially" possible. See setting up swap for details.

footnote: "official" max swap size: With kernel 2.4, the limit is 64 swap spaces at a maximum of 64Gb each, although this is not reflected in the man page for mkswap. With the 64 bit opteron on the 2.6 kernel, 128 swap areas are permitted, each a whopping 16 Tb! (thanks to Peter Chubb for the calculation)

4.4.3. Where should I put my swap space?

The short answer is anywhere is fine. However, if you are interested in extracting as much speed as possible, there are two basic strategies (other than buying more RAM).

Here are the considerations:

Summary: Put your swap on a fast disk with many heads that is not busy doing other things. If you have multiple disks: Split swap and scatter it over all your disks or even different controllers.

5. Partitioning with fdisk

This section shows you how to actually partition your hard drive with the fdisk utility. Linux allows only 4 primary partitions. You can have a much larger number of logical partitions by sub-dividing one of the primary partitions. Only one of the primary partitions can be sub-divided.


  1. Four primary partitions (see Section 5.2)

  2. Mixed primary and logical partitions (see Section 5.3)

5.1. fdisk usage

fdisk is started by typing (as root) ''''''fdisk''' device''' at the command prompt. ''device'' might be something like /dev/hda or /dev/sda (see Section 2.1.1). The basic fdisk commands you need are:

'''p''' print the partition table

'''n''' create a new partition

'''d''' delete a partition

'''q''' quit without saving changes

'''w''' write the new partition table and exit

Changes you make to the partition table do not take effect until you issue the write (w) command. Here is a sample partition table:

 Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders Units = cylinders of 4032 * 512 bytes    Device Boot    Start       End    Blocks   Id  System /dev/hdb1   *         1       184    370912+  83  Linux /dev/hdb2           185       368    370944   83  Linux /dev/hdb3           369       552    370944   83  Linux /dev/hdb4           553       621    139104   82  Linux swap 

5.2. Four primary partitions

The overview:

Decide on the size of your swap space (see Section 4.4) and where it ought to go (see Section 4.4.3). Divide up the remaining space for the three other partitions.


I start fdisk from the shell prompt:

 # `''''''fdisk''' `/dev/hdb`'''`  

 Command (m for help): `'''p'''` Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders Units = cylinders of 4032 * 512 bytes 

 Command (m for help): `'''n'''` Command action    e   extended    p   primary partition (1-4) `'''p'''` Partition number (1-4): `'''1'''` First cylinder (1-621, default 1):`'''<RETURN>'''` Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-621, default 621): `'''+384M'''` 

 Command (m for help): `'''n'''` Command action    e   extended    p   primary partition (1-4) p Partition number (1-4): `'''2'''` First cylinder (197-621, default 197):`'''<RETURN>'''` Using default value 197 Last cylinder or +size or +sizeM or +sizeK (197-621, default 621): `'''+128M'''` 

    Device Boot    Start       End    Blocks   Id  System /dev/hdb1             1       196    395104   83  Linux /dev/hdb2           197       262    133056   83  Linux 

 Command (m for help): `'''a'''` Partition number (1-4): `'''1'''` 

 Command (m for help): `'''t'''` Partition number (1-4): `'''2'''` Hex code (type L to list codes): `'''82'''` Changed system type of partition 2 to 82 (Linux swap)       Command (m for help): `'''p'''` 

 Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders Units = cylinders of 4032 * 512 bytes    Device Boot    Start       End    Blocks   Id  System /dev/hdb1   *         1       196    395104+  83  Linux /dev/hdb2           197       262    133056   82  Linux swap /dev/hdb3           263       458    395136   83  Linux /dev/hdb4           459       621    328608   83  Linux           

Side topics:

5.3. Mixed primary and logical partitions

The overview: create one use one of the primary partitions to house all the extra partitions. Then create logical partitions within it. Create the other primary partitions before or after creating the logical partitions.


I start fdisk from the shell prompt:

 # fdisk /dev/sda 

First I figure out how many partitions I want. I know my drive has a 183Gb capacity and I want 26Gb partitions (because I happen to have back-up tapes that are about that size).

183Gb / 26Gb = ~7

so I will need 7 partitions. Even though fdisk accepts partition sizes expressed in Mb and Kb, I decide to calculate the number of cylinders that will end up in each partition because fdisk reports start and stop points in cylinders. I see when I enter fdisk that I have 22800 cylinders.

 > The number of cylinders for this disk is set to 22800.  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., LILO) 2) booting and partitioning software from other > OSs  (e.g., DOS FDISK, OS/2 FDISK) 

Since I have 4 primary partitions, 3 of them can be 3258 long. The extended partition will have to be (4 * 3258), or 13032, cylinders long in order to contain the 4 logical partitions.

I enter the following commands to set up the first of the 3 primary partitions (stuff I type is bold ):

 Command (m for help): `'''n'''` Command action    e   extended    p   primary partition (1-4) `'''p'''` Partition number (1-4): `'''1'''` First cylinder (1-22800, default 1): `'''<RETURN>'''` Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-22800, default 22800): `'''3258'''` 

 Partition number (1-4): `'''4'''` First cylinder (9775-22800, default 9775): `'''<RETURN>'''` Using default value 9775 Last cylinder or +size or +sizeM or +sizeK (9775-22800, default 22800): `'''<RETURN>'''` Using default value 22800 

 /dev/sda1             1      3258  26169853+  83  Linux /dev/sda2          3259      6516  26169885   83  Linux /dev/sda3          6517      9774  26169885   83  Linux /dev/sda4          9775     22800 104631345    5  Extended 

 Command (m for help):  `'''n'''` First cylinder (9775-22800, default 9775): `'''<RETURN>'''` Using default value 9775 Last cylinder or +size or +sizeM or +sizeK (9775-22800, default 22800): 13032 

    Device Boot    Start       End    Blocks   Id  System /dev/sda1             1      3258  26169853+  83  Linux /dev/sda2          3259      6516  26169885   83  Linux /dev/sda3          6517      9774  26169885   83  Linux /dev/sda4          9775     22800 104631345    5  Extended /dev/sda5          9775     13032  26169853+  83  Linux /dev/sda6         13033     16290  26169853+  83  Linux /dev/sda7         16291     19584  26459023+  83  Linux /dev/sda8         19585     22800  25832488+  83  Linux 

5.4. Submitted Examples

I'd like to submit my partition layout, because it works well with any distribution of Linux (even big RPM based ones). I have one hard drive that ... is 10 gigs, exactly. Windows can't see above 9.3 gigs of it, but Linux can see it all, and use it all. It also has much more than 1024 cylenders.

Table 7. Partition layout example


Mount point




(15 megs)


windows 98 partition

(2 gigs)





swap space

(64 megs)



(50 megs)



(150 megs)



(1.5 gigs)



(rest of drive)

I also noticed that you don't have any REAL examples of partition tables, and for newbies I HIGHLY suggest putting quite a few up. I'm freshly out of the newbie stage, and partitioning was what messed me up the most.


7. Formatting an ext2/3 partition

When a hard drive is partitioned, it is mapped into sections, but the sections are empty. It is like a newly constructed library; shelves, signs, and a card catalogue system must be put in place before the books are put away.

The organizational structure inside a partition is called a file system. With Linux, the standard file system is ext2 and ext3. The ext3 file system is ext2, plus a log of disk writes called a journal. The journal allows the system to recover quickly from accidental power outages, among other things.

The principal tool for making an ext2/3 file system in a partition is mke2fs. It is usually found in /sbin. mkfs.ext2 and mkfs.ext3 are frontends which pass specific options to mke2fs.

.1. Simple Invocation

mke2fs /dev/hdb1

mkfs.ext2 /dev/hdb1

both of which make an ext2 file system on the first partition of the second drive, and

mke2fs -j /dev/hdb1

mkfs.ext3 /dev/hdb1

make an ext3 file system.

.2. Reserved blocks

The -m option is probably the one of most use to non-experts. If the file system becomes filled and there is no more space to write, it is basically unusable because the operating system is constantly writing to disk. By default, five percent of the partition is reserved for use by the root user. This allows root to conduct administrative activities on the partition and perhaps move some data off. However, this is most critical when the partition contains / or home directories. For pure data partitions, this is just lost space. Five percent of a 250Gb partition is 12.5 Gb. Especially in the case of large partitions, it is safe to set the reserved space to the minimum, which is one percent.

mkfs.ext3 -m 1/dev/hdb1

creates a file system with only 1% of its space reserved for the root user. tune2fs -m can be used to adjust the reserved blocks after data is loaded on the partition.

8. Recovering a Deleted Partition Table

Below are instructions for manually recovering a deleted partition table. There are utilities such as gpart or TestDisk which can make this task considerably easier. If you are reading this, however, because you have run out of luck, this is what you will have to do:

  1. Make a partition that is at least as big as your first partition was. You can make it larger than the original partition by any amount. If you underestimate, there will be much wailing and gnashing of teeth.||<tablestyle="width:100%; background-color:#e0e0e0">  Command (m for help): `'''n'''` Command action    e   extended    p   primary partition (1-4) `'''p'''` Partition number (1-4): `'''1'''` First cylinder (1-23361, default 1): `'''&lt;RETURN&gt;'''` Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-22800, default 22800): `'''13032'''` Command (m for help): `'''w'''`  ||

  2. Run dumpe2fs on the first partition and grep out the block count.Example:||<tablestyle="width:100%; background-color:#e0e0e0">             % dumpe2fs /dev/sda1 | grep "Block count:"            Block count:              41270953  ||

    • If you are uncertain about this value, repeat Step 1 with a bigger partition size. If the block count changes, then you underestimated the size of the original partition. Repeat Step 1 until you get a stable block count.
  3. Remove the partition you just created||<tablestyle="width:100%; background-color:#e0e0e0">           Command (m for help): `'''d'''`          Partition number (1-4): `'''1'''`  ||

  4. Make a new partition with the exact size you got from the block count. Since you cannot enter block size in fdisk, you need to figure out how many cylinders to request. Here is the formula:||<tablestyle="width:100%; background-color:#e0e0e0">    (number of needed cylinders) = (number of blocks) / (block size)   (block size) = (unit size) / 1024   (unit size) = (number of heads) * (number of sectors/cylinder) * (number of bytes/sector)  || Consider the following example, where a hard drive has been partitioned into four primary partitions of 1, 2, 4, and 8 cylinders.||<tablestyle="width:100%; background-color:#e0e0e0">  disk /dev/sda: 16 heads, 63 sectors, 23361 cylinders Units = cylinders of 1008 * 512 bytes    Device Boot    Start       End    Blocks   Id  System /dev/sda1             1         2       976+  83  Linux /dev/sda2             3         5      1512   83  Linux /dev/sda3             6        10      2520   83  Linux /dev/sda4            11        19      4536   83  Linux  || fdisk provides the configuration information I need in the head of the output. The unit size is '''516096''' ( '''16''' heads * '''63''' sectors/cyl * '''512''' bytes/sector ). The block size is '''504''' ( '''516096 / 1024''' ). The number of needed cylinders for the second partition is therefore '''3''' ( '''1512''' blocks '''/ 504''' ). The partition table shows that this is indeed the case: the first cylinder is '''3''', the second '''4''', and the last is '''5''', for a total of three cylinders. The number of needed cylinders for the third partition is calculated similarly: '''2520''' blocks '''/ 504 = 5''', which corresponds to blocks '''6,7,8,9,10''' . Notice that this calculation does not work for the first partition because the block count is wrong ( '''976''' instead of '''1008''' ). The plus sign indicates that not all the blocks are included in the fdisk value. When you try the calculation ( '''976 / 504''' ) you get '''1.937'''. Knowing that the number of cylinders must be an integer, you can simply round up.

  5. Run e2fsck on it to verify that you can read the new partition.

  6. Repeat Steps 1-5 on remaining partitions.

Credit goes to: Mike Vevea, jedi sys admin, for providing the basic strategy.

9. Setting Up Swap Space

9.1. Swap Files

Normally, there are only two steps to setting up swap space, creating the partition and adding it to /etc/fstab. A typical fstab entry for a swap partition at /dev/hda6 would look like this:

 /dev/hda6     swap    swap    defaults        0       0 

The next time you reboot, the initialization scripts will activate it automatically and there's nothing more to be done.

However, if you want to make use of it right away, you'll need to activate it maually. As root, type:

 `''''''mkswap''' -f `/dev/hda6`'''` `''''''swapon''' `/dev/hda6`'''` 

9.2. Swap Files

There might be times when you've run out of swap space and it is not practical to repartition a drive or add a new one. In this case, you can use a regular file in an ordinary partition. All you have to do is create a file of the size you want

''''''dd''' if=/dev/zero of=/var/my_swap bs=1024 count=131072'''

and activate it

       `''''''mkswap''' -f /var/my_swap'''`    `''''''swapon''' /var/my_swap'''` 

This invocation creates a file called my_swap in /var. It is 128 Mb long (128 x 1024 = 131072). Initially, it is filled with zeros. However, mkswap marks it as swap space and swapon tells the kernel to start using it as swap space. When you are done with it,

 `''''''swapoff''' /var/my_swap'''` `''''''rm''' /var/my_swap'''` 

9.3. Multiple Swap Areas

More than one swap partition can be used on the same system. Consider an example fstab where there is a single swap partition:

 /dev/hda5   /        ext3   defaults        1 1 /dev/hda1   /boot    ext2   defaults        1 2 none        /dev/pts devpts gid=5,mode=620  0 0 none        /proc    proc   defaults        0 0 /dev/hda7   /usr     ext3   defaults        1 2 /dev/hda6   swap     swap   defaults        0 0 

Imagine replacing the entry for the swap partition with these three lines:

 /dev/hda6   none    swap    sw,pri=3    0     0 /dev/hdb2   none    swap    sw,pri=2    0     0 /dev/hdc2   none    swap    sw,pri=1    0     0 

This configuration would cause the kernel to use /dev/hda6 first. it has the highest priority assigned to it (pri=3). The maximum priority can be 32767 and the lowest 0. If that space were to max out, the kernel would start using /dev/hdb2, and on to /dev/hdc2 after that. Why such a configuration? Imagine that the newest (fastest) drives are given the highest priority. This will minimize speed loss as swap space usage grows.

It is possible to write to all three simulataneously. If each has the same priority, the kernel will write to them much like a RAID, with commensurate speed increases.

 /dev/hda6   none   swap   sw,pri=3   0   0 /dev/hdb2   none   swap   sw,pri=3   0   0 /dev/hdc2   none   swap   sw,pri=3   0   0 

Notice that these three partitions are on separate drives, which is ideal in terms of speed enhancement.

10. Appendix

10.1. Formating Partitions

At the shell prompt, I begin making the file systems on my partitions. Continuing with the example in (see Section 5.3), this is:

 # mke2fs /dev/sda1 

I need to do this for each of my partitions, but not for /dev/sda4 (my extended partition). Linux supports types of file systems other than ext2. You can find out what kinds your kernel supports by looking in: /usr/src/linux/include/linux/fs.h

The most common file systems can be made with programs in /sbin that start with "mk" like mkfs.msdos and mke2fs.

10.2. Activating Swap Space

To set up a swap partition:

 # mkswap -f /dev/hda5 

 # swapon  /dev/hda5 

10.3. Mounting Partitions

Mounting a partition means attaching it to the linux file system. To mount a linux partition:

 # mount -t ext2 /dev/sda1 /opt 

-t ext2:: File system type. Other types you are likely to use are:

10.4. Some facts about file systems and fragmentation

Disk space is administered by the operating system in units of blocks and fragments of blocks. In ext2, fragments and blocks have to be of the same size, so we can limit our discussion to blocks.

Files come in any size. They don't end on block boundaries. So with every file a part of the last block of every file is wasted. Assuming that file sizes are random, there is approximately a half block of waste for each file on your disk. Tanenbaum calls this "internal fragmentation" in his book "Operating Systems".

You can guess the number of files on your disk by the number of allocated inodes on a disk. On my disk

 # df -i Filesystem           Inodes   IUsed   IFree  %IUsed Mounted on /dev/hda3              64256   12234   52022    19%  / /dev/hda5              96000   43058   52942    45%  /var 

Data transfer is faster for large contiguous chunks of data, though. That's why ext2 tries to preallocate space in units of 8 contigous blocks for growing files. Unused preallocation is released when the file is closed, so no space is wasted.

Noncontiguous placement of blocks in a file is bad for performance, since files are often accessed in a sequential manner. It forces the operating system to split a disk access and the disk to move the head. This is called "external fragmentation" or simply "fragmentation" and is a common problem with MS-DOS file systems. In conjunction with the abysmal buffer cache used by MS-DOS, the effects of file fragmentation on performance are very noticeable. DOS users are accustomed to defragging their disks every few weeks and some have even developed some ritualistic beliefs regarding defragmentation.

None of these habits should be carried over to Linux and ext2. Linux native file systems do not need defragmentation under normal use and this includes any condition with at least 5% of free space on a disk. There is a defragmentation tool for ext2 called defrag, but users are cautioned against casual use. A power outage during such an operation can trash your file system. Since you need to back up your data anyway, simply writing back from your copy will do the job.

The MS-DOS file system is also known to lose large amounts of disk space due to internal fragmentation. For partitions larger than 256 MB, DOS block sizes grow so large that they are no longer useful (This has been corrected to some extent with FAT32). Ext2 does not force you to choose large blocks for large file systems, except for very large file systems in the 0.5 TB range (that's terabytes with 1 TB equaling 1024 GB) and above, where small block sizes become inefficient. So unlike DOS there is no need to split up large disks into multiple partitions to keep block size down.

Use a 1Kb block size if you have many small files. For large partitions, 4Kb blocks are fine.

Volume Labels

Volume labels make it possible for partitions to retain a consistent name regardless of where they are connected, and regardless of whatever else is connected. Labels are not mandatory for a linux volume. Each can be a maximum of 16 characters long.

There are three tools to make volume labels: mke2fs, tune2fs and e2label.

Simple Invocation

e2label /dev/hdb1 pubsw

tune2fs -L pubsw /dev/hdb1

Either of thse two commands will label the first partition of the second drive "pubsw". That label stays with that particular partition, even if the drive is moved to another controller or even another computer.

mke2fs pubsw /dev/hdb1

mke2fs -L pubsw /dev/hdb1

will do the same thing as the first two commands - after they make the file system. This means that either of these last two commands will delete any existing data in the partition.

6.1.2. How to Use

Here is a sample fstab. This is a text file located in /etc, which is usually set up during the installation of the operating system. it describes where each partition wil be mounted, and how it will be mounted. It can be modified by you, either through a utility or manually, when you add/remove devices.

 LABEL=/        /                    ext3    defaults        1 1 LABEL=/boot    /boot                ext2    defaults        1 2 none           /dev/pts             devpts  gid=5,mode=620  0 0 none           /dev/shm             tmpfs   defaults        0 0 LABEL=HOME     /home                ext3    defaults        1 2 none           /proc                proc    defaults        0 0 none           /sys                 sysfs   defaults        0 0 LABEL=/usr     /usr                 ext3    defaults        1 2 /dev/hdc1      /k-space             ext3    defaults        1 2 /dev/hda6      swap                 swap    defaults        0 0 /dev/hdd       /media/cdrecorder    auto    pamconsole,ro,exec,noauto,managed 0 0 /dev/fd0       /media/floppy        auto    pamconsole,exec,noauto,managed 0 0 

The leftmost column lists devices and the second column lists mount points. This example contains a mixture of devices and labels. The master drive of the second controller is always mounted on /k-space. The partition labeled "HOME" is always mounted on /home, regardless of which drive it is on or which partition number it has. Notice that it is permissible to use mount points as labels, such as "/usr"

6.2. Device Labels

devlabel is a script which creates symbolic links to devices. For example,

devlabel -d /dev/hdb1 -s /dev/home

will create a link from /dev/hdb1 to /dev/home. Crucially, it stores a unique identifier for the hardware that was on /dev/hdb1 and stores that identifier along with the link name that you specified in /etc/sysconfig/devlabel. If the hardware is later moved to /dev/hdc1, its unique identifier will be queried (using /usr/bin/partition_uuid), matched to its entry in /etc/sysconfig/devlabel, and again linked to /dev/home.

Infos for writing

there reference for the own sake of the author;a=blob;f=README;h=a73652168c3cd451572cdd271fc80407c69ce4cb;hb=f7fda10cf27829e0f770f0d1f1d18408ce8a994f

Partition-Mass-Storage-HOWTO (last edited 2010-01-14 09:13:06 by jdd)