@@ -476,20 +476,40 @@ pub fn list_partitions(
476476 let normalized_pt = normalize_pt_type ( pt_type) ;
477477 let whole_size = whole. size ( ) . map ( format_partition_size) . unwrap_or_default ( ) ;
478478 * entry. scheme_mut ( ) = format ! (
479- " 0: {:>26} {:<23} {:<10} {}" ,
479+ " 0: {:>26} {:<22} + {:<10} {}" ,
480480 normalized_pt, "" , whole_size, image_name,
481481 ) ;
482- for ( i, dev ) in probe_devs[ 1 ..] . iter ( ) . enumerate ( ) {
483- let fs_type = dev . fs_type ( ) . unwrap_or ( "" ) ;
482+ for ( i, dev_info ) in probe_devs[ 1 ..] . iter ( ) . enumerate ( ) {
483+ let fs_type = dev_info . fs_type ( ) . unwrap_or ( "" ) ;
484484
485485 // Filter by filesystem type to match diskutil behavior
486486 if !filter. fs_types . iter ( ) . any ( |t| t == & fs_type) {
487487 continue ;
488488 }
489489
490- let label = dev. label ( ) . unwrap_or ( "" ) ;
490+ let is_enc = fs_type == "crypto_LUKS" || fs_type == "BitLocker" ;
491+ let is_raid = fs_type == "linux_raid_member" ;
492+ let is_lvm = fs_type == "LVM2_member" ;
493+
494+ if is_raid {
495+ assemble_raid = true ;
496+ }
497+
498+ if is_lvm || is_raid || ( enc_partitions. is_some ( ) && is_enc) {
499+ pv_dev_infos. push ( dev_info. to_owned ( ) ) ;
500+ pv_dev_idents. push ( image_name. clone ( ) ) ;
501+
502+ if decrypt_all && is_enc {
503+ all_enc_partitions. push ( path. to_owned ( ) ) ;
504+ }
505+ }
506+
507+ let label = dev_info. label ( ) . unwrap_or ( "" ) ;
491508 let truncated_label = trunc_with_ellipsis ( label, 23 ) ;
492- let size_str = dev. size ( ) . map ( format_partition_size) . unwrap_or_default ( ) ;
509+ let size_str = dev_info
510+ . size ( )
511+ . map ( format_partition_size)
512+ . unwrap_or_default ( ) ;
493513 let ident = format ! ( "{}@s{}" , image_name, i + 1 ) ;
494514 entry. partitions_mut ( ) . push ( format ! (
495515 "{:>4}: {:>26} {:<23} {:<10} {}" ,
@@ -502,13 +522,27 @@ pub fn list_partitions(
502522 }
503523 } else {
504524 // Whole-disk image without partition table
505- let fs_type = whole. fs_type ( ) . unwrap_or ( "" ) ;
525+ let dev_info = whole;
526+ let fs_type = dev_info. fs_type ( ) . unwrap_or ( "" ) ;
506527
507528 // Filter by filesystem type to match diskutil behavior
508529 if filter. fs_types . iter ( ) . any ( |t| t == & fs_type) {
509- let label = whole. label ( ) . unwrap_or ( "" ) ;
530+ let is_enc = fs_type == "crypto_LUKS" || fs_type == "BitLocker" ;
531+ if fs_type == "LVM2_member" || ( enc_partitions. is_some ( ) && is_enc) {
532+ pv_dev_infos. push ( dev_info. clone ( ) ) ;
533+ pv_dev_idents. push ( image_name. clone ( ) ) ;
534+
535+ if decrypt_all && is_enc {
536+ all_enc_partitions. push ( path. to_owned ( ) ) ;
537+ }
538+ }
539+
540+ let label = dev_info. label ( ) . unwrap_or ( "" ) ;
510541 let truncated_label = trunc_with_ellipsis ( label, 23 ) ;
511- let size_str = whole. size ( ) . map ( format_partition_size) . unwrap_or_default ( ) ;
542+ let size_str = dev_info
543+ . size ( )
544+ . map ( format_partition_size)
545+ . unwrap_or_default ( ) ;
512546 entry. partitions_mut ( ) . push ( format ! (
513547 " 0: {:>26} {:<23} {:<10} {}" ,
514548 fs_type, truncated_label, size_str, image_name,
0 commit comments