| |

VerySource

 Forgot password?
 Register
Search
View: 734|Reply: 1

How to determine whether a device is an optical drive or a hard disk

[Copy link]

2

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

Post time: 2020-2-8 12:00:01
| Show all posts |Read mode
In the Linux system, the device symbol of the optical drive can also be hda, hdb, etc. How can I tell in the code whether the hda is an optical drive or a hard disk? Thank you.

In addition, if the scsi device judges the devicetype field in the INQUIRYDATA data structure, if the value is 0, it is the hard disk?
Reply

Use magic Report

0

Threads

23

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-5-15 21:15:01
| Show all posts
dmesg | grep hda -i
Can be found
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list