🔅Increase or Decrease the Size of Static Partition in Linux
✨ TASK :
Increase or Decrease the Size of Static Partition in Linux
In Linux, the primary partition don’t allow elasticity in size but if we do then we have to format it again but the issues are that if we format the partition again then we will not be able to access the data that we had stored. So we have to find some way through which we can increase or decrease the size of the static partition by formatting it again.
STEPS :
1 . Add a new harddisk to the vm
I attached 40 GB harddisk.
Now , see the size of harddisk using fdisk -l command .
2. Now , create a partition of 20 GB
we can see 20G partition is created.
3. Now , we need to format it .
4. Now , create a folder and mount it .
use df -h command to check partition is mounted or not .
Store some data in the folder in which we mounted our partition
5. Now to resize the partition , unmount it.
here , we can see after unmount now data is also not showing in /vans folder
6. Create the existing partition
here , we will create the partition /dev/sdb1 so that we can change the size of the partition.
Now , create the partition again with changed size .
here, I increased the size from 20GB to 30GB.
7. Now , verify the partition consistency by running the e2fsck command.
Now , resize the partition.
8. Now , again mount this partition to /vans folder.
9. Now , check the data again in /vans folder.
Task is successfully completed !!
🎉 Thank You !