The types and definitions of Ubuntu Linux Partitions and Directories Explained

The types and definitions of Ubuntu Linux Partitions and Directories Explained



In this article I hope to make clear how the various terms used in Ubuntu Linux for its structure can be described in a logical manner even though the terms can overlap and sometimes mean two different things at the same time. This article is not meant to make you an expert in Linux only to clarify some terms and definitions so that you can better understand, install and use this operating system.


Table of Contents:

  1. Filesystem
  2. Partitions
  3. Directories

Note:

I recommend using the Clean Install or Dual Boot Install methods instead as they are largely automated and don't require this amount of knowledge to complete successfully or to use.

If your system did not ship with Ubuntu then the Dell support for your system may include reverting it back to the Windows Operating system (OS) that shipped with it. This information is provided for your knowledge, but is used at your own discretion.


Back to Top


1. FileSystem

Linux users make a distinction of the Filesystem stating that a filesystem is the programmatic scheme used to organize and find files on a partition. Whilst the file system refers to all the files on your computer.

What this essentially means is that the Filesystem is the structure used to see, find and use your files using Ubuntu, whilst the File System is both all the separate files in that structure and those files format.

Note: Be that Ext2, Ext3, NTFS or some other format.
File System Operating System Description
FAT Legacy Legacy File System that was universally adopted. Came in 12 FAT12, 16 FAT16 and 32 FAT32.
NTFS Windows New Tech File System - replaced FAT on Windows systems. It is still needed to read Windows partitions.
Ext2 Linux Second Extended filesystem - used by many Linux distro's.
Ext3 Linux Third Extended filesystem - default choice for Ubuntu distro's. Journaling added.
Ext4 Linux Fourth Extended filesystem - used by many Linux distro's. Extends storage limits.
JFS Linux Journaled File System - was introduced by IBM and is still supported but has been replaced by Ext4.
XFS Linux/Irix 64bit option mostly supported now as an option in Red Hat.
ReiserFS Linux/SUSE This was a file format that was in use across several distro's, but has largely been replaced by Ext3.
There are several types of file in Ubuntu Linux :
Regular files

they contain data, for example text files, executable files or programs, input in or output out from a program and such.

Directories

are files/folders that are lists of other files.

Special files

this is the mechanism used for input and output. Most special files are in /dev.

Links

this is a system to make a file or directory visible in several parts of the system's file tree.

Domain sockets

this a special file type its similar to TCP/IP sockets in windows. It will provide inter-process networking that's protected by the file system's access control.

Named pipes

these act more or less like sockets and are a way for processes to communicate with each other, without using network socket protocols.

File Structure

For Ubuntu Linux this structure is that your / Partition must be a primary partition whilst every other partition - Be it Primary or Logical, will then mount to that partition. Each partition will have a file format that you set and a purpose within the OS. The directories and files will be searchable and used within this structure. This will be explained in more detail below.


Back to Top


2. Partitions

The First thing to know is to discard much of what you already know about windows partitions. Trying to match the two will only confuse you. You're better to take them as two separate processes.

Windows Partition Description

Windows partitions come in two types Primary and Logical. On a older SATA IDE Hard Drive you will be limited to either 4 Primary partitions or a combination of a number of Primary and Logical partitions. Each will receive a Drive letter, but you will only be able to Install the OS on a Primary partition.

Note: There are further things that can be done with windows partitions such as spanning/mounting and there are new types of Hard Drives that use larger sectors such as a GUID / GPT table rather than a MBR one to give larger Hard Drive sizes, but they aren't the subject of this article.
Ubuntu Linux Partition Description

Ubuntu Linux partitions also come in Primary and Logical. You will still be limited to either 4 primary partitions or a combination of Primary and Logical partitions. However that is where the similarities stop.

Your first partition will always be your install partition on a primary partition. This partition will sometimes be called the Root of the partition or will be shown as a / and although you will make several other partitions depending on how you want to use and configure your Ubuntu install, this will be the most important one. Whilst you can create these partitions and give them a size, a file format and a purpose, they will usually need to be mounted to the / of this partition to actually function.

Ubuntu Linux Partition Categories

Ubuntu Linux further separates these partitions into two categories :

Data partitions

These are partitions like the boot partition in that they hold directories and files or normal Linux system data. These are the files which start and run the system.

Swap partitions

These are partitions that expands the PC's physical memory by using the partition as a cache.

Partition types used in Ubuntu Linux Installs

There are several common partitions used for Ubuntu, I've listed them and some info for each below. Experienced Linux users use a combination of some of these partitions as a scheme, this is when they know they will be using the custom Ubuntu install for a specific set of uses that these particular partitions will make easier and more efficient. I will also list what combination of partitions are required for the most common generic install. however if you are going to use this scheme you'd be just as well using the auto install guides above.

Note: Originally having different partitions was to achieve higher data security in case of disaster. if an accident occurred it would only affect the data in the partition that got hit, while the data on the other partitions would most likely survive. This still holds true to some extent after journaled file systems for power failure or sudden loss of storage but you can still get bad blocks and logical errors. The only way past this is a RAID solution, which isn't something we'll be going into here.
Partition Name Description
/ The slash / alone stands for the root of the filesystem tree.
/bin This stands for binaries and contains the fundamental utilities that are needed by all users.
/boot This contains all the files needed for the booting process.
/dev This stands for devices, which contains files for peripheral devices and pseudo devices.
/etc This contains configuration files for the system and system databases.
/home This holds all the home directories for the users.
/lib This is the system libraries and has files like the kernel modules and device drivers.
/lib64 This is the system libraries and has files like the kernel modules and device drivers for 64bit systems.
/media This is default mount point for removable devices like USB drives and media players, etc.
/mnt This stands for mount, and contains filesystem mount points. Used for multiple hard drives, multiple partitions, network filesystems and CD ROMs and such.
/opt Contains add-on software, larger programs may install here rather than in /usr.
/proc This contains virtual filesystems describing the processes information as files.
/sbin This stands for System Binaries, and contains the fundamental utilities needed to start, maintain and recover the system.
/root This is the home location for the system administrator root. This accounts home directory is usually the root of the first partition.
/srv This one is server data which is data for services provided by the system.
/sys This contains a sysfs virtual filesystem which holds information related to the hardware operating system.
/tmp This is a place for temporary files. tmpfs mounted on it or scripts on start up usually clear this at boot.
/usr This holds the executables and shared resources that are not system critical.
/var This stands for variable and is a place for files that are in a changeable state. Such as size going up and down.
/swap The swap partition is where you extend the system memory by dedicating part of the hard drive to it.
Most Common Partition Scheme
Name Recommended Partition Space
/home Remaining Free Space after other partitions created or 2nd drive.
/usr 20GB at least
/var 2GB
/lib 5GB
/boot 250MB
/opt 500MB to 5GB
/etc 250MB
/sbin 250MB
/bin 250MB
/dev 250MB
/srv 100MB
/tmp Match this to the size of the Swap partition.
/mnt 8KB This is an empty partition used as a mount point for temporary files.
/media 8KB This contains subdirectories for mount points of removable media, such as CDs and USB flash drives.
/swap Generally twice as large as the amount of RAM currently in the PC.

There are many other schemes and as many reasons for not splitting off a directory as a partition, as there are for creating a specific partition to streamline a particular process. If you want to proceed with a custom install then how you achieve this is going to be up to you. It all depends on the use you plan to put the system to.

Note: Once the partitions are made, you should only add more. Changing the sizes or properties of existing partitions is possible but not recommended. The current default filesystem for these partitions is Ext4.

If you need aid from Dell Technical Support in setting these up, then I would have to advise contacting the Operating Systems manufacturer instead as this type of help is not going to be covered under our existing warranties and only the operating systems (OS) developer will be able to answer your questions on this subject as they are the acknowledged experts on their own OS.


Back to Top


3. Directories

In simple terms Directories in Ubuntu Linux are folders that contain files. You will see a certain amount of overlap with the terms used for the partitions in the section above. The reason for this is that Linux split up the directories onto separate partitions so that they could dedicate space to each of them and mostly to protect against data loss. This was so that if one partition crashed or was lost it wouldn't affect all of the others. This is mostly a thing of the past thanks to Journaled file systems such as Ext3 and Ext4. Once the separate partition is mounted to / it then shows as a directory thereof.

The easiest way to think of the directories on an Ubuntu Linux system is to think of them as branches on a tree where the Trunk of the tree is the root directory on your first partition. All the other directories mount to this Trunk as branches. Each branch has it's own purpose but may interact with others through the Trunk and have sub directories branch off from those main branches.

Note: While this isn't entirely accurate for Ubuntu, it will suffice until you have a better understanding of the format and can determine for yourself where exceptions will crop up.
Directory Name Content
/bin Contains the common programs, shared by the system, the system administrator and the users.
/boot This has the start up files and the kernel, vmlinuz. In some recent distributions it also has grub data. GRUB is the GRand Unified Boot Loader.
/dev Contains references to all the CPU peripheral hardware. They are represented as files with special properties.
/etc This has the most important system configuration files, this directory is similar to the control panel in Windows.
/home This is the home directory for the common users.
/initrd This contains information for booting in some distributions. Do Not Remove.
/lib This holds the library files, it includes files for all kinds of programs needed by the user.
/lost+found Every partition has a lost+found in its upper directory. Files that were saved during falures reside here.
/misc For miscellaneous uses.
/mnt Standard mount point for external files systems, such as media players, digital cameras and CD ROMs.
/net Standard mount point for entire remote file systems.
/opt Typically this will have third party software and any extra files required.
/proc This is a virtual files system containing information about system resources. You can get more information about the meaning of the files in proc by entering the command man proc in a terminal window. The file proc.txt discusses the virtual file system in detail.
/root This is the system administrator user's home directory. Remember there is a difference between / the root directory and /root the home directory of the root user.
/sbin This contains programs for use by the system administrator.
/tmp This is temporary space for use by the system. It is regularly wiped so remember not to keep anything you want to retain here.
/usr This has programs, libraries and documentation for all the user related programs.
/var This is the storage for all the variable files and the temporary files created by users. Things like the log files, the mail queue, the print spooler area, space for the internet cache or to keep an image of a CD/DVD before burning it.

You can find a guide on actually using these directories after you've finished the install on the link below.


Back to Top


Additional Information :

Note:
Software support is provided by Canonical through the following methods:
Technical Support is provided by Dell :


Back to Top





Article ID: SLN152018

Last Date Modified: 08/28/2018 06:59 AM


Rate this article

Accurate
Useful
Easy to understand
Was this article helpful?
Yes No
Send us feedback
Comments cannot contain these special characters: <>()\
Sorry, our feedback system is currently down. Please try again later.

Thank you for your feedback.