Disk Partitions in Linux

Category: Entertainment

Presentation Description

No description available.


Presentation Transcript

Disk Partitions in Linux : 

Disk Partitions in Linux Prepared By:- FARAAZ CHAUDHARY 1

What Is A Partition? : 

What Is A Partition? A partition is a means of dividing your hard disk into multiple sections, each of which is treated as a separate disk by your operating system. This allows you to be able to boot different operating systems from the same disk, for example, Linux and Windows. Partitions cannot be moved or resized without destroying the data on them. 2

What Is a File system? : 

What Is a File system? Filesystems can be considered as being the directory structures on a disk partition that contains all the files. Most Windows users would be familiar with the analogous terms "folders" and "subfolders", whereas Linux users would be familiar with the terms "directories" and "sub-directories". 3

How Linux Links Filesystems and Partitions? : 

How Linux Links Filesystems and Partitions? In Windows, a disk with two partitions would most likely find itself with a "C:" drive and a "D:" drive each with a separate set of folders. In Linux, everything appears to be a single set of "folders" or directories, the partitions hide underneath unseen to the regular user. In other words, Linux partitions handle all files in the subdirectory of your choice. 4

What Partitions Are Mandatory? : 

What Partitions Are Mandatory? The mandatory partitions are: "/", Also Known As "root“ The root filesystem ("/") contains the files necessary for the system to boot up in single user mode with the bare minimum of functionality. Most Linux systems then will then become multi-user systems by changing their runlevel and executing the associated startup scripts including those that will mount the remaining file systems. 5

Slide 6: 

In most cases, a corrupted root filesystem will make your system unbootable from the hard drive. Usually recovery requires reformatting the root file system and doing a Linux reinstall. If all your files are located in a root filesystem that becomes corrupted, there is a high possibility that you will lose all your data. It is for this reason that you should consider placing similar files in dedicated partitions. 6

/boot partition : 

/boot partition The /boot partition contains the Linux kernel which is the "master control program", not only for controlling the boot process, but also the normal functioning of Linux. Redhat Linux creates this partition automatically. This reduces the need to reformat the "root" partition if it becomes corrupted. 7

Swap partition : 

Swap partition Used as a location to place data temporarily if RAM memory becomes full. RedHat automatically creates this partition and usually makes it about twice the amount of system RAM. To create swap partition ]#fdisk /dev/partition name N=new L=logical Format swap ]#mkswap /dev/partition name and ID To on the swap ]#swapon /dev/partition name and ID 8

Creating partitions in Linux : 

Creating partitions in Linux To see partitions ]#vi /etc/stab To check partition table ]#vi /etc/fstab To see the partition type ]#e2label /dev/hcl (HDD name) To create partition in Hard Disk ]#fdisk /dev/hcl (HDD name) After creating the partition press “W” to save it. 9

Slide 10: 

Live information of the kernel is stored in ]#vi /etc/proc/ partitions File will be updated ]#vi /etc/proc/partitions Than we have to format the partition ]#mkfs.ext3 /dev/HDD nameX (where “X” is the partition number) To mount the drive into the partition ]#mkdir /dirname ]#mount /dev/HDD name /dirname/ 10

Slide 11: 

How to see whether the partition is created or not ]#cd /dirname/ To see the partition table ]#fdisk –l For permanent mounting ]#vi /etc/fstab Go to the last line by pressing “0” and fill in the details like partition name, place of mount, file system type, and permissions. 11

To delete the partition in Linux : 

To delete the partition in Linux ]#cat /proc/partitions ]#unmount /dev/partition name ]#vi /etc/fstab To go to the hard disk and delete ]#fdisk /dev/Hard disk name and partition number To print partition table ]#p 12


SUMMARY Partition: /usr Purpose of the Partition: Third party software Partition: /var Purpose of the Partition: Man pages (Help files) Partition: /var/log Purpose of the Partition: Error log files Partition: /var/spool Purpose of the Partition: Print queues (Only if you plan to do printing) 13

Slide 14: 

Partition: /var/spool/mail Purpose of the Partition: Mail queues Partition: /tmp Purpose of the Partition: Temporary files Partition: /home Purpose of the Partition: Multiply the expected number of users by the amount of disk space you want to assign per user. 14

Thank you : 

Thank you Wish you the best for your future 15

authorStream Live Help