The default value of
.I start
is the first non-assigned sector aligned according to device I/O limits.
-The default start offset for the first partition is 1 MiB.
+The default start offset for the first partition is 1 MiB. The offset may
+be may be followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB,
+EiB, ZiB and YiB) then the number is interpreted as offset in bytes.
.sp
The default value of
.I size
.TP
.BI start= number
The first non-assigned sector aligned according to device I/O limits. The default
-start offset for the first partition is 1 MiB.
+start offset for the first partition is 1 MiB. The offset may be followed by
+the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then
+the number is interpreted as offset in bytes.
.TP
.BI size= number
Specify the partition size in sectors. The number may be followed by the multiplicative
fputs(_(" <start>, <size>, <typy>, <bootable>\n"), stdout);
fputc('\n', stdout);
- fputs(_(" <start> begin of the partition in sectors. The default is the first\n"
- " free space.\n"), stdout);
+ fputs(_(" <start> begin of the partition in sectors or bytes if specified\n"
+ " in format <number>{K,M,G,T,P,E,Z,Y}. The default is\n"
+ " the first free space.\n"), stdout);
fputc('\n', stdout);
fputs(_(" <size> size of the partition in sectors if specified in format\n"
p = (char *) skip_blank(p);
if (!strncasecmp(p, "start=", 6)) {
+ int pow = 0;
p += 6;
- rc = next_number(&p, &num, NULL);
+ rc = next_number(&p, &num, &pow);
if (!rc) {
+ if (pow) /* specified as <num><suffix> */
+ num /= dp->cxt->sector_size;
fdisk_partition_set_start(pa, num);
fdisk_partition_start_follow_default(pa, 0);
}
if (*p == ',' || *p == ';')
fdisk_partition_start_follow_default(pa, 1);
else {
- rc = next_number(&p, &num, NULL);
- if (!rc)
+ int pow = 0;
+ rc = next_number(&p, &num, &pow);
+ if (!rc) {
+ if (pow) /* specified as <num><suffix> */
+ num /= dp->cxt->sector_size;
fdisk_partition_set_start(pa, num);
+ }
fdisk_partition_start_follow_default(pa, 0);
}
break;