summaryrefslogtreecommitdiffstats
path: root/sbin/gpt/migrate.c
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/migrate.c
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/migrate.c')
-rw-r--r--sbin/gpt/migrate.c53
1 files changed, 24 insertions, 29 deletions
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