Managing devices

HP UNIX Listing all hardware devices.



 

Listing all hardware:

Using ioscan:

Disclaimer: Apply to a TEST environment first. Use on production systems is at DBAs own risk.

Device addresses with ioscan.

Important options:

 -f: full listing

 –F: compact listing

 -C: lists only the specified class

 -n: lists device name

 -u: : using cached info from when the system was booted.

ioscan –f

            à -f: full listing.

ioscan –f | lp

            à To print, if you have a networked printer.

ioscan –funC disk     

à To see disks only.

ioscan –funC tape

à To see tapes only.

ioscan –FnC disk           

à -n : physically goes and interrogates the current status and history of all disks.

 

Listing Device files:

Disks, block device:

Block device file: buffering a block of data into memory and then it is sent/written to the block device disk, (default 8000 characters are buffered, then are sent to the block device).

ll /dev/dsk displays a listing as below:                                             

brw-|r–|—            1            bin            sys            31            0×005000        c0t5d0

b: is for block device.

1: it’s got one hard link.

31: is the major number: it points to a section of code in Kernel that tells the software how to talk to this disk.

0×005000: is the minor number: is the device number which is the same as the device number from ioscan –f.

lssf            /dev/rdsk/c0t5d0                    

à Use lssf to get identification for a disk.

 

Disks, raw or character device:

Character device file: Accepting one character at a time. We are communicating with the device one character at the time.

ll /dev/rdsk displays a listing as below:                                             

crw-|r–|—            1            bin            sys            188            0×005000        c0t5d0

c: is for character device.

If some of the block device files or character device files are accidentally removed, then if you reboot the system, HP Unix will re-install them automatically or you could manually re-install them:

            insf            -eC disk                  :to re-install just disks.

            insf            -e                                 :to re-install all devices.

            rmsf                                          :to remove any unneeded device files.

When you need to remove a given device, you will need to use rmsf to remove the device file associated with it.

 

Tapes:

ll /dev/rmt

àDisplays device file name as below:

c1tod0 BEST                           :best density possible.

            BESTb                         :best density possible and use Berkeley style semantic.

            BESTn                         :best density possible but do not rewind.

            BESTnb                      :best density possible and rewind.

            DDS                            :lowest density possible.          

0m is hard linked to BEST, 0mn is linked to BESTn.

lssf            /dev/rmt/om                            

àTo get identification for a tape.

Using ioscan to identify tapes:

                        ioscan –funC tape            :listing system tapes.

 

Device file naming convention:

c0t5d0             d0: is the device number. In case you have multiple disks on a single target address such as a RAID disk; or a piece of hardware with multiple disks.

                                    t5: is the scsi target address.

c0: is the instance number. When system is rebooted an instance# is assigned to the device in order of their response, first respond would get the 0, then 1, etc.

 

Physical disks:

To determine how many physical disks (not partitions) you have on your system do:

            ll /dev/dsk

or         ll /dev/rdsk

/dev/dsk and /dev/rdsk points to the same physical disks, but write to them either character by character (/dev/rdsk) or 8k blocks at a time (/dev/dsk).

The number of disks you see within /dev/dsk is the number of physical disks you have on your system.

Size of a disk:

            diskinfo            /dev/rdsk/c0t5d0

            Note that his only works with raw device files (rdsk).

 

Listing current  file systems:

            bdf

à This lists all currently mounted file systems and how they are mapped into volume groups and logical groups.

For example the following is a single line extracted from bdf command:

/dev/vg00/lvol6            1105920          569478            505227            53%            /var

à This line is basically saying that file system /var is mapped to logical volume lvol6 which is a part of volume group vg00. /var is sized 1GB (1105920K), 556MB (569478K) of which is being used and it has 493MB (505227K) of free space; meaning 53% used.



Google


 

Comments are closed.