Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search

16. Appendix: More on partitioning

After several questions on what partitioning really is, I'll just quote an answer I gave in a mail once.

Okay, here goes:

In an operating system you need several different filesystems for several different applications. For example, you need a swap filesystem because your main memory can't hold all information the operating system needs, so some of it has to be temporary written to disk. You may also need some special filesystem from which the machine reads the operating system when you switch it on. Finally, you need of course one or more filesystems to store the operating system program files and your user files. It may be a good idea to put these in different places (ie. on different filesystems) in case you have to reinstall the operating system, but don't want to scratch all your work.

The best thing is maybe to have all these filesystems on different disks. But one has seldom more than one or two disks in a computer. So what we do is to slice up the disk(s) in several slices (partitions) and use the slices for several filesystems. Then the operating system mounts the filesystems together to one single file tree, so it is easy to access the files.

(Other operating systems, like MS-DOS and NT use some other technology: They do not bind the slices together to one file tree, but keeps them separate as "stations". What is the best scheme? You figure!)

Here a thought example with one 2GB disk on a 7248: The mount point shows where in the file tree a filesystem is mounted.

    Partition   Size   Type             Mountpoint          Bootable
    /dev/sda1     10MB  41 (PReP Boot)     (Not mounted)    yes
    /dev/sda2    150MB  82 (Linux Swap)    (Not mounted)     -
    /dev/sda3   1840MB  83 (Linux ext2)  / (Root partition)  -
This would give a bootprompt command like this:

If you want, you could add own partitions for important directories like /home, /boot, /var, /usr/local and so on. Here is an other example with two disks, actually my own configuration with two disks:

      Partition   Size   Type             Mountpoint          Bootable
      /dev/sda1     20MB  43 (PReP Boot)     (Not mounted)    yes
      /dev/sda2    133MB  82 (Linux Swap)    (Not mounted)     -
      /dev/sda5    930MB  83 (Linux ext2)  / (Root partition)  -
      /dev/sdb1    315MB  83 (Linux ext2)  /home               -
      /dev/sdb2    770MB  83 (Linux ext2)  /usr/local          -
This would give a bootprompt command like this:
Before you ask:

Hope this clears up some things.