I'll label the partitions: # parted /tmp/part name 1 hello Note how it uses SI prefixes, whereas GParted steadfastly uses binary prefixes (while dropping the silly i). Number Start End Size File system Name Flags Sector size (logical/physical): 512B/512B parted expects locations in MB for mkpartfs, but we can specify the suffix: parted /tmp/part mkpart primary ext4 3G 5GĪnd another, now an NTFS partition of 1GB: parted /tmp/part mkpart primary ntfs 5G 6G Then we make, say, an ext4 partition starting starting at 3GB (i.e., leaving the initial 3G free) and of size 2GB (i.e., ending at 5GB). Or mklabel msdos, if you want the old-school 4-primary-partition thing (called MBR or MSDOS partition table). You should replace that with the device you need ( /dev/sda, for example).įirst, if your disk doesn't have a partition table, we must create one: parted /tmp/part mklabel gpt I'm going to use a temporary file ( /tmp/part) I created to show you the commands, so the sizes will be somewhat small. The commands can be contracted to a unique prefix (e.g., h is short for help). Version display the version number and copyright information of GNU Parted Toggle ] toggle the state of FLAG on partition NUMBER Set NUMBER FLAG STATE change the FLAG on partition NUMBER
Resize NUMBER START END resize partition NUMBER and its file system Rescue START END rescue a lost partition near START and END
COMMANDS LIST FOR FUSE EXT2 FREE
Print display the partition table, available devices, free space, all found partitions, or a particular partition Name NUMBER NAME name partition NUMBER as NAME Move NUMBER START END move partition NUMBER Resizepart NUMBER END resize partition NUMBER Mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system Mkpart PART-TYPE START END make a partition Mkfs NUMBER FS-TYPE make a FS-TYPE file system on partition NUMBER Mklabel,mktable LABEL-TYPE create a new disklabel (partition table) Help print general help, or help on COMMAND It has the following commands: align-check TYPE N check partition N for TYPE(min|opt) alignmentĬheck NUMBER do a simple check on the file systemĬp FROM-NUMBER TO-NUMBER copy file system to another partition Given the choice, parted is the program you should prefer. Parted doesn't need an argument (it tries to "guess"), but you should always specify the disk. It has the following commands: Command action The mkfs commands are not interactive.įdisk expects a device (such as /dev/sda) as an argument. The various mkfs programs, if you already have partitions and wish to format.įdisk and parted are interactive, and have help commands, so you can always look for help within the program.