Questions tagged [parted]

Questions about the GNU parted (partition editor) CLI utility that is used to manipulate disk partition (and not GParted, GNOME Partition Editor, a graphical tool with similar functionality).

GNU parted is a command line utility for managing partition tables. It uses libparted and provides similar functionality to the graphical tool Gparted.

Parted can be used to write new partition tables and format filesystems when installing new operating systems and also for reorganizing disk usage, copying data and disk imaging.

It can be used interactively (to invoke parted in interactive mode, the user would type parted /dev/sda to begin interactively editing partitions on /dev/sda or in a command line mode suitable for scripting. It supports GUID partition tables, unlike fdisk, and supports at least these filesystems:

ext2/3/4
fat16, fat32
hfs, hfs+, hfsx
linux-swap
NTFS
reiserfs
ufs
btrfs 

Fur detailed guidance, see the user manual

66 questions
26
votes
2 answers

How to open Gparted terminal?

I read this doc of gparted to recover from booting issues when a partition is moved. To test the command grub on gparted terminal, I want to open the terminal but not finding a way from my Ubuntu 13.04. When I run sudo gparted & on my shell…
Ravi
  • 493
11
votes
3 answers

Resizing fat32 partition in command line without losing data

I am trying to resize a fat 32 partition in my linux machine. Following are the specs of the system. This is not a PC hence UI based tools are not applicable. This memory partition which I am trying to resize is already having data in the form of…
10
votes
1 answer

Hard Drive Partition: Optimal Transfer Size

I have a Western Digital 4TB drive (WD40PURZ). It appears that the recommended procedure for partitioning the drive results with: "Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)" warning from the linux…
Mark W.
  • 155
9
votes
1 answer

How to shrink ext4 partition using parted CLI?

I have microSD card with Ubuntu 20.10 for RaspberryPi 4. The microSD card is 32GB in size, however only about 2GB in total is being occupied on it. I would like to clone it onto 16GB microSD card and while I know how to successfully do it using GUI…
ProTofik
  • 469
8
votes
2 answers

How to automatically answer interactive cli program (not script) with bash script?

I've googled this, and almost all I could find is to answer a bash script and this doesn't work for me. The answers I found told to do: echo "yes" | ./script or ./script <<< yes or something like that. It didn't work for me. My guess is that's…
Mas Bagol
  • 1,399
7
votes
2 answers

Create one partition occupying all the space on the drive with gparted?

I am following the instructions here: https://help.ubuntu.com/community/InstallingANewHardDrive It says: 4) Create one partition occupying all the space on the drive: (parted) mkpart primary 0 0 5) Check that the results are correct: (parted)…
User
  • 1,493
3
votes
2 answers

How to use parted in a script, and get a blank PARTLABEL?

I'm trying to create software to restore backups that I already create with scripts. I haven't needed to restore any, fortunately, but now I want to move the contents of one of my backups to a SSD drive, and it turns out it's harder than I…
ForDummies
  • 555
  • 5
  • 16
2
votes
2 answers

How do I create a swap partition using parted?

How do I create a swap partition using command line gparted? (parted) I've managed to create a partition but I can't seem to set the partition to Linux swap / Solaris. I've tried mkpart extended linux-swap -512MB -1s // -> Error: Invalid…
denden
  • 151
2
votes
1 answer

Different print reports between fdisk and parted

long time Linux user, but can't find an answer to this. The makers of parted/gparted completely ignored my question. Some time back in slackware, I'd formatted a 2TB with two ext2 partitions, but when I install either Mint or Ubuntu, gparted sees…
2
votes
2 answers

How to setup a 6TB HD on Ubuntu

I just bought a 6TB HD from WD and I cannot make bigger partitions than 2TB. I looked up in some tutorials like this one, but I still have the problem that fdisk, parted and lsblk display that there are only 2 TB space on the harddisk without…
metty
  • 21
2
votes
2 answers

How to delete the bootable flag of a partition

I can add a bootable flag with the a command of fdisk. How to do the reverse: remove the bootable flag of a partition?
user123456
  • 2,478
2
votes
0 answers

GPT ext4 partition recovery - invalid backup header

When I run from a LiveCD to try to recover a non-booting system, I run gdisk /dev/sda and get Caution: invalid backup GPT header, but valid main header; regenerating backup header from main header. so I think I'm supposed to do r then e but when I…
batflaps
  • 121
2
votes
1 answer

Completely defragmenting a disk

So, my disk is a mess. First I need to mention that it is a NTFS filesystem. So what I want to do is to completely defragment the disk. I want it so that after defragmenting I have continuous empty space left after the last data sector. Is this…
2
votes
2 answers

How to resize a partition of a GPT throught Parted Command line tool. (Using SSH Rescue Env.)

I have a Remote Dedicated Server with no Online control panel to resize partitions after initial OS install, so I am using the debian based rescue environment to manipulate the partitions unmounted. Problem is, I am a bit stupid when it comes to…
2
votes
0 answers

resize root partition from rescue mode

I mean to resize my root partition. I am currently not able to boot from a Live CD or Live USB. I know I can keep trying to tackle that problem. Alternatively, I wanted to know if, booting from my Ubuntu in recovery mode, dropping to a root prompt,…
1
2 3 4 5