| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
This fixes some missing commands in the parted.texi file used to
generate the web manual and info document. It also removes documentation
for the never-implemented 'print NUMBER' command which only returns 1.
The parted manpage has been updated to document the available print
options, disk_set, and disk_toggle commands.
|
| |
|
|
|
|
|
|
|
| |
When no flag is set on a GPT partition the GUID should fall back to the
filesystem type for fat32, swap, and hfs+ and if no filesystem is found
it should default to linux filesystem data type, showing no filesystem
and no flags.
|
| |
|
|
|
|
|
|
|
| |
This sets the partition GUID to the linux home type:
933AC7E1-2EB4-4F13-B844-0E14E2AEF915
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
| |
Drop the 14 flags from _GPTPartitionData that correspond to a
partition type/uuid. Use the type/uuid directly instead.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
| |
Keep GUID specific attributes when writing GPT.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
| |
We have to tell both the device for the drive itself, it case it
implements the partitioned devices, and tell the partition devices
to go away, in case they are implemented on their own by using parted.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
| |
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
| |
We have always had an 's' to separate drive number from partition
number.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This outputs the disk's details as a JSON object. eg. a disk image with
a single partition from 1M to 100M:
{
"disk": {
"path": "/root/disk1.img",
"size": "2097152s",
"model": "",
"transport": "file",
"logical-sector-size": 512,
"physical-sector-size": 512,
"label": "gpt",
"max-partitions": 128,
"partitions": [
{
"number": 0,
"start": "34s",
"end": "2047s",
"size": "2014s",
"type": "free"
},{
"number": 1,
"start": "2048s",
"end": "200703s",
"size": "198656s",
"type": "primary",
"name": "root"
},{
"number": 0,
"start": "200704s",
"end": "2097118s",
"size": "1896415s",
"type": "free"
}
]
}
}
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it possible to pass an empty string in script mode e.g. to
set no partition name (on GPT):
parted -s ./disk.img mklabel gpt mkpart '""' ext2 1 100M
Includes a new test for this feature.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This sets the libdevmapper retry remove flag, which will retry a remove
command if it is BUSY.
parted already has it's own BUSY retry code, but when run with
device-mapper an error can be printed by libdevmapper which can be
confusing to the user.
Resolves: rhbz#1980697
|
|
|
|
|
|
|
| |
The device path, device model, and partition name could all contain
colons or backslashes. This escapes all of these with a backslash.
Thanks to Arvin Schnell for the patch.
|
|
|
|
|
|
|
|
|
| |
t1100-busy-label.sh and t1101-busy-partition.sh create and mount VFAT
partitions, so check for both the tools and the kernel support.
Fixes bug#49594.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some tests need both the file system tools (eg mkfs.vfat) and kernel
support (eg vfat kernel module) to pass.
There are already helpers such as require_fat_ which check for mkfs.vfat,
but if the kernel doesn't support the filesystem then mounting the disk
image will fail.
Add require_filesystem_, which checks for either the filesystem name in
/proc/filesystems (so it's built-in, or already loaded) or if the name
is a valid module (so can be loaded on demand).
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
| |
require_64_bit_ in t-lib-helpers.sh has a hard-coded list of uname
machines that are 64-bit, so add aarch64 and mips64 to cover the major
architectures.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Previously you had to set the filesystem type to one of the linux-swap
options at creation time. With this change you can now toggle the
partition swap type using the 'swap' partition flag in the same way that
you can on gpt disklabels.
Thanks to Arvin Schnell for this patch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding enums together doesn't create a new enum value, so when compiling
with warnings you will get warnings like:
warning: case value ‘96’ not in enumerated type
for PED_EXCEPTION_IGNORE_CANCEL
This moved the defines into the enum as new values so that they are
recognized as valid members of the enum with the values staying the
same.
NOTE: PED_EXCEPTION_OPTION_LAST *MUST* be the last of the individual
options, not the combined options.
Thanks to D. Hugh Redelmeier for this patch.
|
| |
|
|
|
|
|
|
|
| |
Previously the whole test would be skipped if either mkfs.hfs or
mkfs.vfat were not installed, leading to missing test coverage. This
change checks for them individually so that the test will run with
either or both of them installed
|
|
|
|
|
| |
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
|
|
|
|
|
| |
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
|
|
|
|
|
|
|
|
| |
FAT32 needs a minimum partition size of 256MB so this is as small as we
can make it.
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
|
|
|
|
|
| |
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
|
|
|
|
|
| |
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
|
|
|
|
|
| |
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
|
|
|
|
|
| |
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
|
|
|
|
|
| |
and clean up the usage a little bit by giving it a proper name and
removing the file when finished.
|
|
|
|
|
|
| |
mkswap gets stuck, in some situations, when operating on a file full of
holes (see https://bugzilla.redhat.com/show_bug.cgi?id=1971877) so work
around that by using /dev/zero instead of /dev/null
|
|
|
|
|
| |
_generate_header() can return with 1 after allocating gpt so it needs to
be freed in the error path.
|
|
|
|
|
|
| |
When the Atari table is empty it copies 'PARTEDATARI' into the id, and
the start and size bytes. This can be confusion, so turn it into a
union of the string and the non-empty values.
|
| |
|
|
|
|
| |
str_list_create calls gettext_to_wchar which makes a copy of it.
|
| |
|
| |
|
| |
|
|
|
|
| |
In theory open() could return 0 so the correct error value is -1.
|
|
|
|
|
|
|
|
|
| |
Add sun, atari, mac, and pc98 to the disklabels that we test
ped_disk_duplicate on.
aix isn't included because it doesn't support adding partitions.
dvh doesn't support boot partition
loop cannot be partitioned
|
|
|
|
|
|
| |
Increase it from 8MiB to 32MiB and start the first partition at 2048
sector boundary instead of 32 so that no matter the sector size it will
be aligned.
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes fails with:
```
+ mkfs.ext3 /dev/sda15
mke2fs 1.45.5 (07-Jan-2020)
/dev/sda15: Not enough space to build proposed filesystem while setting up superblock
```
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mkfs.ext3 (see version below) was complaining that the filesystem is too small
for a journal, which made the test fail.
```
$ mkfs.ext3 -V
mke2fs 1.45.5 (07-Jan-2020)
Using EXT2FS Library version 1.45.5
```
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
| |
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
| |
Also fix copyright year, to please `make syntax-check`.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use-case: VMs are booted from images that are smaller than their virtual
disk. This means that -- almost by definition -- the secondary GPT
header will be "misplaced", i.e., not at the end of the virtual disk.
Without this patch, parted cannot be used for custom/exotic partitioning
when the VM boots (e.g., in cloud-init's `bootcmd`). Specifically, it
will fail as follows:
```
$ sudo parted --script /dev/vda "mkpart 2 10GB -1"
Warning: Not all of the space available to /dev/vda appears to be used,
you can fix the GPT to use all of the space (an extra 500 blocks) or continue with the current setting?
Error: Unable to satisfy all constraints on the partition.
```
This happens because, in script mode, exceptions are usually not
resolved.
This patch adds `--fix`. This allows exceptions to be automatically
resolved with Fix. As a result, the following command will work:
```
$ sudo parted --fix --script /dev/vda "mkpart 2 10GB -1"
```
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
| |
gnulib redefines free using #define, causing problems with the
pt-common.h file. Work around that by including standard header files as
suggested by gnulib maintainer:
https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00315.html
|
| |
|
| |
|
|
|
|
|
|
| |
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
|