.sp
.RE
Note, this semantic is not currently supported by udevd for MD and DM devices.
+.PP
+The sfdisk prompt is only a hint for users and a displayed partition number does
+not mean that the same partition table entry will be created (if -N not
+specified), especially for tables with gaps.
.SH COMMANDS
The commands are mutually exclusive.
.TP
.BR \-a , " \-\-append"
Don't create a new partition table, but only append the specified partitions.
+.sp
+Note that unused partition maybe be re-used in this case although it is not the
+last partition in the partition table. See also \fB\-N\fR to specify entry in
+the partition table.
.TP
.BR \-b , " \-\-backup"
Back up the current partition table sectors before starting the partitioning.
nparts = fdisk_get_npartitions(sf->cxt);
for (i = 0; i < nparts; i++) {
+
+ if (!fdisk_is_partition_used(sf->cxt, i)) {
+ sf->unused = 1;
+ continue;
+ }
if (fdisk_get_partition(sf->cxt, i, &pa) != 0)
continue;
- if (!fdisk_partition_is_used(pa))
- sf->unused = 1;
if (fdisk_partition_is_container(pa))
sf->container = 1;
}
if (created
&& partno < 0
&& next_partno == fdisk_get_npartitions(sf->cxt)
- && has_container_or_unused(sf)) {
+ && !has_container_or_unused(sf)) {
fdisk_info(sf->cxt, _("All partitions used."));
rc = SFDISK_DONE_ASK;
break;
<removed>2: Ignoring partition.
<removed>3: Created a new <removed>.
<removed>4: Ignoring partition.
-All partitions used.
+<removed>5: Done.
New situation:
Disklabel type: dos
<removed>2: Ignoring partition.
<removed>3: Ignoring partition.
<removed>4: Ignoring partition.
-All partitions used.
+<removed>5: Done.
New situation:
Disklabel type: dos