Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to list all the hardisks? (no usb, no loop, etc.)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
fpemud
Apprentice
Apprentice


Joined: 15 Feb 2012
Posts: 280

PostPosted: Mon Mar 16, 2015 8:20 am    Post subject: how to list all the hardisks? (no usb, no loop, etc.) Reply with quote

how to list all the hardisks? (including ssd, but no usb, no loop, etc.)
I want to write a hard disk checking script.
I tried "udevadm info", but i found it's not capable to do it.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7170

PostPosted: Mon Mar 16, 2015 1:47 pm    Post subject: Reply with quote

cat /proc/scsi/scsi

That's best way (for me) to see all harddisks, as harddisks attach to raid controller will also be seen there.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7239
Location: almost Mile High in the USA

PostPosted: Tue Mar 17, 2015 9:17 pm    Post subject: Reply with quote

I think /proc/scsi/scsi includes USB disks, and that it's deprecated for whatever reason.

Not sure why udevadm info doesn't work. You can grep for ID_BUS and see if it's ata or something like that and that would tell that's a USB or ATA disk.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 309

PostPosted: Wed Mar 18, 2015 5:10 am    Post subject: Reply with quote

use "lsblk -i -o name,type,tran" and filter out unwant devices.
some pcie ssd maynot easy to deal with, eg: fusionio. These ssd driver doesn't use scsi subsys, or even disk device, it's blkdev based and non-partitionable.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum