Scroll to navigation

UNIFY-GPT(1) User Commands UNIFY-GPT(1)

NAME

unify-gpt - Create unified GPT for multiple block sizes.

SYNOPSIS

unify-gpt [OPTIONS] DEVICE|IMAGE

DESCRIPTION

unify-gpt takes a disk device or disk image file with a valid GPT and adds a valid GPT for the specified block size. This allows you to have valid GPTs for multiple block sizes.

The purpose is to be able to prepare disk images suitable for several block sizes.

Once the image is in use, you can remove the extra GPTs using '--normalize'.

Existing partitions are kept. Partitions must be aligned to the requested block size.

You can run unify-gpt several times to support more block sizes.

The additional GPTs need extra space and partitioning tools may notify you that not the entire disk space is used.

Note: since partitioning tools will update only the GPT for a specific block size, your partition setup will get out of sync. Use the '--normalize' option to remove the extra GPTs and keep only a single GPT for the desired block size before running a partitioning tool.

General Options

-l, --list

Show current GPT setup.

-a, --add

Add GPT for the specified block size (default: 4096).

-n, --normalize

Normaize GPT. This removes additional GPTs and keeps only a single GPT. The default block size for block devices is the device block size. The default block size for image files is the smallest block size for which there is a GPT.

-b, --block-size=N

Block size to use. Possible values are 512, 1024, 2048, and 4096.

-e, --entries=N

Create GPT with N partition slots (default: 128). Decrease the value if there is not enough free space on disk. Increase the value if you need more (max 1024).

--verbose

Show more detailed messages. Can be repeated to log even more.

--version

Show unify-gpt version.

--help

Show help text.

Extended Options

--force

If partition ends are not aligned for a new block size, round up. Note that the partition size is only adjusted in the GPT for the requested new block size.

--try

Do everything but do not write changes back to disk.

--overlap

Layout backup GPT so that header blocks overlap. This ensures that the backup GPT header is in the last disk block (default).

--no-overlap

Layout backup GPT so that there is a separate header block for each block size.

--align-1m

Align start of usable space to 1 MiB boundary.

--no-align-1m

Maximize usable space (default).

Notes

•unify-gpt does not create an initial GPT partition table. Use a regular partitioning tool for that.

•unify-gpt keeps the original partition layout. But if you use partitioning tools later on, partitions may get out-of-sync between block sizes or GPTs for the not active block size may get deleted. use the --normalize option to go back to a GPT setup for a single block size.

•When adding a GPT, partitions may not be aligned properly for the new block size. There are two cases:

1.If the partition start is misaligned, unify-gpt will refuse to work.

2.If the partition end is misaligned and there is enough free space after the partition, unify-gpt will offer to align the partition end (round up) if you use the --force option.
Note that the partition end is only changed for this particular block size. The partition layout of GPTs for other block sizes is not adjusted.

•If there is not enough space for multiple GPTs, you can use the --entries option to reduce the number of partition slots (normally 128).

EXAMPLES

Basic use

# add a GPT for 4096 byte blocks to an existing 512 byte block size GPT
unify-gpt --block-size 4096 --add foo.img

# add a GPT for 4096 byte blocks but reduce GPT size in cases
# where the GPT would get too big
unify-gpt --block-size 4096 --add --entries 32 foo.img

# remove all GPTs except the one for the actual block size of /dev/sda
unify-gpt --normalize /dev/sda

Advanced use

# actually, --add and --normalize can be used at the same time;
# the following command will convert a 512 byte block size GPT
# to a 4096 byte block size GPT
unify-gpt --block-size 4096 --add --normalize foo.img

# you can use --normalize to rewrite a GPT to have a different
# number of partition slots
unify-gpt --normalize --entries 1024 foo.img

SEE ALSO

parti(1), fdisk(1), parted(1).

LINKS

•more documentation: /usr/share/doc/packages/parti

•openSUSE Build Service: <https://build.opensuse.org>
2025-05-13 unify-gpt 2.10