HARDDISK PARTION USING FDISK Exp no :4 Date : Aim: To partition a hard disk using fdisk 1. For creating Partition in a hard disk we use Fdisk command # sudo fdisk /dev/ sdb
2.To create partition we use n command in fdisk #n -click enter to select Primary or extended Partition - p command for primary Partition #p -Give appropriate size for the partition [ eg : +1G,+2G,….]
3. For creating logical Partition use n command. #n -click enter #l -. For logical Partition -Provide size for the partitio n
4.To create a File System # sudo mkfs.ext4 /dev/sdb1
5.To create a directory # sudo mkdir / mnt /name
6.Mount the partition against the mount point. # sudo mount /dev/ sdbi / mnt /document # lsblk -For seeing the mount
7.For mounting Partition automatically on booking. time we use fstab # sudo nano /etc/ fstab - Inside fstab / dev / sdb / mnt /document ext4 default 0 0
8.For creating File system, directory mount and mounting on rebooting time # lsblk -For seeing the mount Result Hard disk partition using fdisk isexecuted and output is verified.
HARDDISK PARTITION USING GDISK Exp no :5 Date : Aim: To partition a hard disk using gdisk For creating partition for hard disk we use gdisk command. # sudo gdisk /dev/ sdc
2. To create partition we use n command. #n -Give appropriate size for the partition [eg.+500M,1G] -Provide the type of file system. -we use ‘ 8300 ’ for Linux file system.
3. To create file system. # sudo mkfs.ext4 /dev/sdc1
5. Mount the partition against the appropriate mounting point. # sudo mount /dev/sdc1 / mnt /document
6. For mounting partition automatically on booting time use fstab . # sudo nano /etc/ fstab -Inside fstab /dev/sdc1 / mnt /document ext4 defaults 0 0
7. # lsblk for seeing the mounting. Result: hard disk partition using gdisk is executed and output is verified.
HARDDISK PARTITION USING PARTED Exp no :6 Date : Aim: To partition a hard disk using parted 1.For creating a partition in hard disk we use parted command. # sudo parted /dev/ sdd
2.For creating a new disk label [partition table] # mklabel
3.Creating a partition . # mkpart -Enter partition name. -Enter file system type. -Enter start:[eg.2M] -Enter end:[eg.500M]
4.Repeat the step 3 for creating other two partitions. 5.For creating file system. # sudo mkfs.ext4 /dev/sdd1
6.For creating mounting point use the command. # sudo mkdir / mnt /document
7. Mount the partition against the appropriate mounting point. # sudo mount /dev/sdd1 / mnt /document
8. For mounting partition automatically on booting time use fstab . # sudo nano /etc/ fstab -Inside fstab /dev/sdd1 / mnt /document ext4 defaults 0 0
9. #lsblk for seeing the mounting. Result: Hard disk partition using parted is executed and output is verified.
CREATING SWAP PARTITION Exp no :7 Date : Aim: To create swap partition using gdisk . 1.To create partition for hard disk we use gdisk command. # sudo gdisk /dev/ sdc
2.To create partition we use n command. #n - Give appropriate size for the partition. - Provide the type of file system ‘8200’ for swap.
3. Use mkswap command for format the partition. # sudo mkswap /dev/sdc4
4. Use swapon command for activate the swap partition. # sudo swapon /dev/sdc4
5. For mounting partition automatically on booting time use fstab . # sudo nano /etc/ fstab -Inside fstab : /dev/sdc4 swap swap defaults 0 0
6. # lsblk for seeing the mounting. Result: creation of swap partition is executed and output is verified.