On Unix-like operating systems, the parted command creates, views, deletes, and modifies disk partitions.

Description

GNU parted is a disk partitioning and partition resizing program. It lets you create, destroy, resize, move and copy ext2, linux-swap, FAT, FAT32, and reiserfs partitions. It can create, resize, and move Macintosh HFS partitions, and detect jfs, ntfs, ufs, and xfs partitions. It is useful for creating space for new operating systems, reorganising disk usage, and copying data to new hard disks.

  • Description
  • Syntax
  • Commands
  • Known issues
  • Examples
  • Related commands
  • Linux commands help

Syntax

parted [options] [device [command [options…]…]]

Options

Commands

Known issues

ext3 filesystem functionality does not currently work. To manage ext3 type filesystems, use tools like resize2fs or mke2fs. Note that the currently supported ext2 filesystem is deprecated once ext3 support is finalized. Further note that ext3 support has limited functionality that is yet to be defined. Use tools like resize2fs and mke2fs to manage these types of filesystems.

To manually resize an ext3 filesystem or a partition, use resize2fs, fdisk, or similar tools. For LVM situations, use the LVM commands to resize the LVM elements.

Examples

parted

Brings you to the parted command prompt, where you can enter any of the commands listed above. Note that parted should run as the superuser to gain the full hardware access it requires; for example, you may need to run parted with the sudo command instead:

sudo parted

Once inside, you are placed at a “(parted)” prompt, where you can enter any of the commands above to partition your hard disk, or the quit command to exit.

fdisk — A disk partitioning utility.mkfs — Build a Linux file system, usually a hard disk partition.