[systemd-devel] udevd detect and list ata devices

Marek mlf.conv at gmail.com
Sun Dec 6 08:38:37 PST 2015


i'm trying to get only ata devices because my application requires i
only list disks that are sata drives
inside the computer.

On Sun, Dec 6, 2015 at 2:37 AM, Greg KH <gregkh at linuxfoundation.org> wrote:
> On Sun, Dec 06, 2015 at 01:49:41AM +0100, Marek wrote:
>> >
>> /sys/
>> > And "ata" devices are not the same thing as a "usb" device is in any way
>> > or form, so the fact that they have to be shown differently is totally
>> > natural.  You can iterate over them, you just have to find the correct
>> > class that the kernel uses for them ("ata_device"), but there is no "ata
>> > bus" so you will have to search for them differently.
>>
>> udev_device_get_sysname(block)
>> /sys/devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0/block/sda
>> /sys/devices/pci0000:00/0000:00:12.2/usb1/1-1/1-1:1.0/host8/target8:0:0/8:0:0:0/block/sdg
>> tried
>> udev_device_get_parent_with_subsystem_devtype(scsi, "ata_device", NULL);
>> but it gives me nothing
>
> That's to be expected, again, what exactly are you trying to do here?
> And most importantly, why?


More information about the systemd-devel mailing list