Can anyone tell me what is the the most reliable way of discovering all block devices attached to the system from user space? I have been using libblkid with the iterate functions, but they do not pick up optical devices (like cdroms, dvd writers, etc...)
Thanks in advance.
/dev
If udevd is running, couldn't you just use all the block devices in /dev?
Well, I had thought of that,
Well, I had thought of that, but it didn't seem very elegant.
I'm not sure whether this wou
I'm not sure whether this would be elegant, but you can elegantly traverse /sys/block/ to get that information.