<div><span class="gmail_quote">On 3/23/06, <b class="gmail_sendername">Shawn Fertch</b> <<a href="mailto:sfertch@gmail.com">sfertch@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="DIRECTION: ltr">
<div>I'm looking for a way to gather specific HDD info such as what shows up in dmesg:</div>
<div> </div>
<div>IDE:</div>
<div>hda: WDC WD800JB-00CRA1, ATA DISK drive<br>hdb: CD-ROM CMD5X11, ATAPI CD/DVD-ROM drive<br>blk: queue c040c460, I/O limit 4095Mb (mask 0xffffffff)<br>ide0 at 0x1f0-0x1f7,0x3f6 on irq 14<br>hda: attached ide-disk driver.
<br>hda: host protected area => 1<br>hda: 156301488 sectors (80026 MB) w/8192KiB Cache, CHS=9729/255/63, UDMA(100)<br>hdb: attached ide-cdrom driver.<br>hdb: ATAPI 52X CD-ROM drive, 128kB Cache, UDMA(33)<br>Uniform CD-ROM driver Revision:
3.12<br> </div>
<div>Or SCSI:</div>
<div>scsi0 : ioc0: LSISAS1064, FwRev=01040000h, Ports=1, MaxQ=203, IRQ=209<br> Vendor: FUJITSU Model: MAV2073RCSUN72G Rev: 0301<br> Type: Direct-Access ANSI SCSI revision: 04<br>SCSI device sda: 143374738 512-byte hdwr sectors (73408 MB)
<br>SCSI device sda: drive cache: write through<br> sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 ><br>Attached scsi disk sda at scsi0, channel 0, id 2, lun 0<br> Vendor: FUJITSU Model: MAV2073RCSUN72G Rev: 0301
<br> Type: Direct-Access ANSI SCSI revision: 04<br>SCSI device sdb: 143374738 512-byte hdwr sectors (73408 MB)<br>SCSI device sdb: drive cache: write through<br> sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 sdb8 >
<br>Attached scsi disk sdb at scsi0, channel 0, id 3, lun 0<br> </div>
<div> </div>
<div>What I'm mainly after is where the make/model information comes from. I dug around in the /proc filesystem but didn't see much. Googling turned up a lot of information, but not what I'm looking for specifically. fdisk -l only provides the geometry and layout of the disk.
</div>
<div> </div>
<div>I had thought of writing a script to gather the information on system bootup, or to grep it out of /var/log/dmesg. But, I was looking for commands to issue to gather it in case someone had installed a hot-plug disk without rebooting.
</div></div></blockquote>
<div> </div>
<div> </div>
<div>I found the answer:</div>
<div> </div>
<div>It is in fact in the /proc information. For ide systems it's similar to:</div>
<div> </div>
<div>cat /proc/ide/ide0/hda/model</div>
<div> </div>
<div>For scsi it's similar to it.</div>
<div> </div>
<div>I had discounted these files because they are 0 sized.</div>
<div> </div>
<div>cat /proc/scsi/scsi<br>Attached devices:<br>Host: scsi0 Channel: 00 Id: 02 Lun: 00<br> Vendor: FUJITSU Model: MAV2073RCSUN72G Rev: 0301<br> Type: Direct-Access ANSI SCSI revision: 04<br>Host: scsi0 Channel: 00 Id: 03 Lun: 00
<br> Vendor: FUJITSU Model: MAV2073RCSUN72G Rev: 0301<br> Type: Direct-Access ANSI SCSI revision: 04<br>Host: scsi1 Channel: 00 Id: 00 Lun: 00<br> Vendor: AMI Model: Virtual CDROM Rev: 1.00
<br> Type: CD-ROM ANSI SCSI revision: 02<br>Host: scsi2 Channel: 00 Id: 00 Lun: 00<br> Vendor: AMI Model: Virtual Floppy Rev: 1.00<br> Type: Direct-Access ANSI SCSI revision: 02
<br> </div>
<div> </div>
<div>cat /proc/ide/ide0/model<br>WDC WD800JB-00CRA1<br> </div>
<div> </div></div>