On my local machine, I have /sys/block/sda1/stat
.
On an Amazon machine, I have /sys/block/xvda1/stat
.
When I run cat /sys/block/sda1/stat
or cat /sys/block/xvda1/stat
both give 11 fields of output.
What is the difference between /sys/block/sda1/stat
and /sys/block/xvda1/stat
files?
Best Answer
The
/sys
directory is generally where the sysfs filestystem is mounted, which contains information about devices and other kernel information.The files in
/sys/block
contain information about block devices on your system. Your local system has a block device namedsda
, so/sys/block/sda
exists. Your Amazon instance has a device namedxvda
, so/sys/block/xvda
exists.The
/sys/block/<dev>/stat
file provides several statistics about the state of block device<dev>
. It consists of a single line of text containing 11 decimal values separated by whitespace:So, each block device will have its own
stat
istics file, hence the different values.See kernel docs for more details.