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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. Beginner’s Guide to LVM (Logical Volume Management)
  2. LVM Commands Fail With “Failed to load config file /etc/lvm/lvm.conf”
  3. How to Connect Remote Host Using the ssh Command
  4. Unable To Extend LVM File System with Associated Snapshot in CentOS/RHEL
  5. Understanding SELinux Policies in Linux
  6. journalctl Command Examples in Linux
  7. tune2fs: command not found
  8. dm-tool: command not found
  9. How to disable lvmetad in CentOS/RHEL
  10. CentOS / RHEL : How to find which user run a specific command?

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright