Linux Introduction
VI-EDITOR
Process Management
Linux Installation
Disk Partitions & File System Management
Logical Volume Management - LVM
User & Group Administration
Package Management
Network File System - NFS
Domain Naming System - DNS
Apache HTTP Web Server
KickStart Installations
FTP server
BOOT PROCESS
Dynamic Host Configuration Protocol - DHCP
Job Scheduling
File Links
Swap Management
Log Management
Performance Management
Linux Troubleshooting
Linux Summary
116 Followers
What is Disk?
Its the hardware device capable to store data in electronic, magnetic, optical format.Disk has memory capacity to store the data and the memory capacity may vary and is defined at manufacturing time of disk. Let say the Disk diagram shown here is having capacity of 200GB to store the data.
What is Disk Partition?
Disk Partitioning divide a single hard drive into many logical drives. A disk partition is a contiguous set of blocks on a drive that are treated as an independent disk. It maintain index to know which blocks are tread a one single partition is called as partition table.
This diagram shows 200 GB disk is divided into two logical drives of different capacity which are now treated as separate independent disks.
When Disk is partitioned into logical drives, you should not use the whole disk to store the data. only the partitions are used to store data.
Why Disk Partitions?
Disk Partitioning Criteria:
M |
| EXTENDED | |
B | P | P | P |
R |
|
| L L FREE |
Disk Partition Layout
Disk Partition Types :
Disk is partitioned into logical drives and partition type can be of below 3 Partitions.
How to Identify Disks:
Linux assign logical names to identify diks, naming standards differ based on the disk type like, IDE, SCSI, Virtual disk.
Disk partitioning Scenarios
How to view the existing partitions
$ fdisk utility is used to manage disk partitions in Linux
#


Note: Observe in the above picture that the device name is /dev/sdb .
How to use fdisk utility
To enter into disk utility, the syntax is
#fdisk <disk name>
#fdisk /dev/sdb
Use m to list out various options that can be used in fdisk.
Creating a new partition
#fdisk /dev/sdb
Now use n to create a new partition and verify it again with p .


Deleting a partition
Use d to delete a partition and specify the device name, in our case it is 1.

Note: Partition 1 has deleted.
Saving the partition changes
Every time you make a partition or delete a partition, the changes made has to be saved using w, otherwise the creation and deletion will not be considered to be happen. For practice purpose you can make any no. of partition and delete it and just quit using q so that it will not be saved.

Updating the partition table without restarting the system
After creating or deleting a partition the changes will be effected in the partition table only after the restart of the system. But there is a way to avoid this circumstance. We can use partprobe or partx command to update the partition information without restarting the system
#partprobe /dev/sdb or
#partx –a /dev/sdb or
#kpartx /dev/sdbNote: In RHEL6 partprobe is not functioning properly, so it is recommended to use partx command only.