A disk partitioning and partition resizing program.
Questions tagged [parted]
245 questions
52
votes
8 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,151
- 2
- 13
- 25
41
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,041
- 1
- 8
- 21
39
votes
5 answers
Remove GPT - Default back to MBR
I keep receiving this error:
Warning!! Unsupported GPT (GUID Partition Table) detected. Use GNU Parted
I want to go back to the normal MBR. I found some advice here and did:
parted /dev/sda
mklabel msdos
quit
But when I get to the mklabel option…
sayth
- 579
- 1
- 4
- 7
35
votes
4 answers
fdisk vs parted
I've been running a small media server at home for 10+ years and looking into replacing it (before it breaks).
I intend to hook up a new drive to my old system, partition and format (ext4 seems most stable right now) and copy the media over to the…
Ted
- 353
- 1
- 3
- 4
24
votes
2 answers
Scripteable GPT partitions using parted
I am partitioning eMMC using following commands in the script,
parted /dev/mmcblk0 --script mklabel gpt
parted /dev/mmcblk0 --script mkpart primary ext4 32MB 132MB
parted /dev/mmcblk0 --script mkpart primary ext4 233MB 433MB
parted /dev/mmcblk0…
ART
- 1,111
- 3
- 20
- 35
19
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,396
- 5
- 15
- 23
14
votes
1 answer
df not recognizing partition being resized?
I've got Ubuntu 18.04 Server in Virtual Box, and once I've ran out of 10 GB of allocated space on virtual disk, I've increased the size of the virtual disk to 17 GB and resized the root partition with parted's resizepart command (and done so while…
Sergiy Kolodyazhnyy
- 16,187
- 11
- 53
- 104
12
votes
1 answer
Create partition with exact size not to specific distance
How does one create a partition of exact size not to specific distance?
I have tried:
parted -a optimal /dev/sdd mkpart primary 0% 0%+1GB
# and...
parted -a optimal /dev/sdd mkpart primary 0% +1GB
To no avail.
How do I make it accept size instead…
tomsseisums
- 417
- 1
- 5
- 13
12
votes
1 answer
How does partprobe work?
I was looking for a way to refresh the scsi bus (or any other bus, for that matter) that would allow my kernel ( 2.6.18-194-el5 on CentOS 5.5) to know about the partitions on a drive, and I couldn't find a way. partprobe did it instantly. How?…
Matt Simmons
- 1,040
- 8
- 14
11
votes
3 answers
Remove all traces of GPT disk label
I've got an USB pen drive and I'd like to turn it into a bootable MBR device. However, at some point in its history, that device had a GPT on it, and I can't seem to get rid of that. Even after I ran mklabel dos in parted, grub-install still…
MvG
- 4,361
- 2
- 28
- 42
10
votes
2 answers
Programmatically partition disk
I am attempting to create a bash script which will create a new partition with a file system on a disk with existing partition(s).
It looks like it's easy to create partitions programmatically with parted, however it requires you to know where to…
Alex
- 307
- 2
- 5
- 14
10
votes
4 answers
Expanding a disk with a GPT table
I'm running a CentOS 7 VM, where I have a second disk (sdb), which I need to expand often. After expanding the disk and I open 'parted' so that I can create a new partition, the following error message is returned:
Error: The backup GPT table is…
Alex Y
- 101
- 1
- 1
- 4
10
votes
4 answers
How to run mkfs on file image partitions without mounting?
I am creating an empty file...
dd if=/dev/zero of=${SDCARD} bs=1 count=0 seek=$(expr 1024 \* ${SDCARD_SIZE})
...then turning it into an drive image...
parted -s ${SDCARD} mklabel msdos
...and creating partitions on it
parted -s ${SDCARD} unit KiB…
Paul Knopf
- 1,151
- 2
- 13
- 25
10
votes
2 answers
Remove filesystem from an unpartitioned disk
I have an un-partitioned 500GB disk with a ext3 fs using the entire disk.
If I make sure there are no partitions on the disk using fdisk or parted, "ssm list" will still show an ext3 fs on the disk (because this file system exists outside of any…
Dan P
- 103
- 1
- 1
- 5
9
votes
2 answers
Why does parted need a filesystem type when creating a partition, and how does its action differ from a utility like mkfs.ext4?
I am partitioning a disk with the intent to have an ext4 filesystem on the partition. I am following a tutorial, which indicates that there are two separate steps where the ext4 filesystem needs to be specified. The first is by parted when…
David M
- 233
- 3
- 6