A disk partitioning and partition resizing program.
Questions tagged [parted]
251 questions
57
votes
10 answers
Auto expand last partition to use all unallocated space, using parted in batch mode
Long story short, I need to perform this all automatically on boot (embedded system).
Our engineers will flash images to production devices. These images will contain a small partition table. On boot, I need to automatically expand the last…

Paul Knopf
- 1,231
42
votes
3 answers
Set Bootable Partition Command Line
How to I set the bootable partition using the command line in parted?
Ideally I would like a numbered list so I can select which partition to boot from easily.

William
- 1,061
21
votes
2 answers
how to create a partition in free space using GNU Parted
Below is my hard disk shown in gnu parted:
(parted) print free
Model: ATA HGST HTS541075A9 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number …

sps
- 1,436
6
votes
3 answers
how to make parted to print size in MiB size instead of MB
We are using am335x based custom board, we have eMMC as secondary storage device. Now to list partitions we are using parted utility but parted prints partition sizes in the MB instead of MiB.
Is there any way to ask parted to print partition sizes…

ART
- 1,131
5
votes
2 answers
parted: invalid token: swap
I'm tring to add flag swap with parted but got invalid token,why?
Model: Kingston DataTraveler 3.0 (scsi)
Disk /dev/sda: 15.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type …

Issac Young
- 53
4
votes
1 answer
Can I use parted resize for partitions used by mdadm
I have upgraded 3Tb drives in my RAID-5 to 5Tb one by one with same partitioning. I want to grow each of the partitions (at the end of the disc) to take the extra 2Tb.
I looked at parted resize but it is expecting a filesystem on the partition (and…

user109830
- 45
3
votes
1 answer
Parted output with two free space rows
I have a disk with the following partitions:
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: ATA VBOX HARDDISK…

Vombat
- 12,884
2
votes
1 answer
How to restore the partition layout for GPT disk
parted -ms /dev/sda print > sda.parted
This actually copies the layout to a file. If I want to restore the layout, what command should I give?

venkatesh
- 21
2
votes
1 answer
Creating partition using parted instead of fdisk
I have a script which uses the following command to add a partition to /dev/sda
cat <<-EOF |fdisk /dev/sda
n …

Vombat
- 12,884
2
votes
1 answer
If old MBR is used and there are already 3 primary partitions, how can I create two more partitions with "parted"?
Using a RHEL7 machine, without GPT, I can see 3 primary partitions on a disk. The disk still has free space in the end.
Question:
How can I create 2 more partitions, a 512 MByte one, and a 1 GByte one? The last partition is at ex.: 13.7G ?
If I…

LoukiosValentine79
- 1,499
1
vote
1 answer
Why does `parted` accept "xfspart" argument as valid `part-type`?
The Azure tutorial Use the portal to attach a data disk to a Linux VM shows the following command to prepare a disk:
sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100%
Looked at the parted man page to make sure what I'm doing, and…

toraritte
- 1,080
1
vote
1 answer
Are parted's end positions inclusive or exclusive
When creating partitions with parted, and when printing them back out, I was curious if the value for 'end' is inclusive or exclusive? Asked another way, is the second named in 'end' the last sector of the named partition or the first available…

Huckle
- 1,005
1
vote
0 answers
Why increase the size by 2B when adding only one?
Software parted takes automatically size of sector (512B for GPT).
I enter exact size to MB, but I can't create swap partition with exact size.
mkpart swap linux-swap 15.5GB 17013
print
Number Start End Size File system Name …

J. Doe
- 11
1
vote
1 answer
parted mkpart is fs-type required
I am running this line:
parted -s ${drive} -- mklabel msdos \
mkpart primary 0% 100%
and then formatting with vfat but my question is do i need to specify fs-type if just making it msdos ?

cesar
- 577
1
vote
0 answers
parted with "free" option, results in invalid token in some cases
when parted with "free" option is run when there is unallocated space at end of the disk (not consumed by partition), I get this error..
[root@sprintlab423vm4 ~]# parted /dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:1:0 unit MB print free
Error: The…

nkshirsa
- 46