Skip to main content

Partition in Linux | fdisk command

 Types of Partition 


There are three types of partition in linux.


    A.Primary Partition

    B.Extended Partition

    C.Logical Partition


We can create three primary partition and one extended partition.And 60 logical partition on extented one.

Total number of partition is 64 on one disk.


Syntax: fdisk <disk name>

m for help


Options:

n - add new partition

p - list partition table

d - delete partition

w - save partition

t - toggle change system ID


Some important commands used for partition


# fdisk -l 

list partition table

# lsblk

list disk and disk partition

# blkid

display block id of partition with file system

# df -hT 

disk consumption with human readable form

Comments

Popular posts from this blog

Yum command and its examples

  What is yum utility in linux? yum is a open source package manager for linux os and its allows automatically update and dependency management. yum stands for yellow dog update and modifier. Syntax: yum <option> <package name> Options: install - to install single or multiple packages groupinstall - install group of packages update - update single or multiple packages remove - uninstall package info - display detail info about package list - list install packages clear - clear cache repolist - display list of all repositories

Booting Process in Linux

  What is booting process? Basically how system starts and we get GUI is called as booting process. 1.BIOS/UEFS BIOS is a Basic input and output system. UEFS is a unified extensible firmware.  2. Master Boot Loader It has the total size of 512 kb.     446 kb for boot loader     64  kb for partition table     2 kb for future reserved 3. Boot Loaders Boot loader in RHEL8 and RHEL9 is grub2. It has location of kernal. GRUB2 is stand for Grand Unified Boot Loader. 4.Kernal   Kernal loads in system and take command of systems. 5.Systemd This is the first process of linux system. 6.Targets Simply target means user console(GUI/CLI)  

Logical Volume Management (LVM)

  Logical Volume Management  Steps in LVM creation A. Partition Creation 1. Create Physical Partition using fdisk command # fdisk <disk name>  2. Create physical volume # pvcreate <physical partition name 1> <physical partition name 2> .. n #pvs and # pvdisplay above command used to display pv. 3. Create volume group #vgcreate  <vg name>  <pv name1>  <pv name 2> #vgdisplay # vgs 4. Create logical Volume  # lvcreate -L <size> -n <lvname> <vgname>  #lvdisplay # lvs B. Format Partition #mkfs.<file system> <lv path> # mkfs -t <file system> <lv path> for swap mkswap <lvpath> C. Mount Partition a. temporary b. permanent  Steps to delete partition 1. Unmount 2.Delete LVM partition 3.Delete Volume group 4.Delete Physical volume 5.Delete Physical partition