this might destroy data on the disk, you must either confirm or deny
the write by entering `yes' or `no'. If you enter `yes',
.B cfdisk
-will write the partition table to disk and the tell the kernel to
-re-read the partition table from the disk. The re-reading of the
-partition table works in most cases, but I have seen it fail. Don't
-panic. It will be correct after you reboot the system. In all cases,
-I still recommend rebooting the system -- just to be safe.
+will write the partition table to disk and the tell the kernel to re-read the
+partition table from the disk. The re-reading of the partition table does not
+work in some cases, for example for device-mapper devices. In
+particular case you need to inform kernel about new
+partitions by
+.B partprobe(8),
+.B kpartx(8)
+or reboot the system.
.TP
.I Up Arrow
.TP
3: cannot get geometry; 4: bad partition table on disk.
.SH "SEE ALSO"
.BR fdisk (8),
+.BR sfdisk (8),
.BR mkfs (8),
.BR parted (8),
-.BR sfdisk (8)
+.BR partprobe (8),
+.BR kpartx(8)
.SH BUGS
The current version does not support multiple disks.
.SH AUTHOR
fprintf(stderr, _("Reboot the system to ensure the partition "
"table is correctly updated.\n"));
#endif
-
+
fprintf( stderr, _("\nWARNING: If you have created or modified any\n"
"DOS 6.x partitions, please see the cfdisk manual\n"
"page for additional information.\n") );
{ ESC, N_("Cancel"), N_("Don't create a partition") },
{ 0, NULL, NULL }
};
-
+
c = menuSimple( menuPartType, 0 );
if (toupper(c) == 'P')
num = find_primary();
if (changed)
print_warning(_("Wrote partition table to disk"));
else
- print_warning(_("Wrote partition table, but re-read table failed. Reboot to update table."));
+ print_warning(_("Wrote partition table, but re-read table failed. Run partprobe(8), kpartx(8) or reboot to update table."));
} else
print_warning(_("Wrote partition table to disk"));
{ ESC, N_("Cancel"), N_("Don't print the table") },
{ 0, NULL, NULL }
};
-
+
while (!done)
switch ( toupper(menuSimple( menuFormat, 2)) ) {
case 'R':
.\" and many others.
.SH "SEE ALSO"
.BR cfdisk (8),
+.BR sfdisk (8),
.BR mkfs (8),
.BR parted (8),
-.BR sfdisk (8)
+.BR partprobe (8),
+.BR kpartx (8)
.SH AVAILABILITY
The fdisk command is part of the util-linux-ng package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
/* If sgi_label then don't use get_existing_partition,
let the user select a partition, since get_existing_partition()
only works for Linux like partition tables. */
- if (!sgi_label) {
+ if (!sgi_label) {
i = get_existing_partition(0, partitions);
} else {
i = get_partition(0, partitions);
}
if (i) {
- printf(_("\nWARNING: Re-reading the partition table "
- "failed with error %d: %s.\n"
- "The kernel still uses the old table.\n"
- "The new table will be used "
- "at the next reboot.\n"),
+ printf(_("\nWARNING: Re-reading the partition table failed with error %d: %s.\n"
+ "The kernel still uses the old table. The new table will be used at\n"
+ "the next reboot or after you run partprobe(8) or kpartx(8)\n"),
errno, strerror(errno));
}
* fdisk [-b sectorsize] [-u] device
*
* Options -C, -H, -S set the geometry.
- *
+ *
*/
while ((c = getopt(argc, argv, "b:C:H:lsS:uvV")) != -1) {
switch (c) {
.BR cfdisk (8),
.BR fdisk (8),
.BR mkfs (8),
-.BR parted (8)
+.BR parted (8),
+.BR partprobe (8),
+.BR kpartx (8)
.SH AVAILABILITY
The sfdisk command is part of the util-linux-ng package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
}
static int
-is_blockdev(int fd) {
+is_blockdev(int fd, ) {
struct stat statbuf;
return(fstat(fd, &statbuf) == 0 && S_ISBLK(statbuf.st_mode));
sleep(3); /* superfluous since 1.3.20 */
if (reread_ioctl(fd) && is_blockdev(fd))
- do_warn(_("The command to re-read the partition table failed\n"
- "Reboot your system now, before using mkfs\n"));
+ do_warn(_("The command to re-read the partition table failed.\n"
+ "Run partprobe(8), kpartx(8) or reboot your system now,\n"
+ "before using mkfs\n"));
if (close(fd)) {
perror(dev);
}
}
}
-
+
return 1;
}
pp = outer_extended_partition(ep);
}
fu = pp ? (pp->start + pp->size) / unit : get_disksize(format);
-
+
for(pp = partitions; pp < partitions+pno; pp++)
if (!is_parent(pp, ep) && pp->size > 0
&& pp->start / unit >= start && pp->start / unit < fu)
}
p->p.nr_sects = p->size;
return 1;
-}
+}
/* build the extended partition surrounding a given logical partition */
static int