| 470 | } |
| 471 | |
| 472 | func (fs FS) SysBlockDeviceUnderlyingDevices(device string) (UnderlyingDeviceInfo, error) { |
| 473 | underlyingDir, err := os.Open(fs.sys.Path(sysBlockPath, device, sysUnderlyingDev)) |
| 474 | if err != nil { |
| 475 | return UnderlyingDeviceInfo{}, err |
| 476 | } |
| 477 | underlying, err := underlyingDir.Readdirnames(0) |
| 478 | if err != nil { |
| 479 | return UnderlyingDeviceInfo{}, err |
| 480 | } |
| 481 | return UnderlyingDeviceInfo{DeviceNames: underlying}, nil |
| 482 | |
| 483 | } |
| 484 | |
| 485 | // SysBlockDeviceSize returns the size of the block device from /sys/block/<device>/size |
| 486 | // in bytes by multiplying the value by the Linux sector length of 512. |