.I /proc/partitions
(if that file exists) are used.
.TP
-\fB\-x\fR, \fB\-\-list-details\fR
+\fB\-x\fR, \fB\-\-list\-details\fR
Like \fB\-\-list\fR, but provides more details.
.TP
+\fB\-n\fR, \fB\-\-noauto\-pt\fR
+Don't automatically create a default partition table on empty device. The partition table
+has to be explicitly created by user (by command like 'o', 'g', etc.).
+.TP
.BR \-o , " \-\-output " \fIlist\fP
Specify which output columns to print. Use
.B \-\-help
fputs(_(" -l, --list display partitions and exit\n"), out);
fputs(_(" -x, --list-details like --list but with more details\n"), out);
+ fputs(_(" -n, --noauto-pt don't create default partition table on empty devices\n"), out);
fputs(_(" -o, --output <list> output columns\n"), out);
fputs(_(" -t, --type <type> recognize specified partition table type only\n"), out);
fputs(_(" -u, --units[=<unit>] display units: 'cylinders' or 'sectors' (default)\n"), out);
int main(int argc, char **argv)
{
- int rc, i, c, act = ACT_FDISK;
+ int rc, i, c, act = ACT_FDISK, noauto_pt = 0;
int colormode = UL_COLORMODE_UNDEF;
struct fdisk_context *cxt;
char *outarg = NULL;
{ "help", no_argument, NULL, 'h' },
{ "list", no_argument, NULL, 'l' },
{ "list-details", no_argument, NULL, 'x' },
+ { "noauto-pt", no_argument, NULL, 'n' },
{ "sector-size", required_argument, NULL, 'b' },
{ "type", required_argument, NULL, 't' },
{ "units", optional_argument, NULL, 'u' },
fdisk_set_ask(cxt, ask_callback, NULL);
- while ((c = getopt_long(argc, argv, "b:Bc::C:hH:lL::o:sS:t:u::vVw:W:x",
+ while ((c = getopt_long(argc, argv, "b:Bc::C:hH:lL::no:sS:t:u::vVw:W:x",
longopts, NULL)) != -1) {
switch (c) {
case 'b':
colormode = colormode_or_err(optarg,
_("unsupported color mode"));
break;
+ case 'n':
+ noauto_pt = 1;
+ break;
case 'o':
outarg = optarg;
break;
if (!fdisk_has_label(cxt)) {
fdisk_info(cxt, _("Device does not contain a recognized partition table."));
- fdisk_create_disklabel(cxt, NULL);
+ if (!noauto_pt)
+ fdisk_create_disklabel(cxt, NULL);
} else if (fdisk_is_label(cxt, GPT) && fdisk_gpt_is_hybrid(cxt))
fdisk_warnx(cxt, _(