We can divide a single hard drive into many logical drives (like Partition 1, Partition 2 etc.) that is called partition.
Disk Partitioning Criteria:
P= PRIMARY PARTITION
EXTENDED= EXTENDED PARTITION
L= LOGICAL PARTITION
FREE= FREE SPACE
We can divided disk into only 3 Primary Partitions.Primary Partition is a usually holds the operating system.
Extended Partition is a special type of primary partition We can be divided into multiple logical partitions. We have only 3 primary partitions per disk, and if the user is required to make further partitions there are the space remaining on the disk so user can be allocated to extended partition and user can used it create the logical partitions later.
How Can Disk Identification
IDE drive will be shown as /dev/hda
SCSI drive will be shown as /dev/sda
Virtual drive will be shown as /dev/vda
Types of file systems used in Linux:
The file systems supported in Linux O.S .We have ext2, ext3, xfs ,ext4, vfat in RHEL etc.Ext file system is the widely used file system in Linux.
Mounting Point in Linux:
(a) /etc/mtab:- is a file which stores the information of all the currently mounted file. it is dynamic and keeps changing.HOW TO CREATE FILE SYSTEM IN LINUX
Check partition using in linux :
Partition using fdisk
root@server~#fdisk <disk name>root@server~#fdisk /dev/sda
Use n to create a new partition using n and show list using p.
root@server~#fdisk /dev/sda (ENTER)
command( m for help) p (Show list)
Use d to delete a partition
command( m for help) : w
root@server~# fdisk /dev/sda
Command (m for help) : n
(type n for new partition)
(p - primary) or e - extended) : p
(type p for primary partition or type e for extended partition)
First cylinder : (press Enter for default first cylinder n Last cylinder : + <size in KB/MB/GB/TB>
Command (m for help) : t
(type t to change the partition id)
(for example: 8e for Linux LVM, 82 for Linux Swap and 83 for Linux normal partition)
Command (m for help) : w
(type w tosave the changes into the disk)
root@server~# partprobe /partx -a/dir1 /dev/sda1
(to update the partitioning information in partition table)
Mounting a partition
Mounting is a procedure where we attach a directory to the file system.Temporary Mounting
A temporary mount point we will create a directory and mount it, but this mount point will last only till the system is up, once it is rebooted the mounting will be lost.root@server#umount <mount point directory>
root@server#umount /dir1
verify it with mount command.
Permanent Mounting
We can permanent mount the file system,but we have to update all details in this file /etc/fstab , after mounted file system we have to reboot the system.Steps To make a permanent mount point:
root@server~
root@server~
root@server~root@server~
root@server~# du -h
(to see all the file sizes which are located in the present working directory)To see the biggest files from current location)
root@server~# du .| sort -nr | head -n10
To see the biggest directoriesroot@server~# du -s * | sort -nr | head -n10
command is used
Syntax
root@server#e2label <partition name> <label>
root@server#e2label /dev/sda7 ktdisk
To check the label
root@server#e2label /dev/sda7