diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2010-07-06 15:39:51 -0400 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2010-07-06 15:39:51 -0400 |
commit | f9312b0ca9af86f280adad36eb660f6e74720c2c (patch) | |
tree | 198a25ab923423496f490565b9c29f4f50c6169d /sgdisk.cc | |
parent | 61768bccdec0016d3d9757d08e63f9a1386c8bc4 (diff) | |
download | sgdisk-f9312b0ca9af86f280adad36eb660f6e74720c2c.tar.gz |
Tentative support for duplicating one disk's partition table on another
disk.
Diffstat (limited to 'sgdisk.cc')
-rw-r--r-- | sgdisk.cc | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -42,7 +42,7 @@ int main(int argc, char *argv[]) { char *device = NULL; char *newPartInfo = NULL, *typeCode = NULL, *partName = NULL; char *backupFile = NULL, *twoParts = NULL, *hybrids = NULL, *mbrParts; - char *partGUID = NULL, *diskGUID = NULL; + char *partGUID = NULL, *diskGUID = NULL, *outDevice = NULL; PartType typeHelper; poptContext poptCon; @@ -70,6 +70,7 @@ int main(int argc, char *argv[]) { {"print", 'p', POPT_ARG_NONE, NULL, 'p', "print partition table", ""}, {"pretend", 'P', POPT_ARG_NONE, NULL, 'P', "make changes in memory, but don't write them", ""}, {"transpose", 'r', POPT_ARG_STRING, &twoParts, 'r', "transpose two partitions", "partnum:partnum"}, + {"replicate", 'R', POPT_ARG_STRING, &outDevice, 'R', "replicate partition table", "device_filename"}, {"sort", 's', POPT_ARG_NONE, NULL, 's', "sort partition table entries", ""}, {"resize-table", 'S', POPT_ARG_INT, &tableSize, 'S', "resize partition table", "numparts"}, {"typecode", 't', POPT_ARG_STRING, &typeCode, 't', "change partition type code", "partnum:hexcode"}, @@ -143,6 +144,11 @@ int main(int argc, char *argv[]) { } // if/else free(partName); break; + case 'C': + theGPT.JustLooking(0); + theGPT.RecomputeCHS(); + saveData = 1; + break; case 'd': theGPT.JustLooking(0); if (theGPT.DeletePartition(deletePartNum - 1) == 0) { @@ -256,8 +262,7 @@ int main(int argc, char *argv[]) { break; case 'R': theGPT.JustLooking(0); - theGPT.RecomputeCHS(); - saveData = 1; + theGPT.SaveGPTData(1, outDevice); break; case 's': theGPT.JustLooking(0); |