CentOS is a free and open-source Linux operating system based on the source code from Red Hat's commercial Red Hat Enterprise Linux product. CentOS includes a variety of command-line tools for performing a variety of system functions, including creating, deleting and resizing partitions. The "parted" command can resize existing partitions on the system, but if you want to resize the root partition, you'll need to boot off the CentOS CD first, since CentOS can't resize a partition that is in use. Always have backups of your important data before modifying partitions, as data loss can occur.
- Skill level:
- Moderately Challenging
Other People Are Reading
Boot from a CentOS disc by inserting it into your computer and restarting the system if you want to change the partition size of a partition that is in use.
Click "Applications," "Accessories" and "Terminal" at the CentOS desktop.
Type "su" into the terminal and press "Enter."
Type your root password at the password prompt and press "Enter."
Type "mount" to see a list of mounted partitions with their device names.
Unmount the partition by typing "umount /dev/sda1," replacing "/dev/sda1" with its device name, and pressing "Enter." If the partition is a swap partition, type "swapoff /dev/sda1" instead. You can't unmount the "/" partition, or other important partitions. If you booted from the CentOS disc, the partitions will already be unmounted.
Type "parted /dev/sda" and press "Enter" to run parted on the first hard drive. If you want to resize a partition on the second hard drive, type "/dev/sdb" instead, and so on.
Type "print" and press "Enter" to see a list of partitions on the hard drive.
Change the partition size with the resize command. For example, type "resize 3 1024 2048" to change the third partition's size to start at 1024MB on the hard drive and end at 2048MB.
Tips and warnings
- If there's no room on the hard drive, you'll have to resize another partition to be smaller first, or delete a partition. You can delete a partition by typing "rm 3" at the parted prompt, replacing "3" with the partition's number. Deleting a partition permanently deletes all the files on it.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for