summaryrefslogtreecommitdiffstats
path: root/sbin/gpt
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-10-31 02:20:17 +0000
committermarcel <marcel@FreeBSD.org>2004-10-31 02:20:17 +0000
commit6972147914e4379cbbfd982d450f55afcdb2044e (patch)
treec7775d5aeb40dc04e91d04992e10e3435f25010b /sbin/gpt
parente0e7753e228f99241dffacc3ea1edcdfeedf7da6 (diff)
downloadFreeBSD-src-6972147914e4379cbbfd982d450f55afcdb2044e.zip
FreeBSD-src-6972147914e4379cbbfd982d450f55afcdb2044e.tar.gz
Remove the -k option to migrate. The option causes gpt(8) to preserve
the MBR after it is migrated to a GPT. While this was useful during the early days when GPT support was under development, it's something that users can use without knowing what they're getting themselves into. The possible harm outweights the marginal usefulness it now has.
Diffstat (limited to 'sbin/gpt')
-rw-r--r--sbin/gpt/gpt.811
-rw-r--r--sbin/gpt/migrate.c53
2 files changed, 25 insertions, 39 deletions
diff --git a/sbin/gpt/gpt.8 b/sbin/gpt/gpt.8
index 49d6132..a96d694 100644
--- a/sbin/gpt/gpt.8
+++ b/sbin/gpt/gpt.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 7, 2004
+.Dd October 30, 2004
.Os
.Dt GPT 8
.Sh NAME
@@ -171,7 +171,6 @@ to destroy the table in a way that it can be recovered.
.It Xo
.Nm
.Ic migrate
-.Op Fl k
.Op Fl s
.Ar device ...
.Xc
@@ -181,14 +180,6 @@ command allows the user to migrate an MBR-based disk partitioning into a
GPT-based partitioning.
.Pp
The
-.Fl k
-option instructs
-.Nm
-to not destroy the current MBR.
-This option is primarily useful for debugging and should not be used by
-users.
-.Pp
-The
.Fl s
option prevents migrating
.Bx
diff --git a/sbin/gpt/migrate.c b/sbin/gpt/migrate.c
index 1b438bd..d9f4074 100644
--- a/sbin/gpt/migrate.c
+++ b/sbin/gpt/migrate.c
@@ -51,14 +51,14 @@ __FBSDID("$FreeBSD$");
#define LABELSECTOR 1
#endif
-static int keep, slice;
+static int slice;
static void
usage_migrate(void)
{
fprintf(stderr,
- "usage: %s [-ks] device\n", getprogname());
+ "usage: %s [-s] device\n", getprogname());
exit(1);
}
@@ -299,30 +299,28 @@ migrate(int fd)
gpt_write(fd, lbt);
gpt_write(fd, tpg);
- if (!keep) {
- map = map_find(MAP_TYPE_MBR);
- mbr = map->map_data;
- /*
- * Turn the MBR into a Protective MBR.
- */
- bzero(mbr->mbr_part, sizeof(mbr->mbr_part));
- mbr->mbr_part[0].part_shd = 0xff;
- mbr->mbr_part[0].part_ssect = 0xff;
- mbr->mbr_part[0].part_scyl = 0xff;
- mbr->mbr_part[0].part_typ = 0xee;
- mbr->mbr_part[0].part_ehd = 0xff;
- mbr->mbr_part[0].part_esect = 0xff;
- mbr->mbr_part[0].part_ecyl = 0xff;
- mbr->mbr_part[0].part_start_lo = htole16(1);
- if (mediasz > 0xffffffff) {
- mbr->mbr_part[0].part_size_lo = htole16(0xffff);
- mbr->mbr_part[0].part_size_hi = htole16(0xffff);
- } else {
- mbr->mbr_part[0].part_size_lo = htole16(mediasz);
- mbr->mbr_part[0].part_size_hi = htole16(mediasz >> 16);
- }
- gpt_write(fd, map);
+ map = map_find(MAP_TYPE_MBR);
+ mbr = map->map_data;
+ /*
+ * Turn the MBR into a Protective MBR.
+ */
+ bzero(mbr->mbr_part, sizeof(mbr->mbr_part));
+ mbr->mbr_part[0].part_shd = 0xff;
+ mbr->mbr_part[0].part_ssect = 0xff;
+ mbr->mbr_part[0].part_scyl = 0xff;
+ mbr->mbr_part[0].part_typ = 0xee;
+ mbr->mbr_part[0].part_ehd = 0xff;
+ mbr->mbr_part[0].part_esect = 0xff;
+ mbr->mbr_part[0].part_ecyl = 0xff;
+ mbr->mbr_part[0].part_start_lo = htole16(1);
+ if (mediasz > 0xffffffff) {
+ mbr->mbr_part[0].part_size_lo = htole16(0xffff);
+ mbr->mbr_part[0].part_size_hi = htole16(0xffff);
+ } else {
+ mbr->mbr_part[0].part_size_lo = htole16(mediasz);
+ mbr->mbr_part[0].part_size_hi = htole16(mediasz >> 16);
}
+ gpt_write(fd, map);
}
int
@@ -331,11 +329,8 @@ cmd_migrate(int argc, char *argv[])
int ch, fd;
/* Get the migrate options */
- while ((ch = getopt(argc, argv, "ks")) != -1) {
+ while ((ch = getopt(argc, argv, "s")) != -1) {
switch(ch) {
- case 'k':
- keep = 1;
- break;
case 's':
slice = 1;
break;
OpenPOWER on IntegriCloud