Devices and Device Files


dmesg

dmesg

Not available under AIX

 

Display boot and other system messages. Devices are listed within the messages as the devices are detected.


Vendor-specific device listing commands

AIX:

lscfg
lsdev -C -s scsi
lscfg -v -l device
lsattr -E -H -l device

List all devices.
List all SCSI devices.
Display device details.
Display device attributes.

FreeBSD:

pciconf -l -v
camcontrol devlist
usbdevs

List PCI devices.
List SCSI devices.
List USB devices.

HP-UX:

ioscan -f -n
ioscan -f -n -C disk

Display detailed device listing.
Limit to device class.

Linux:

lsdev
scsiinfo -l
lspci
lsusb

List major devices.
List SCSI devices.
List PCI devices.
List USB devices.

Solaris:

getdev
getdev type=class
devattr -v device

List devices.
Limit to device class.
Display device detail.

Special File Formats

In all cases, the optional r in special filenames refers to the character device (i.e., raw access mode), and the other name refers to the block device.

Disk partition special filenames

AIX:

/dev/hdiskn (refers to entire disk)

 

n is the disk number. Example: /dev/hdisk1

FreeBSD:

/dev/[r]ppnsmx (often shortened to /dev/[r]ppnx)
pp is a device-specific prefix (e.g., ad or wd for IDE disks, da for SCSI), n is the disk number, m is the slice number (physical partition), and x is the partition letter. Example: /dev/da1s1a

HP-UX:

/dev/[r]dsk/cktidn
k is the controller number, i is the SCSI ID, and n is the disk number. Example: /dev/dsk/c0t4d1

Linux:

/dev/[sd|hd]ym
The sd/hd prefix refers to SCSI/IDE disks, respectively, y is the disk letter (where a refers to the first disk, etc.), and m is the physical partition number. Example: /dev/ hda1

Solaris:

/dev/[r]dsk/cktid0sm
k is the controller number, i is the SCSI ID, and m is the physical partition number. Example: /dev/dsk/c0t4d0s2


CD-ROM device special filenames

AIX:

/dev/cd0

HP-UX:

/dev/dsk/cktid0

Linux:

/dev/cdrom

Solaris:

/dev/dsk/c0tid0s02

FreeBSD:

/dev/cd0c (SCSI), /dev/acd0c (ATAPI)

For HP-UX and Solaris, k and i have the same meanings in special filenames for both disks and CD-ROMs.


Floppy disk special filenames

AIX:

/dev/fd0

FreeBSD:

/dev/fd0

HP-UX:

/dev/dsk/c0t1d0

Linux:

/dev/fd0

Solaris:

/dev/diskette

 

 


Network interface names

The following list indicates the first network interface. Additional interfaces will have higher numbers (e.g., eth1).

AIX:

en0

FreeBSD:

xl0, de0 (and others)

HP-UX:

lan0

Linux:

eth0

Solaris:

hme0, dnet0, eri0, le0 (and others)


Tape special filenames

k is the drive number, and n means “no rewind” in all cases.

AIX:

/dev/rmtk[.m]
m is a suffix indicating rewind, retensioning, and density settings (see the rmt(4) man page). The default is rewind, no retension, and low density.

FreeBSD:

/dev/[n]rastk and /dev/[e|n]rsak
e means “eject tape on close.”

HP-UX:

/dev/rmt/citjd0TYPE[b][n]
i is the controller number, j is the SCSI ID, b says to use BSD-style error control, and TYPE is a keyword that indicates the tape type and/or density (e.g., BEST, DDS). /dev/rmt often contains links between these names and simpler ones (e.g., 0m linked to c0t3d0BEST).

Linux:

/dev/[n]stk[x]
x indicates the density selection: l, m, and a for low, medium, and autoselect, respectively.

Solaris:

/dev/rmt/k[x][b][n][c]
b says to use BSD-style error control, x indicates the density (l, m, and h for low, medium, and high, respectively), and c says to use hardware compression.

Default tape drive

AIX:

/dev/rmt0

FreeBSD:

/dev/rsa0

HP-UX:

/dev/rmt/0m

Linux:

/dev/st0

Solaris:

/dev/rmt/0

Modifying tape drive settings under AIX

lsattr -E -H -l device

Display attributes to the specified tape drive.

chdev -l rmtn -a block_size=bytes -a compress=yes|no \ -a ret=yes|no

Change settings of the specified tape drive.


Serial line special files

The following table gives the form for the first device of each type:

 

Serial line

Dial-out form

Slave pseudo terminal

AIX:

/dev/tty0

/dev/tty0

/dev/pts/0

FreeBSD:

/dev/ttyd0

/dev/cuaa0

/dev/ttyp0

HP-UX:

/dev/tty0p0

/dev/cua0p0

/dev/ttyd0p0, /dev/pts/0

Linux:

/dev/ttyS0

/dev/ttyS0

/dev/ttyp0

Solaris:

/dev/term/a

/dev/cua/0

/dev/pts/0

System console: /dev/console

System console device. On AIX systems, the console device in terminal mode is /dev/lft0.


Printer special filenames

First parallel port devices:

AIX:

/dev/lp0

FreeBSD:

/dev/lpt0

HP-UX:

/dev/lp

Solaris:

/dev/ecpp0

Linux:

/dev/parport0 (usually mapped to /dev/lp0)


USB device special files

The following list shows the first file of each type.

Mouse

FreeBSD:

/dev/ums0

Solaris:

/dev/usbms

Linux:

/dev/input/mouse0 and /dev/input/mice

Zip drive

FreeBSD:

/dev/da0s4

Linux:

/dev/sda4

Solaris:

/dev/dsk/c1t0d0s0:c

 

 

Printer

FreeBSD:

/dev/ulpt0

Linux:

/dev/usblp0

Solaris:

/dev/usbprn0

 

 

Other devices found on some systems

/dev/null

Null device (discards all output; reads return 0 bytes).

/dev/zero

Returns a zero-filler buffer.

/dev/random

Random number generator.

Get Essential System Administration Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.