Red Hat Linux Reference Guide

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

Start Preparation Smartly

We have the collection to start prepartion smartly.

Start Assessment

Red Hat Linux Reference Guide

  DevOps Tech Hub

116 Followers

What is NFS?


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?

  • File System coppuption is now limited to  single partition rather whole disk, as File System is now can be mounted on disk partition.
  • While creating File System on each Disk partition and each Partition can be  formated with different block sizes meeting the business needs. 
  • Limit data growth per disk partition as each disk partition is now seperate  file system. 

Disk Partitioning Criteria:

M

 

EXTENDED

B

P

P

P

R

 

 

L     L  FREE


  • MBR = MASTER BOOT RECORD
  • P= PRIMARY PARTITION
  • EXTENDED= EXTENDED PARTITION
  • L= LOGICAL PARTITION
  • FREE= FREE SPACE

Disk Partition Layout

  • On the boot disk the first partition is called as MBR
  • MBR is a Master Boot Record contains  IPL (Initial Program Loader) and PT (Partition Table )
  • IPL contains boot loader hence IPL is responsible for booting the operating the system.
  • Boot Loader is the program which initiates booting process. Different Boot Loader Programs are used to boot the Linux System.They are
    • LILO - Default boot loader for RHEL4
    • Grub - Default boot loader for RHEL5 onwards
  • PT (Partition Table ) stores information about the number of partitions on the disk, sizes of the partition and types of partitions.

Disk Partition Types :

Disk is partitioned into logical drives and  partition type can be  of below 3 Partitions.

  • Primary Partition is a partition which usually holds the operating system. Only one amongst the 3 primary partitions can be active which will be booted by MBR to load the operating system. Maximum of 4 primary partitions can be created. 
  • Extended Partition is a special type of primary partition which can be subdivided into multiple logical partitions. As there can be only 4  primary partitions per disk, and if the user is required to make further partitions then all the space remaining on the disk should be allocated to extended partition, which can be used to create the logical partitions later. There can be only one extended partition per disk.
  • Logical partitions are the partitions which are created under extended partition, all the space in the extended partition can be used to create any number of logical 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.

  • IDE drive will be shown as /dev/hda, /dev/hdb etc..
  • SCSI drive will be shown as /dev/sda, /dev/sdb etc..
  • Virtual drive will be shown as /dev/vda, /dev/vdb etc..

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
  • Use p to list out the partition information first and
  • Use n to create a new partition.

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
#partxa /dev/sdb or
#kpartx /dev/sdb

Note: In RHEL6 partprobe is not functioning properly, so it is recommended to use partx command only.


Previous Next