Start
sudo parted /dev/sda.Print the partition table and take note of the
Endsector of the last line:unit s print freeResize the
sda2partition (it should be shown bypartedas2):resizepart 2answering "yes" if
partedwarns you about the partition being in use and asks for confirmation; type in the number you obtained in step (2)—the last available sector on the device—appending thes(sectors) unit to it, whenpartedasks you for the end sector (you may then be asked to accept a slightly different final sector out of alignment reasons; that would be fine).Print the partition table again (same as point (2)) to confirm that
sda2has been resized.Quit
parted.Use
lsblk /dev/sdato make sure the kernel is aware of the resized partition. If its shown size is still10G, usesudo partprobe -sto refresh it and check it again.Resize the file system:
sudo resize2fs /dev/sda2You may be asked to run
sudo e2fsck -f /dev/sda2before being able to resize the file system. Do it and then retry theresize2fscommand.
When given no size argument,resize2fsgrows the file system to match the size of the containing partition.Use
df -h /dev/sda2to verify the new size.
Linux partition resize Print
Created by: Rajesh Mehta
Modified on: Wed, 30 Oct, 2024 at 11:37 AM
Did you find it helpful? Yes No
Send feedbackSorry we couldn't be helpful. Help us improve this article with your feedback.