Connect with us

Hi, what are you looking for?


Linux Disc Partitioning on CentOS 7

Linux Basic and Advanced Disc Partitioning for CentOS / RHEL 7/6

View Disk Information

To view available free space of a disk
[]# hwbrowser &
To view the free space in a partition
[]# df –h
To view the total amount of used space in a partition / directory
[]# du –sh
To know the block size of a partition
[]# blockdev –getbsz <partition>


To assign label to a partition
[]# e2label <partition> <label name>
To view the existing labels
[]# e2label <partition>
To see a mounted partition with its label
[]# mount –l

Swap Partition

Create a new Partition
[]# fdisk <device>
Format the partition as swap
[]# mkswap <partition>
Turn on Swap
[]# swapon <partition>
Check the status of swap used
[]# swapon –s <partition>
Turn off swap
[]# swapoff <partition>

Mounting a Partition Permanently

To mount a partition Permanently
[]# vl /etc/fstab

Mounting Removable Devices

To mount cdrom drive
[]# mount /dev/cdrom mnt
To mount a pen drive
[]# mount /dev sda1 /mnt

What is Logical Volume Manager (LVM)?

  • LVM is a method of allocating hard drive space into logical volumes that can be easily resized.
  • With LVM, the hard drive or set of hard drives is allocated to one or more physical volumes.
  • The physical volumes are then combined into volumes groups.
  • Each volumes group is divided into logical volumes, which are formatted with a file system like ext3 and are then mounted.

Creating Partitions

Make Multiple Partitions
[]# fdisk <device>
Update the partition table
[]# partprobe <device>

Physical Volume

Create a physical volume from the previously created partitions
[]# pvcreate <partition1> <partition2> <partition3>
To see the physical volume details
[]# pvdisplay |less

Volume Group

Create a volume group
[]# vgcreate <volume group name> <physical volume 1> <physical volume 2>
To see the volume group details
[]# vgdisplay <volume group name>

Logical volume

Create logical volume
[]# lvcreate –L <size> <volume group name> -n <volume name>
Format the logical volume
[]# mkfs.ext3 < volume name>
Create a mount point
[]# mkdir <directory name>
Mounting a logical volume
[]# mount <volume name > <mount point>
Re-sizing a logical volume
[]# lvresize –L <+sizeM> <logical volume name>
To update the re-sized logical volume
[]# resize2fs <logical volume name>
Removing logical volume
[]# lvremove <logical volume name>
Extending the size of a volume group
[]#vgextend <volume group name ><physical volume name>

Congratulations now you have created and managed the basic and advanced partitioning.


You May Also Like


How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...


Internet is the most important public network for connecting to the WEB. For internet connection requirement the ISP is required as well as it...


How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...


How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...