diff options
author | james <james> | 2007-10-16 10:07:49 +0000 |
---|---|---|
committer | james <james> | 2007-10-16 10:07:49 +0000 |
commit | e9f42566d93f4ee49ccbccfd988aba5639fc0623 (patch) | |
tree | f453227fd9a800615404a942b7020e31190be2ba | |
parent | ac1d0021e60483050f93ceb0313d8ff1e9724f59 (diff) | |
download | gpt-e9f42566d93f4ee49ccbccfd988aba5639fc0623.tar.gz gpt-e9f42566d93f4ee49ccbccfd988aba5639fc0623.tar.bz2 gpt-e9f42566d93f4ee49ccbccfd988aba5639fc0623.zip |
*** empty log message ***
-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: |