5 Display all block devices on system
7 hdparm -t `block-devices`
15 open(my $proc, '<', '/proc/partitions');
22 my ( $name, $line ) = @_;
24 $name2col->{ $header[$_] } = $_ foreach 0 .. $#header;
26 $line =~ s/^\s+// || die "expected line to start with space: $_\n";
27 my @c = split(/\s+/, $line, $#header + 1 );
28 return $c[ $name2col->{ $name } ];
34 @header = split(/\s+/, $_);
39 my $device = col 'name', $_;
40 if ( $last_device && substr( $device, 0, length($last_device) ) eq $last_device ) {
41 warn "# partition $device\n";
43 print '/dev/', $last_device = $device, $/;