Increase or Decrease the Size of Static Partition in Linux
Task 7 (B)
Task description
Increase or Decrease the Size of Static Partition in Linux
For this task first we have to create a partion
Step 1
Create a partion
cmd:- fdisk <disk name >
eg fdisk /dev/sdb
n for new partion
p for primary
Step 2
Format the partion
for formating the partion we know partion name
cmd :- lsblk
cmd:- mkfs.ext4 /dev/sdb1
Step 3
Mount the partion
for mounting we want dir
cmd :- mkdir /foldername
eg mkdir /task
For mounting
cmd:- mount /dev/sdb1 /task
To check
Step 4
Unmount the partion
cmd:- umount <folder name>
Clean the file
cmd:- e2fsck -f <partition name>
TO INCREASE THE SIZE OF STATIC PARTITION
cmd:- resize2fs <partition name> <size>
Remount to get the files after increase in size
cmd:- mount <partition name> /<folder name>
TO DECREASE THE SIZE OF STATIC PARTITION
cmd:- resize2fs <partition name> <size>
And remount to get back the files
Thanks for reading 🙏