Linux Tuition

Linux tuition is the blog which is designed for learning the Linux

Partitions

                            HARD DISK MANAGEMENT



-      Disk management is the utility service in Linux , which have been used to manage and create partition in Linux O/s
-      Type of partitions

According to MBR partition rule there are two type of partitions are there
1) Primary partition
2) Extended partition


Primary partition – This partition is being created for O/s installation and it support O/s supported files
-      Extended Partition – This partition is being used to create logical partition
Logical partition is being created for the use of storage purpose only
Up to around 18 to 20 logical partition can be supported in Linux machine
According to MBR rule maximum partition limit is 4 that’s why the concept of extended partition adopted
Basic rule is – 3 primary partitions and 1 extended partition in which multiple logical partitions can be created
& In windows 21 extended partitions can be created


Following are the commands for disk management in Linux


S.no
Command
Work
1
fdisk –l
To view the existing partition
2
fdisk /dev/sda
To modify the selected partition
3
fdisk /dev/hda
To perform partition on PATA HDD
4
fdisk /dev/sda
It will open partition interface
Sno.
Sub commands in
fdisk /dev/sda

1
m
For help
2
p
To print the existing partition
3
n
To create new partition
4
d
To delete any existing partition
5
w
To save & quite partition
6
Q
To quite without save

1>       To create primary partition via this interface

Press – n à select the partition type ( Primary or Secondary ) à :p à partition number : by default à enter first sector :press enter à last sector à :+5G (for 5 GB partition ) size

2>       To create extended partition

Press – n à select the partition type ( Primary or Secondary ) à :e à partition number : by default à enter first sector :press enter à last sector : press enter

To format a partition
#mkfs .ext4 /dev.sda5

PERMANENT MOUNTING OF CREATED PARTITION

-      To perform permanent mounting of partition

1) Create folder inside / (or any other location )
2) # cd /
3) # mkdir disk1  disk2
4) # ls
5) # vim /etc/fstab
6) Get into the insert mode – press i
7) “ /dev/sda5     /disk1   ext4    default 0  0”
8) Write this entry in the file
9) Save & exit
10)             # mount –a :to ,mount all existing partition
If you delete any partition via fdisk /dev/sda , then also remove those partition’s entry from the fstab file

To know the UUID (unique user ID )
#blkid /dev/sda(1,2,3,4,)
Insted of partition name we can write uuid also



                                        SOFT LINKS AND HARD LINK  

è   Soft link

- It is a temporary shortcut access to file and folder
- Soft link can be created for both file and folder
- When we create soft link in code number of original file and soft link will be different
- In case of deletion of original file, then soft link will not work
- In case of soft link the permission of original and soft link file will be different  
- Soft link is created for allowing temporary access to major file
- Command to create soft link of any file and folder –
#ln –s <path location > < destination location >

è   Hard link

-      Hard link can be created any of file
-      When we create hard link mode number of original file and hard link will be same
-      In case of deletion of original file, the hard link will work
-      In case of hard link, permission of the original file and link file will be same
-      Command to create the hard link
# ln <file location> <destination>

Popular Posts