diff --git a/src/Dialog_Partition_Info.cc b/src/Dialog_Partition_Info.cc index c2831587..a1ab995c 100644 --- a/src/Dialog_Partition_Info.cc +++ b/src/Dialog_Partition_Info.cc @@ -266,6 +266,14 @@ void Dialog_Partition_Info::Display_Info() */ str_temp = _("Active") ; } + else if ( partition .filesystem == FS_LVM2_PV ) + { + /* TO TRANSLATORS: myvgname active + * means that the partition is part of an LVM volume group and that + * volume group is active and being used by the operating system. + */ + str_temp = String::ucompose( _("%1 active"), partition .get_mountpoint() ) ; + } else if ( partition .get_mountpoints() .size() ) { str_temp = String::ucompose( @@ -290,6 +298,23 @@ void Dialog_Partition_Info::Display_Info() */ str_temp = _("Not active") ; } + else if ( partition .filesystem == FS_LVM2_PV ) + { + Glib::ustring mount_point = partition .get_mountpoint() ; + if ( mount_point .empty() ) + /* TO TRANSLATORS: Not active (Not part of any volume group) + * means that the partition is not yet part of an LVM volume + * group and therefore is not active and can not yet be used by + * the operating system. + */ + str_temp = _("Not active (Not part of any volume group)") ; + else + /* TO TRANSLATORS: myvgname not active + * means that the partition is part of an LVM volume group but + * the volume group is not active and not being used by the operating system. + */ + str_temp = String::ucompose( _("%1 not active"), mount_point ) ; + } else { /* TO TRANSLATORS: Not mounted diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index e8702103..4c6f964b 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -906,6 +906,7 @@ void GParted_Core::set_device_partitions( Device & device ) #ifndef USE_LIBPARTED_DMRAID DMRaid dmraid ; //Use cache of dmraid device information #endif + LVM2_PV_Info lvm2_pv_info ; //clear partitions device .partitions .clear() ; @@ -941,7 +942,8 @@ void GParted_Core::set_device_partitions( Device & device ) } else #endif - partition_is_busy = ped_partition_is_busy( lp_partition ) ; + partition_is_busy = ped_partition_is_busy( lp_partition ) || + lvm2_pv_info .has_active_lvs( partition_path ) ; partition_temp .Set( device .get_path(), partition_path, @@ -983,7 +985,8 @@ void GParted_Core::set_device_partitions( Device & device ) } else #endif - partition_is_busy = ped_partition_is_busy( lp_partition ) ; + partition_is_busy = ped_partition_is_busy( lp_partition ) || + lvm2_pv_info .has_active_lvs( partition_path ) ; partition_temp .Set( device .get_path(), partition_path, @@ -1433,7 +1436,7 @@ void GParted_Core::set_used_sectors( std::vector & partitions ) if ( partitions[ t ] .type == GParted::TYPE_PRIMARY || partitions[ t ] .type == GParted::TYPE_LOGICAL ) { - if ( partitions[ t ] .busy ) + if ( partitions[ t ] .busy && partitions[t] .filesystem != GParted::FS_LVM2_PV ) { if ( partitions[ t ] .get_mountpoints() .size() > 0 ) { diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index eb621bc0..67d3605b 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -941,7 +941,8 @@ void Win_GParted::set_valid_operations() //only unmount is allowed (if ! extended) if ( selected_partition .busy ) { - if ( selected_partition .type != GParted::TYPE_EXTENDED ) + if ( selected_partition .type != GParted::TYPE_EXTENDED && + selected_partition .filesystem != GParted::FS_LVM2_PV ) allow_toggle_swap_mount_state( true ) ; return ;