Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
SmartSetup Scripting Toolkit Deployment Guide: HP Integrity Servers with Linux > Chapter 6 Utilities Reference

parted

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

Synopsis

parted [-v | -i | -s | -h]...

[DEVICE [COMMAND [PARAMETER]...] ...]

Description

The parted utility manages disk partitions. It allows you to make a GPT partition table and to create all the partitions needed. It is also able to create hidden partitions and change the partition GUID to HPSP, SWAP, LINUX and ESP.

Table 6-22 Options

Option

Description

-v

Displays the version.

-i

Where necessary, prompts for user intervention.

-s

Never prompts for user intervention.

-h

Displays this help message.

 

Examples

The following examples illustrate the use of parted:

  • To check the file system:

    check MINOR

  • To copy a file system to another partition:

    cp [FROM-DEVICE] FROM-MINOR TO-MINOR

  • To print general help, or help on COMMAND:

    help [COMMAND]

  • To create a new disk label (partition table):

    mklabel PARTITION_TYPE

    The supported values for PARTITION_TYPE are: gpt, bsd, mac, dvh, msdos, pc98, sun, amiga, loop

  • To make a file system FTYPE on partition MINOR:

    mkfs MINOR FTYPE

    FTYPE is file system type: fat16, fat32, ext2 and linux-swap.

  • To create a partition:

    mkpart PTYPE START END

    PTYPE is partition type: primary, logical or extended. For GPT partition table only “primary” is used.

  • To create a partition with a file system:

    mkpartfs PTYPE FTYPE START END

    PTYPE is partition type: primary, logical or extended. For GPT partition table only “primary” is used.

    FTYPE is file system type: fat16, fat32, ext2 and linux-swap.

  • To move a partition MINOR:

    move MINOR START END

  • To name a partition MINOR to NAME:

    name MINOR NAME

  • To display a partition table, or a partition:

    print [MINOR]

  • To exit:

    quit

  • To recovery a lost partition near START and END:

    rescue START END

  • To resize a file system on partition MINOR:

    resize MINOR START END

  • To delete partition MINOR:

    rm MINOR

  • To select the device to edit:

    select DEVICE

  • To change a flag on partition MINOR:

    set <MINOR> <FLAG> <STATE>

    The relevant flags are:

    • - boot : Set ESP Partition GUID

    • - hidden : Hidden partition

    • - hp-service : Set HPSP Partition GUID

    The accepted value to state is “on” or “off”.

  • To create a new GPT partition table in /dev/sda device:

    parted -s /dev/sda mklabel gpt

  • To create a partition with 100 MB, starting in LBA 0 and finalizing in LBA 100 in /dev/cciss/c0d0 device:

    parted -s /dev/cciss/c0d0 mkpart 0 100

  • To set the ESP partition GUID in the first partition on the table:

    parted -s /dev/cciss/c0d0 set 1 boot on

  • To set the name of the second partition of the /dev/cciss/c0d0 partition table to “HP Service Partition” use:

    parted -s /dev/sda name 2 “HP Service Partition”

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2007–2008 Hewlett-Packard Development Company, L.P.