diff --git a/providers/os/connection/snapshot/blockdevices.go b/providers/os/connection/snapshot/blockdevices.go index 1e4ae7879..5eaa96a03 100644 --- a/providers/os/connection/snapshot/blockdevices.go +++ b/providers/os/connection/snapshot/blockdevices.go @@ -166,10 +166,13 @@ func (blockEntries BlockDevices) FindDevice(requested string) (BlockDevice, erro func (device BlockDevice) GetMountablePartitions(includeAll bool) ([]*PartitionInfo, error) { log.Debug().Str("device", device.Name).Msg("get partitions for device") - blockDevices := device.Children + blockDevices := &BlockDevices{ + BlockDevices: device.Children, + } // sort the candidates by size, so we can pick the largest one - sortBlockDevicesBySize(blockDevices) + sortBlockDevicesBySize(blockDevices.BlockDevices) + blockDevices.findAliases() filter := func(partition BlockDevice) bool { if partition.FsType == "" { @@ -184,7 +187,7 @@ func (device BlockDevice) GetMountablePartitions(includeAll bool) ([]*PartitionI } partitions := []*PartitionInfo{} - for _, partition := range blockDevices { + for _, partition := range blockDevices.BlockDevices { log.Debug().Str("name", partition.Name).Int64("size", int64(partition.Size)).Msg("checking partition") if filter(partition) { log.Debug().Str("name", partition.Name).Msg("found suitable partition") @@ -192,6 +195,7 @@ func (device BlockDevice) GetMountablePartitions(includeAll bool) ([]*PartitionI partitions = append(partitions, &PartitionInfo{ Name: devFsName, FsType: partition.FsType, Label: partition.Label, Uuid: partition.Uuid, + Aliases: partition.Aliases, }) } else { log.Debug(). diff --git a/providers/os/connection/snapshot/partition.go b/providers/os/connection/snapshot/partition.go index c573dcfc6..60f88ccad 100644 --- a/providers/os/connection/snapshot/partition.go +++ b/providers/os/connection/snapshot/partition.go @@ -11,6 +11,7 @@ type PartitionInfo struct { Name string FsType string + Aliases []string // (optional) Label is the partition label Label string // (optional) UUID is the partition UUID