• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

parted: command not found

by admin

The GNU parted utility is also used to view the existing partition table, change the size of existing partitions, or add partitions from free space or additional hard drives. This utility is more advanced than the fdisk utility. It supports more disk label types and offers additional commands. parted syntax is:

# parted [option] [device_name] [command [argument]]

Use parted interactively to enter commands one at a time. Include only the device as an argument to invoke interactive mode. Example:

# parted /dev/sda
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)

From the (parted) prompt, enter a command or type help to view the list of available commands. Get additional help on a specific command by typing help plus the command. Example:

parted command help linux

If you encounter below error while running the parted command:

parted: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install parted
Ubuntu apt-get install parted
Alpine apk add parted
Arch Linux pacman -S parted
Kali Linux apt-get install parted
CentOS yum install parted
Fedora dnf install parted
Raspbian apt-get install parted

parted Command Examples

1. List partitions on all block devices:

# parted --list

2. Start interactive mode with the specified disk selected:

# parted /dev/sdX

3. Create a new partition table of the specified label-type:

# parted --script /dev/sdX mklabel aix|amiga|bsd|dvh|gpt|loop|mac|msdos|pc98|sun

4. Show partition information in interactive mode:

print

5. Select a disk in interactive mode:

select /dev/sdX

6. Create a 16 GB partition with the specified filesystem in interactive mode:

mkpart primary|logical|extended btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs 0% 16G

7. Resize a partition in interactive mode:

resizepart /dev/sdXN end_position_of_partition

8. Remove a partition in interactive mode:

rm /dev/sdXN

Filed Under: Linux

Some more articles you might also be interested in …

  1. pacman –query Command Examples
  2. resolvectl Command Examples in Linux
  3. btrfs restore Command Examples in Linux
  4. kubens Command Examples
  5. “hg pull” Command Examples
  6. meson Command Examples
  7. faillog Command Examples in Linux
  8. chsh Command Examples in Linux
  9. mitmdump Command Examples
  10. iptables: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright