Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS Not supported on Ubuntu #16

Open
azukaar opened this issue Nov 2, 2024 · 6 comments
Open

OS Not supported on Ubuntu #16

azukaar opened this issue Nov 2, 2024 · 6 comments

Comments

@azukaar
Copy link

azukaar commented Nov 2, 2024

Hello I am getting a "OS not supported" on Ubuntu Desktop where smarttools are installed.

	for i, device := range devices {
			used, err := GetDiskUsage(device.Name)
			if err != nil {
					utils.Error("GetRecursiveDiskUsageAndSMARTInfo - Error fetching Disk usage for " + device.Name + " : ", err)
					return nil, err
			}

			devicesF[i].BlockDevice = device
			devicesF[i].Usage = used * uint64(devicesF[i].Size.Int64) / 100

			// SMART information retrieval for NVMe and SATA
			if device.Type == "disk" {
        	dev, err := smart.Open(device.Name)
					if err != nil {
						devicesF[i].Children, _ = GetRecursiveDiskUsageAndSMARTInfo(device.Children)
						continue
					}
					defer dev.Close()

					GenericAttributes, err := dev.ReadGenericAttributes()
					if err != nil {
						utils.Warn("GetRecursiveDiskUsageAndSMARTInfo - Error fetching SMART info for " + device.Name + " : " + err.Error())
						devicesF[i].Children, _ = GetRecursiveDiskUsageAndSMARTInfo(device.Children)
						continue
					}

....
2024/11/02 15:56:04 [WARN]  GetRecursiveDiskUsageAndSMARTInfo - Error fetching SMART info for /dev/sda : os not supported
2024/11/02 15:56:04 [WARN]  GetRecursiveDiskUsageAndSMARTInfo - Error fetching SMART info for /dev/sdb : os not supported
2024/11/02 15:56:04 [WARN]  GetRecursiveDiskUsageAndSMARTInfo - Error fetching SMART info for /dev/sdc : os not supported
2024/11/02 15:56:04 [ERROR] GetRecursiveDiskUsageAndSMARTInfo - Error fetching Disk usage for /dev/sdc1 :  : exit status 1
2024/11/02 15:56:04 [WARN]  GetRecursiveDiskUsageAndSMARTInfo - Error fetching SMART info for /dev/sdd : os not supported

Thanks

@azukaar
Copy link
Author

azukaar commented Nov 2, 2024

After investigation it seems the issue might be that the library does not send the USB passthrought flag when required. I can see my disk SMART from CLI with

sudo smartctl -d sat,12 -i /dev/sda

Is there any equivalant with the lib?

@anatol
Copy link
Owner

anatol commented Nov 2, 2024

Thank you for the report.

How to reproduce this problem? Is there anything special about your drives? Could you please share more information about your disk configuration?

@azukaar
Copy link
Author

azukaar commented Nov 3, 2024

It's a DAS connected via USB. So when you do

lsblk -o NAME,TRAN,TYPE,SIZE,MOUNTPOINT

You will see that some disks are connected via USB (Transport is USB)

sda         usb    disk    7.3T
└─md0              raid5  21.8T
sdb         usb    disk    7.3T
└─md0              raid5  21.8T
sdc         usb    disk    7.3T
└─md0              raid5  21.8T
sdd         usb    disk    7.3T
└─md0              raid5  21.8T

In that case, in order to access their SMART data, an additional flag has to be passed to the smartclt command

smartctl -d sat,12 -i /dev/sda 

,12 or ,16 are flags to use the SAT protocol which allows the SMART data to flow via the USB controller

@anatol
Copy link
Owner

anatol commented Nov 3, 2024

Thank you for the information. It sounds like this parameter affects passthrough variant here

cdb := cdb16{_SCSI_ATA_PASSTHRU_16}

smart.go uses 16 byte variant, and I assume it does not work in your case with USB passthrough.

I would like to reproduce the problem with the integration test here https://github.com/anatol/smart.go/blob/be6d7524480a17a9a44d73fb6cac1edb565cdf9c/integration_test.go @azukaar do you know if QEMU supports the configuration you have problem with?

@azukaar
Copy link
Author

azukaar commented Nov 3, 2024

OK that's weird... Then may be that is not the issue? But then it should just work even with USB if you are sending ATA over SCSI already
I am not sure about QEMU sorry

@anatol
Copy link
Owner

anatol commented Nov 3, 2024

OK that's weird... Then may be that is not the issue?

I think we deal with special case here (SATA over USB) that seems require different protocol. But I need to be able to reproduce the issue to understand what are the protocol changes required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants