Javatpoint Logo
Javatpoint Logo

Ubuntu Partition

In this article, we hope to make clear how many terms applied in Ubuntu Linux for its design can be logically described. These terms even though can overlap and mean sometimes different things concurrently. This article isn't meant to make us an expert in Ubuntu. Just to clear a few terms and definitions so that we can better know, install, and use the operating system.

File System

The users of Linux make a file system distinction. Stating that the file system is the programmatic scheme that is used for organizing and finding files over a partition. However, the file system refers to every file on our computer.

What it essentially defines is that the file system is a structure that is used for seeing, finding, and using our files with Ubuntu. On the other hand, the file system is both every isolated file in the structure and those formats of the files.

Some important file system, operating system, and their description are mentioned in the following table:

Operating System File System Description
Legacy FAT It is a Legacy File System that is adopted universally. It came in 32 FAT32, 16 FAT16, and 12 FAT12..
Windows NTFS It's a new tech file system that substituted FAT on many windows systems. Still, it is required to read the partitions of Windows..
Linux Ext2 It is the second extended file system that is used by several distributions of Linux..
Linux Ext3 It is the third extended file system and the default choice for the distributions of Ubuntu. Journaling is added to this partition..
Linux Ext4 It is the fourth extended file system that is used by several distributions of Linux. It can extend the limits of storage..
Linux JFS It is a Journaled file system and was announced by IBM. But it has been substituted by Ext4..
Linux/Irix XFS It is an option of 64-bit that is widely supported now as the option in Red Hat..
Linux/SUSE ReiserFS It was a format of the file that was in use around many distributions but has been largely substituted by Ext3.

File Types in Ubuntu Linux

There are many file types in Ubuntu Linux which are listed and explained below:

Ubuntu Partition
  • Directories
    Directories are files or folders that are the lists of other files.
  • Regular files
    Regular files contain data like text files, programs or executable files, input in/output out through the program, and such.
  • Special files
    It is a mechanism that is applied for input and output. Some most unique files are inside the /dev directory.
  • Links
    It is a system to create a directory or file visible in various parts of the file tree of the system.
  • Domain sockets
    It is a special type of file and the same as IP/TCP sockets in Windows systems. It will offer inter-process networking that's protected by the access control of the file system.
  • Named pipes
    Named pipes act less or more likes sockets and these are the way for many processes to navigate with each other without applying any protocol of network socket.

Partitions

The initial thing to understand is to remove much of what we already know about the partitions of Windows. Attempting to match these two operating systems will just confuse us. We are better to think of them as two different processes.

Description of Windows Partition

The partitions of Windows provide two types Logical and Primary. We are restricted to either a combination of a few Logical and Primary partitions or four primary partitions on older hard drives of SATA IDE. All will get a Drive letter, but we will be only able for installing the operating system on a Primary partition.

Important: There are some things that could be done with the partitions of Windows. Like mounting and spanning and there are some Hard Drive types that apply bigger sectors. Like a GPT and GUID table instead of an MBR table for giving bigger sizes of the Hard Drive.

Description of Ubuntu Linux Partition

Also, the partitions of Ubuntu Linux provide Logical and Primary. We will be still restricted to either a combination of a few Logical and Primary partitions or four primary partitions. Although, that's where many similarities stop.

Our first partition will be always our install partition over the primary partition. Sometimes, the partition will be known as the Root of the partition or displayed as a '/'. We will make many other partitions, relying on how we wish to configure and use our Ubuntu install.

Root would be one of the most essential ones. While we can make the partitions and provide them a purpose, a file format, and a size. Usually, they will require to be mounted on the '/' of this partition to implement.

Categories of Ubuntu Linux partition

Further, Ubuntu Linux isolates the partitions into two different categories

Ubuntu Partition

Swap partitions

Swap partitions can expand the physical memory of the PC by using a partition as the cache.

Data partitions

Data partitions such as the boot partition that keep files and directories or normal data of the Linux System. They are the files that boot and execute the system.

Partition types used in Ubuntu Installs

There are many common partitions that can be used for Ubuntu. We have mentioned them and some details for all below. Experienced users of Linux use a combination of a few of these partitions as any scheme. It is when they understand they will be applying the custom Ubuntu install for a particular set of uses.

These specific partitions will make it efficient and much easier. Also, we will list what partition combinations are needed for the most basic generic install. Although, if we are going to apply this scheme, we would be only using the guides of auto-install above.

Important: Originally having distinct partitions was to get higher data security when there's a disaster. It would just affect the data inside the partition that received a hit when an accident appeared. While on the other partitions, the data would likely survive. Still, it holds a few extents after journaled file systems for sudden storage loss or power failure. We can still receive logical errors and bad blocks. The only way past it is a RAID solution, which is not something we are going to discuss here.

Partition Name Explanation
/ The alone / slash defines the root of a file system tree.
/bin It defines binaries and includes the fundamental utilities that are required by every user.
/boot It includes every file that is required for the process of booting.
/dev It describes devices that include files for pseudo devices and peripheral devices.
/etc It includes configuration files for the system databases and system.
/home It holds every home directory for users.
/lib These are the system libraries and contain files such as the device drivers and kernel modules.
/lib64 These are the system libraries and contain files such as the device drivers and kernel modules for 64-bit systems.
/media It is the default mount point for many removable devices such as media players and USB drives.
/mnt It stands for mount and includes file system mount points. It is used for CD ROMs, network file systems, multiple partitions, multiple hard drives, and such.
/opt It includes add-on software and larger programs might install here instead of in the /usr directory.
/proc It includes virtual file systems specifying the information of the processes as files.
/sbin These are the system binaries and contain the fundamental utilities that are required to start, manage, and recover our system.
/root It is the home location for the root of the system administrator.
/srv It is server data, data for services which is provided by the system.
/sys It includes a sysfs virtual file system that keeps information corresponding to the hardware OS.
/tmp It is a location for temporary files. tmpfs which is mounted on it or scripts over startup usually clean it at boot.
/usr It holds the shared resources and executables that aren't system critical.
/var It specifies the variables and is a location for files that are within a changeable state like the size down and going up.
/swap It is a swap partition in which we can extend our system memory by assigning a hard drive section to it.

Most basic partition schemes

Name Suggested Partition Space
/home Free space remains after the second drive or other partitions that are made.
/usr At least 20 GB
/var 2 GB
/lib 5 GB
/boot 250 MB
/opt 500 MB - 5 GB
/etc 250 MB
/sbin 250 MB
/bin 250 MB
/dev 250 MB
/srv 100 MB
/tmp Match it to the size of a swap partition.
/mnt 8 KB. It is an empty partition that is used as the mount point for all temporary files.
/media 8 KB. It includes subdirectories for many mount points of the removable media like USB flash drives and CDs.
/swap Twice as bigger as the RAM amount in the PC.

There are several reasons and other schemes for not dividing a directory as a partition. As there are several reasons to create a particular partition for streamlining a specific process. If we wish to continue a custom install, then how we get it is going to be up to us. It all relies on the use we plan for putting the system.

Important: Once the partitions are created, we should only include more. Modifying the properties or sizes of existing partitions is feasible but not suggested. Ext4 is the current default file system for the partitions.

Directories

In Ubuntu Linux, directories are folders that include files. We will notice a certain overlap amount along with some terms that are applied for the partitions within the above section. The reason for it is that Linux breaks the directories into isolated partitions.

So that they can dedicate space to all of them and mostly for protecting against the loss of data. It was so that when one partition was lost or crushed, it will not affect the others. Mostly, it is a past thing thanks to the Journaled file systems like Ext4 and Ext3. Once the isolate partition is mounted to /, then it displays a directory thereof.

In the Ubuntu Linux System, the easiest way to assume the directories is to think of them as arms on a tree. In which the tree Trunk is the root directory on our first partition. Each of the other directories mounts to the Trunk as arms. All arms have their aim but might interact with others from the Trunk and have many subdirectories arms off through those primary arms.

Important: While it isn't entirely correct for Ubuntu. It will satisfy until we have a better knowledge of the format and can decide for ourselves where exceptions would crop up.

Name of the Directory Explanation
/bin It includes the basic programs which are distributed by the system, the users, and the system administrator.
/boot It contains the start-up files, vmlinuz, and the kernel. Also, it has grub data in a few recent distributions. GRUB stands for Grand Unified Boot Loader.
/dev It includes references to every CPU peripheral hardware. These are illustrated as files along with unique properties.
/etc It contains the most essential files of system configuration. This directory is the same as the control panel in Windows.
/home It is the home directory for the users.
/initrd It includes information to boot in a few distributions. Don't Remove it.
/lib It keeps the library files. It contains files for every type of program that is required by the user.
/lost+found All partitions have a lost+found in the upper directory. The files reside here which were stored during failures.
/misc This directory is used for miscellaneous uses.
/mnt It is a standard mount point for all external file systems like CD ROMs, digital cameras, and media players.
/net It is a standard mount point for the whole remote file system.
/opt It will typically have third-party software and other files needed.
/proc It is a virtual file system including information about all system resources. We can get more details about the file meaning in proc by typing the man proc command within the terminal window. The proc.txt file explains the virtual file system.
/root It is the home directory of the user of the system administrator. Remember that there is a distinction between the /root home directory and the / root directory of the root user.
/sbin It includes programs for use by any system administrator.
/tmp It is a temporary space for use by any system. It is wiped regularly, so remember not to save anything we wish to retain here.
/usr It contains documentation, libraries, and programs for every user-related function.
/var It is the storage for every temporary file and variable file that is made by the user. Things like the print spooler area, the mail queue, the log file, and space for the Internet cache. For keeping a picture of a DVD/CD before burning it.

How to View Partition Table in Ubuntu?

Using the lsblk Command

The command, i.e., lsblk lists every block device of our system with their logical partitions. We need to just enter the below command in our terminal for listing the partition table:


Ubuntu Partition

We can see every logical partition through sda1 to sda5 for sda device in the above result.

Using the fdisk command

The command stands for Fixed-disk or Format-disk. Basically, it is used for creating or deleting the partitions of a hard disk. Also, it is used for formatting the disk.

We need to type the below command:


Ubuntu Partition

The -l flag is used for listing the specified device's partition table and exit. When we don't mention a device name, then fdisk will use the devices that were specified in the file, i.e., /proc/partitions.

Using sfdisk command

However, the sfdisk command is mainly used for manipulating partition tables in Linux, but it can also be used for listing the partition tables of any device by entering the below syntax:

Using the parted command

We can use the below syntax to check the partition table for any device:







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA