summaryrefslogtreecommitdiff
path: root/cgpt/cgpt_show.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgpt/cgpt_show.c')
-rw-r--r--cgpt/cgpt_show.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/cgpt/cgpt_show.c b/cgpt/cgpt_show.c
index af4d88fa..0a956130 100644
--- a/cgpt/cgpt_show.c
+++ b/cgpt/cgpt_show.c
@@ -73,7 +73,7 @@ static void HeaderDetails(GptHeader *header, GptEntry *entries,
PrintSignature(indent, header->signature, sizeof(header->signature), raw);
printf("%sRev: 0x%08x\n", indent, header->revision);
- printf("%sSize: %d\n", indent, header->size);
+ printf("%sSize: %d (blocks)\n", indent, header->size);
printf("%sHeader CRC: 0x%08x %s\n", indent, header->header_crc32,
(HeaderCrc(header) != header->header_crc32) ? "(INVALID)" : "");
printf("%sMy LBA: %lld\n", indent, (long long)header->my_lba);
@@ -269,6 +269,23 @@ static int GptShow(struct drive *drive, CgptShowParams *params) {
} else { // show all partitions
GptEntry *entries;
+ if (params->debug || params->verbose) {
+ printf("Drive details:\n");
+ printf(" Total Size (bytes): %" PRIu64 "\n", drive->size);
+ printf(" LBA Size (bytes): %d\n", drive->gpt.sector_bytes);
+ if (drive->gpt.flags & GPT_FLAG_EXTERNAL) {
+ printf(" Drive (where GPT lives) Size (blocks): %" PRIu64 "\n",
+ drive->gpt.gpt_drive_sectors);
+ printf(" Drive (where partitions live) Size (blocks): %" PRIu64 "\n",
+ drive->gpt.streaming_drive_sectors);
+ } else {
+ // We know gpt_drive_sectors == streaming_drive_sectors here.
+ printf(" Drive Size (blocks): %" PRIu64 "\n",
+ drive->gpt.gpt_drive_sectors);
+ }
+ printf("\n");
+ }
+
if (CGPT_OK != ReadPMBR(drive)) {
Error("Unable to read PMBR\n");
return CGPT_FAILED;