+if ($total) {
+ # List of devices and sizes.
+ my @devices = $g->list_devices ();
+ foreach my $name (@devices) {
+ $name = canonicalize ($name);
+
+ print $name;
+
+ if ($long) {
+ print " device ";
+
+ my $size;
+ eval {
+ $size = $g->blockdev_getsize64 ($name);
+ };
+ $size ||= "unknown";
+
+ if ($human) {
+ print (human_size($size));
+ } else {
+ print $size;
+ }
+ }
+ print "\n";
+ }
+}
+