diff options
-rw-r--r-- | src/gpt.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -6,10 +6,13 @@ * */ -static char rcsid[] = "$Id: gpt.c,v 1.6 2007/09/10 11:23:08 root Exp $"; +static char rcsid[] = "$Id: gpt.c,v 1.7 2007/10/16 10:07:49 james Exp $"; /* * $Log: gpt.c,v $ + * Revision 1.7 2007/10/16 10:07:49 james + * *** empty log message *** + * * Revision 1.6 2007/09/10 11:23:08 root * *** empty log message *** * @@ -41,7 +44,9 @@ fprintf(stderr, " on the disk\n" " the last usable sector on the disk\n" "gpt -d disk-device -e print the address of the sector after the\n" -" the last usable sector on the disk\n" +" the last addressable sector on the disk\n" +"gpt -d disk-device -u print the address of the last sector\n" +" usable in a partition\n" "gpt -d disk-device -f n print the lba of sector immediately after\n" " the end of parition n\n" "gpt -d disk-device -n write a new blank parition table to the disk\n" @@ -87,6 +92,11 @@ main (int argc, char *argv[]) h=headers_get(d); printf("%lld\n",(long long) h.header.first_usable_lba); return 0; + case 'u': + if (!d) usage(); + h=headers_get(d); + printf("%lld\n",(long long) h.header.last_usable_lba); + break; case 'f': h=headers_get(d); n=atoi(optarg); @@ -94,12 +104,14 @@ main (int argc, char *argv[]) printf("%lld\n",e.end); return 0; case 'n': + if (!d) usage(); new(d); return 0; case 'a': aflag++; break; case 'l': + if (!d) usage(); show(d); return 0; default: |