diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi
index c3a14c9e4..afe79479b 100644
--- a/html/cgi-bin/extrahd.cgi
+++ b/html/cgi-bin/extrahd.cgi
@@ -51,6 +51,12 @@ my @devices = &get_block_devices();
# Grab all known UUID's.
my %uuids = &get_uuids();
+# Detect device mapper devices.
+my %device_mapper = &get_device_mapper();
+
+# Grab members of group devices (RAID, LVM)
+my %grouped_devices = &collect_grouped_devices();
+
# Grab all mountpoints.
my %mountpoints = &get_mountpoints();
@@ -236,103 +242,145 @@ END
# Grab the known partitions of the current block device.
my @partitions = &get_device_partitions($device);
- foreach my $partition (@partitions) {
- my $disabled;
-
- # Omit the partition size.
- my $bsize = &get_device_size($partition);
-
- # Convert into human-readable format.
- my $size = &General::formatBytes($bsize);
-
- # Try to omit the used filesystem.
- my $fs = $filesystems{$partition};
-
- # Get the mountpoint.
- my $mountpoint = $mountpoints{$partition};
-
- # If no mountpoint could be determined try to grab from
- # configured drives.
- unless($mountpoint) {
- my $uuid = $uuids{$partition};
-
- # Build uuid string.
- $uuid = "UUID=" . $uuid;
-
- # Try to obtain a possible moutpoint from configured drives.
- $mountpoint = $configured_drives{$uuid} if ($configured_drives{$uuid});
+ # Check if the block device has any partitions for display.
+ if (@partitions) {
+ # Loop through the partitions.
+ foreach my $partition (@partitions) {
+ # Call function to display the row in the WUI.
+ &print_row($partition);
}
+ }
- # Check if the mountpoint is used as root or boot device.
- if ($mountpoint eq "/" or $mountpoint =~ "^/boot") {
- $disabled = "disabled";
-
- # Check if it is mounted.
- } elsif(&is_mounted($mountpoint)) {
- $disabled = "disabled";
-
- # Check if the device is used as swap.
- } elsif (&is_swap($partition)) {
- $disabled = "disabled";
- $mountpoint = "swap";
- $fs = "swap";
- }
-
- print <
-
-END
-; }
-
+ # Also print rows for devices with an UUID.
+ &print_row($device) if($uuids{$device});
}
- print <
-
-
$Lang::tr{'extrahd install or load driver'}
-
+ print <
+
+
$Lang::tr{'extrahd install or load driver'}
+
END
;
+
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
+
+#
+# Function to print a table row with device data on the WUI.
+#
+sub print_row ($) {
+ my ($partition) = @_;
+
+ my $disabled;
+
+ # Omit the partition size.
+ my $bsize = &get_device_size($partition);
+
+ # Convert into human-readable format.
+ my $size = &General::formatBytes($bsize);
+
+ # Try to omit the used filesystem.
+ my $fs = $filesystems{$partition};
+
+ # Get the mountpoint.
+ my $mountpoint = $mountpoints{$partition};
+
+ # Generate partition string.
+ my $partition_string = "/dev/$partition";
+
+ # Check if the given partition is managed by device mapper.
+ if (exists($device_mapper{$partition})) {
+ # Alter the partition string to used one by the device mapper.
+ $partition_string = "$device_mapper{$partition}";
+ }
+
+ # Check if the device is part of a group.
+ my $grouped_device = &is_grouped_member($partition);
+
+ # If no mountpoint could be determined try to grab from
+ # configured drives.
+ unless($mountpoint) {
+ my $uuid = $uuids{$partition};
+
+ # Build uuid string.
+ $uuid = "UUID=" . $uuid;
+
+ # Try to obtain a possible moutpoint from configured drives.
+ $mountpoint = $configured_drives{$uuid} if ($configured_drives{$uuid});
+ }
+
+ # Check if the mountpoint is used as root or boot device.
+ if ($mountpoint eq "/" or $mountpoint =~ "^/boot") {
+ $disabled = "disabled";
+
+ # Check if it is mounted.
+ } elsif(&is_mounted($mountpoint)) {
+ $disabled = "disabled";
+
+ # Check if the device is used as swap.
+ } elsif (&is_swap($partition)) {
+ $disabled = "disabled";
+ $mountpoint = "swap";
+ $fs = "swap";
+
+ # Check if the device is part of a group.
+ } elsif ($grouped_device) {
+ $disabled = "disabled";
+ $mountpoint = "/dev/$grouped_device";
+ $mountpoint = $device_mapper{$grouped_device} if (exists($device_mapper{$grouped_device}));
+ }
+
+ print "