Troubleshooting Linux Disk Problems

1. ls

$>>ls /data* //Check for input/output error

2. demsg

$>>demsg|grep sd 

 Problem disk result:

3. Use of iostat

1 ), installation

$>>yum install -y sysstat

 2), command usage

$>>iostat --help

 

Important parameter description

-c only show CPU stats

-d only show disk statistics 

-k Displays the number of disk requests per second in K, the default unit block. 

-p device | ALL is mutually exclusive with the -x option, and is used to display the statistics of block devices and system partitions . You can also specify a device name after -p, such as: 

# iostat -p hda or show all devices 

# iostat -p ALL -t When outputting data, print the time of collecting data. 

-V Print version number and help information. 

-x Output extended information.

3), common commands

① $>>iostat

 

Parameter Description:

%user: The percentage of CPU used to run at the user level

%nice: The percentage of CPU used by nice operations

%system: The percentage of CPU used to run at the system level

%iowait: CPU waiting for hardware I/O, the percentage of CPU occupied

%idle: percentage of CPU idle time

The number of I/O requests sent to tps per second

Blk_read/s: The number of blocks read per second

Blk_wrtn/s: The number of blocks written per second

Blk_read: The total number of blocks read

Blk_wrtn : The total number of blocks written

② $>>iostat -c //View CPU status information

 

③ $>>iostat -d //Display device status

 

④ $>>iostat -xkdc 1 10 //Statistics once per second, 10 times in total, and detailed device and CPU information

 hot disk

四、badblocks

This command is used to detect hard disk bad sectors

Parameter Description

-b<block size>: Specify the block size of the disk, in bytes;

-o <output file>: write the result of the check to the specified output file;

-s: show progress while checking;

-v: Display detailed information when executing;

-w: When checking, perform a write test.

$>>badblocks -v /dev/sdc>xx.txt //Check the bad sector information of the sdc disk and write it to xx.txt

5. View the messages log

$>>cat /var/log/messages

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325262940&siteId=291194637