Kinds of device files in Linux operating systems
There are two general kinds of device files in Unix-like operating systems, known as character special files and block special files. The difference between them lies in how data written to them and read from them is processed by the operating system and hardware.
These together can be called device special files in contrast to named pipes, which are not connected to a device but are not ordinary files either.
Symbol Meaning
- Regular file
d Directory
l Link
c Special file
s Socket
p Named pipe
b Block device
hdparm provides a command line interface to various kernel interfaces supported by the Linux SATA/PATA/SAS “libata” subsystem and the older IDE driver subsystem.
hdparm [ flags ] [device]
-T Perform timings of cache reads for benchmark and comparison purposes. For meaningful results, this operation should be repeated 2-3 times on an otherwise inactive system (no other active processes) with at least a couple of megabytes of free memory. This displays the speed of reading directly from the
Linux buffer cache without disk access. This measurement is essentially an indication of the throughput of the processor, cache, and memory of the system under test.
root@desktop:~#hdparm -T /dev/sda
/dev/sda:
Timing cached reads: 2254 MB in 1.99 seconds = 1131.64 MB/sec
-t Perform timings of device reads for benchmark and comparison purposes. For meaningful results, this operation should be repeated 2-3 times on an otherwise inactive system (no other active processes) with at least a couple of megabytes of free memory. This displays the speed of reading through the buffer cache to the disk without any prior caching of data. This measurement is an indication of how fast the drive can sustain sequential data reads under Linux, without any filesystem overhead. To ensure accurate measurements, the buffer cache is flushed during the processing of -t using the BLKFLSBUF ioctl.
root@desktop:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 118 MB in 3.01 seconds = 39.16 MB/sec
semget: No space left on device
This relates to semaphores on your system (you’ve run out). Run the following to clear them out:
ipcs | grep apache | awk ‘{print $2}’ > sem.txt
And then run the following.
for i in `cat sem.txt`; do { ipcrm -s $i; }; done;