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 logically. Even though these terms can overlap and sometimes mean two different things simultaneously. 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. They are largely automated and do not 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 to the Windows Operating system (OS). This information is provided for your knowledge but is used at your discretion.


Back to Top




FileSystem

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

What this essentially means is that the Filesystem is the structure that is used to see, find and use your files using Ubuntu. While 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 distros. 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 64-bit option that is mostly supported now as an option in Red Hat.
ReiserFS Linux/SUSE This was a file format that was in use across several distros 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 that is 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 is a special file type, and it is similar to TCP/IP sockets in windows. It will provide inter-process networking that is 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. While 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


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 are better to take them as two separate processes.

Windows Partition Description

Windows partitions come in two types Primary and Logical. On older SATA IDE Hard Drives, you are limited to either 4 Primary partitions or a combination of some 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 or mounting and there are new types of Hard Drives that use larger sectors. Such as a GUID or GPT table rather than an MBR table to give larger Hard Drive sizes. However, they are not 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 /. You will make several other partitions, depending on how you want to use and configure your Ubuntu install. Root will be the most important one. While 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 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 expand the PC's physical memory by using the partition as a cache.

Partition types that are used in Ubuntu Linux Installs

There are several common partitions that are used for Ubuntu, I have 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. These particular partitions will make it 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 would be just as well using the auto-install guides above.

Note: Originally having different partitions was to achieve higher data security if there is a 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. You can still get bad blocks and logical errors. The only way past this is a RAID solution, which is not something we will 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 that are needed for the booting process.
/dev This stands for devices, which contain 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 64-bit systems.
/media This is the default mount point for removable devices like USB drives and media players.
/mnt This stands for a 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 that are 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 that are provided by the system.
/sys This contains a sysfs virtual filesystem which holds information that is related to the hardware operating system.
/tmp This is a place for temporary files. tmpfs that is mounted on it or scripts on startup 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 second drive.
/usr 20 GB at least
/var 2 GB
/lib 5 GB
/boot 250 MB
/opt 500 MB to 5 GB
/etc 250 MB
/sbin 250 MB
/bin 250 MB
/dev 250 MB
/srv 100 MB
/tmp Match this to the size of the Swap partition.
/mnt 8 KB This is an empty partition that is used as a mount point for temporary files.
/media 8 KB This contains subdirectories for mount points of removable media, such as CDs and USB flash drives.
/swap Twice as large as the amount of RAM in the PC.

There are many other schemes and many reasons for not splitting off a directory as a partition. As there are many reasons 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.

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. This type of help is not going to be covered under our existing warranties. Only the operating systems (OS) developer can answer your questions on this subject. They are the acknowledged experts on their OS.


Back to Top


Directories

In simple terms, Directories in Ubuntu Linux are folders that contain files. You will see a certain amount of overlap with the terms that are 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 would not affect all 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 its purpose but may interact with others through the Trunk and have subdirectories branch off from those main branches.

Note: While this is not 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, which are shared by the system, the system administrator, and the users.
/boot This has the startup 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 that are needed by the user.
/lost+found Every partition has a lost+found in its upper directory. Files that were saved during failures reside here.
/misc For miscellaneous uses.
/mnt The standard mount point for external files systems, such as media players, digital cameras, and CD ROMs.
/net The 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 that 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 a 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 that are created by users. Things like the log files, the mail queue, the print spooler area, space for the Internet cache. To keep an image of a CD/DVD before burning it.

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


Back to Top


Additional Information:

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


Back to Top




Article ID: SLN152018

Last Date Modified: 06/29/2020 07:00 AM

Rate this article

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please select whether the article was helpful or not.
Comments cannot contain these special characters: <>()\
characters left.