anchor.diff:    end
   
     def find_md_arrays(devices)
  +    array = nil
  +
       File.new("/proc/mdstat", "r").each do |line|
  -      next unless line =~ /^(md\d+) : active raid(\d+)((?: [a-z]+\d+\[\d+\](?:\([A-Z]\))*)+)$/
  -
  -      array = {
  -        :id => devices[:arrays].count,
  -        :device => "/dev/#{Regexp.last_match(1)}",
  -        :raid_level => Regexp.last_match(2),
  -        :disks => []
  -      }
  -
  -      Regexp.last_match(3).scan(/ ([a-z]+)\d+\[\d+\](?:\([A-Z]\))*/).flatten.each do |device|
  -        if disk = devices[:disks].find { |d| d[:device] == "/dev/#{device}" }
  -          disk[:arrays] << array[:id]
  -          array[:disks] << disk[:id]
  -        end
  -      end
  -
  -      devices[:arrays] << array
  +      if line =~ /^(md\d+) : active raid(\d+)((?: [a-z]+\d+\[\d+\](?:\([A-Z]\))*)+)$/
  +        array = {
  +          :id => devices[:arrays].count,
  +          :device => "/dev/#{Regexp.last_match(1)}",
  +          :raid_level => Regexp.last_match(2),
  +          :disks => []
  +        }
  +
  +        Regexp.last_match(3).scan(/ ([a-z]+)\d+\[\d+\](?:\([A-Z]\))*/).flatten.each do |device|
  +          if disk = devices[:disks].find { |d| d[:device] == "/dev/#{device}" }
  +            disk[:arrays] << array[:id]
  +            array[:disks] << disk[:id]
  +          end
  +        end
  +
  +        devices[:arrays] << array
  +      elsif line =~ /^\s+(\d+) blocks/
  +        array[:size] = format_disk_size(Regexp.last_match(1).to_i)
  +      end
       end
     end
   
  
positive.code:           when "Enclosure #" then disk[:location] = Regexp.last_match(2)
            when "Slot #" then disk[:location] = "#{disk[:location]}:#{Regexp.last_match(2)}"
            when "SAS Address" then disk[:device] = find_sas_device(Regexp.last_match(2).tr("-", ""))
            when "Size (in MB)/(in sectors)" then disk[:size] = parse_disk_size("#{Regexp.last_match(2).split('/').first} MB")
            when "Manufacturer" then disk[:vendor] = Regexp.last_match(2)
            when "Model Number" then disk[:model] = Regexp.last_match(2)
            when "Firmware Revision" then disk[:firmware_version] = Regexp.last_match(2)
  
negative.code:             model = Regexp.last_match(2)
            end
  
            devices[:disks] << {
              :id => devices[:disks].count,
              :device => "/dev/#{File.basename(block)}",
              :vendor => vendor,
              :model => model,
              :firmware_version => read_sysctl_file("#{device}/rev"),
              :size => format_disk_size(size),
              :arrays => []
            }
          end
  