Operating System - Linux
1748204 Members
4016 Online
108759 Solutions
New Discussion юеВ

Re: prtdiag type command in linux ?

 
Hunki
Super Advisor

prtdiag type command in linux ?

I want to check for system hardware on linux machine running RH 9.Is there a similar command in linux , just like we have in Solaris - prtdiag .

Thanks !

6 REPLIES 6
Peter Nikitka
Honored Contributor

Re: prtdiag type command in linux ?

Hi,

for SuSE-Linux there is a command 'hwinfo' (look at 'man hwinfo'). Perhaps this is available for RH as well.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Peter Nikitka
Honored Contributor

Re: prtdiag type command in linux ?

Related thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1060885

mfG Peter

[Moderator edit: The above link is no longer valid.]

The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"

Re: prtdiag type command in linux ?

There is also a free tool called LSHW which is really good. Just google it.

hth
/M
Atul Gautam
Valued Contributor

Re: prtdiag type command in linux ?

Hi Hunki...

There's no such utility that can provide you with the complete information in RH9.

But RHEL3 onward, a separate utility has been added which is "sysreport" that actually extracts information out of different files and then creates an archive and compresses it and places it in the /tmp directory with your name.

Following is a list of few of the commands using which you can get the necessary information ---

Disk usage.
# df -al

Memory information.
# free

Network information.
# ifconfig -a

Installed Modules information.
#lsmod

Currently mounted filesystems/shares.
# mount

Process tree
# pstree

System uptime information.
# uptime

Services running in different runlevels.
# chkconfig --list

Generates hardware configuration report. (Not sure whether it is present in RH9)
# /usr/share/rhn/up2date_client/hardware.py

Installed RPMS.
# rpm -q --all

List of currently open files.
# lsof -b +M -n -l

Attached USB devices.
# lsusb

Routing table information.
# route -n

Partition table
# fdisk -l

System hostname
# hostname

IP Tables information
# iptables -t filter -nvL

Listing PCI Devices
# lspci
# lspci -n
# lspci -nv
# lspci -nvv



--
Atul
sambitdp
New Member

Re: prtdiag type command in linux ?

Hi Atul,

 

Nice piece of info and really helpful.

 

Need some more help on fdisk -l

 

1. Is it possible to check the disk status if one of them goes faulty ?

2. How to check the disk faults with commands / any specific warning or alarm is thrown on the system ?

3. The fdisk -l o/p comes as follows

 

===================================

# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 300.0 GB, 299966445568 bytes
255 heads, 63 sectors/track, 36468 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sda1 1 36469 292935981+ ee GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table
======================================
 
4. So shall we assume that the disk with partition is in use and the other which doesn't have a partition table is the spare one.
 
BR///
Sambit
Matti_Kurkela
Honored Contributor

Re: prtdiag type command in linux ?

> 1. Is it possible to check the disk status if one of them goes faulty ?

 

It depends on various things:

  • the exact type of the fault
     (sometimes disks develop bad blocks, sometimes they just die completely and won't respond to diagnostic commands)
  • what is the role of the disk in your system (system disk, data disk, unused)
  • do you have hardware or software RAID in use

If your system disk is not protected by RAID, it is very likely that your operating system will crash at the time of disk failure and may not be able to be rebooted. In that case, any diagnostics for the failing disk must be done by booting the system from an external media.

 

If the failing disk is a non-system disk (= a data-only disk), then the system may keep running but you'll probably find a lot of filesystem and/or SCSI error messages in the dmesg command output and/or the syslog files. The applications using the data disk may still crash or hang.

 

If the disk is a member of a software or hardware RAID (other than RAID 0 level), then the system should be able to survive the disk failure. With a software RAID on the system disk, the system might still need a reboot; with hardware RAID, you might only have a minor slowdown until the RAID controller detects that the disk has failed and stops using it.

 

If you have a RAID set, it is important to set up automated monitoring for it, so that you'll be notified in case of disk failure. Otherwise the first failure might go by completely unnoticed. Since all the disks in a given host are usually purchased together, when one disk fails it is possible that other disk(s) are also close to failure. It is important to react to disk failures in a timely manner, even if you're protected by a RAID: a RAID 1 or RAID 5 set can only recover from the failure of one disk in each set. If another disk in the same set fails before the first one is replaced and the RAID set is allowed to recover, data will be lost.

 

MK