LastLBA is only present for GPT table

Signed-off-by: Guillaume Rose <guillaume.rose@docker.com>
This commit is contained in:
Guillaume Rose 2019-06-08 22:52:25 +02:00
parent 65f3d9bcc1
commit 518220ee44

View File

@ -83,7 +83,7 @@ func extend(d, fsType string) error {
return fmt.Errorf("Partition 1 on disk %s is not a Linux Partition", d)
}
if partition.Start+partition.Size == f.PartitionTable.LastLBA {
if f.PartitionTable.Label == "gpt" && partition.Start+partition.Size == f.PartitionTable.LastLBA {
log.Printf("No free space on device to extend partition")
return nil
}