Parted: How To Resize a Partition

Usually you'd use GParted Live CD to make life easier, but just incase you ever need to use the command line for partitioning..

If /dev/hda1 is the device on which to resize the partition:
parted /dev/hda1

View the current partition table to determine the minor number of the partition to resize as well as the start and end points for the partition:
print

To resize the partition, use the resize command followed by the minor number for the partition, the starting place in megabytes, and the end place in megabytes. For example:

resize 3 1024 2048

NOTE: Some systems will display the information as :
NUMBER    START         END             AND SO ON...
10 32kB 40GB HFS+
In this case, (to resize from 40GB to 20GB) type:
resize 10 32kB 20GB

After resizing the partition, use the print command to confirm that the partition has been resized correctly, is the correct partition type, and is the correct file system type.

After rebooting the system into normal mode, use the command df to make sure the partition was mounted and is recognized with the new size.

NOTE: NTFS gives an error message
No Implementation: Support for opening ntfs file systems is not implemented yet.
Sorry, I haven't discovered a solution to this yet.


Ref: http://linuxpoison.blogspot.com/2008/03/howto-resize-partition.html

0 comments: