mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-15 06:45:27 +00:00
api: disks: only return UUID of partitions if it actually is one
Some filesystems like FAT don't include a concept of UUIDs. Instead, tools like blkid tools like blkid derive these identifiers based on certain filesystem metadata, such as volume serial numbers or other unique information. This does however not follow the format specified in RFC 9562[1]. [1] https://datatracker.ietf.org/doc/html/rfc9562 Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
parent
18d4c4fc35
commit
09155de386
@ -898,7 +898,10 @@ fn get_partitions_info(
|
|||||||
let mut uuid = None;
|
let mut uuid = None;
|
||||||
if let Some(devpath) = devpath.as_ref() {
|
if let Some(devpath) = devpath.as_ref() {
|
||||||
for info in lsblk_infos.iter().filter(|i| i.path.eq(devpath)) {
|
for info in lsblk_infos.iter().filter(|i| i.path.eq(devpath)) {
|
||||||
uuid = info.uuid.clone();
|
uuid = info
|
||||||
|
.uuid
|
||||||
|
.clone()
|
||||||
|
.filter(|uuid| pbs_api_types::UUID_REGEX.is_match(uuid));
|
||||||
used = match info.partition_type.as_deref() {
|
used = match info.partition_type.as_deref() {
|
||||||
Some("21686148-6449-6e6f-744e-656564454649") => PartitionUsageType::BIOS,
|
Some("21686148-6449-6e6f-744e-656564454649") => PartitionUsageType::BIOS,
|
||||||
Some("c12a7328-f81f-11d2-ba4b-00a0c93ec93b") => PartitionUsageType::EFI,
|
Some("c12a7328-f81f-11d2-ba4b-00a0c93ec93b") => PartitionUsageType::EFI,
|
||||||
|
Loading…
Reference in New Issue
Block a user