end
def find_nvme_disks(devices)
- Dir.glob("/sys/class/misc/nvme*") do |device|
+ Dir.glob("/sys/class/nvme/nvme*") do |device|
controller = {
:id => devices[:controllers].count,
:pci_slot => File.basename(Pathname.new("#{device}/device").realpath),
end
end
- Dir.glob("#{device}/device/block/*").each do |block|
+ Dir.glob("#{device}/nvme*").each do |block|
size = read_sysctl_file("#{block}/size").to_f / 2
disk = {
controller[:device] = File.basename(device).sub(/^cciss(\d+)$/, "/dev/cciss/c\\1d0")
elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:3:0/*:3:0:0/scsi_generic/sg*").first
controller[:device] = "/dev/#{File.basename(device)}"
+ elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:1:0/*:1:0:0/scsi_generic/sg*").first
+ controller[:device] = "/dev/#{File.basename(device)}"
end
end
end
end
def psu_devices
- devices = {}
device = nil
IO.popen(["dmidecode", "-t", "39"]).each_with_object([]) do |line, devices|
device = nil
end
end
-
- devices
end
def mc_device