Manual of The Experiment1.2 Linux
Manual of The Experiment1.2 Linux
Manual
In this manual, we are going to learn the procedure for Adding Disks, Partitions, and File Systems to a
Linux System. In which we will learn to create, remove and resize the partitions using commands and
using GUI. So, let’s first discuss the commands that are used to manipulate the partitions in the Linux
Operating System.
a. Create, remove, and resize various types of partitions through command line using
fdisk, gdisk, mkfs, mount.
fdisk: fdisk stands (for “fixed disk or format disk“). With the help of fdisk command you can view,
create, resize, delete, change, copy and move partitions on a hard drive. It allows you to create a
maximum of four new primary partitions and a number of logical (extended) partitions, based on the
size of the hard disk you have in your system.
After this you can enter the size by adding “+5000M” in last cylinder, where + means addition
and 5000M means 5000MB size of new partition.
6. Mount: Mount is to access a filesystem in Linux. You can mount a filesystem on any directory
and access content by entering to that directory. These directories are called mount points.
Syntax: $ mount [-t fstype] filesystem mountpoint
Output:
7. Unmount: Use umount command to unmount any mounted file system on your system. Run
umount command with disk name or mount point name to unmount currently mounted disk.
Syntax: $ umount /dev/sdb
8. fsck: It stands for file system consistency check. This check can be done automatically during
boot time or run manually.
b. Create, remove, and resize various types of partitions through GUI using
Gparted
Gparted: Gparted is a free, cross platform and advanced graphical disk partition manager that
works on Linux operating systems, Mac OS X and Windows. It is used to resize, copy, move, label,
check or delete partitions without data loss, enabling you to grow or shrink root partition, create space
for new operating systems and attempt data rescue from lost partitions.
• After launching gparted tool, the default window that you should see on your screen:
• It will ask you for final confirmation for applying the changes:
Where device is the name of the swap partition or file, and size is the size of the swap area in
blocks
• Enabling the Swap Space: In order for the new swap space to be utilized, you must enable it
with the swapon command.
Syntax: $swapon /swap
Example: swapon /mnt/swapfile
• Disabling Swap Space: To disable swap space, simply use the command.
Syntax: $ swapoff device
• To verify the creation of a swapspace, -s option with swapon command can be used.
swapon -s
References:
1. https://www.tecmint.com/fdisk-commands-to-manage-linux-disk-partitions/
2. https://devconnected.com/how-to-create-disk-partitions-on-linux/