Skip to content

Instantly share code, notes, and snippets.

@hashimotor
Created June 29, 2014 03:40
Show Gist options
  • Save hashimotor/608375e0617de1089783 to your computer and use it in GitHub Desktop.
Save hashimotor/608375e0617de1089783 to your computer and use it in GitHub Desktop.
XFSトラシュ
#!/bin/sh
# http://xfs.org/index.php/XFS_FAQ#Q:_What_information_should_I_include_when_reporting_a_problem.3F
# 1. Hardware and storage configuration
uname -a
xfs_repair -V
cat /proc/cpuinfo
cat /proc/meminfo
cat /proc/partitions
# RAID layout
# LVM configuratino
# Type of disks you are using
# write cache status of drives
# size of BBWC and mode it is running in
xfs_info # output on the filesystem in question
dmesg # output showing all error messages and stack traces
# 2. Workload that is causing the problem, and a demonstration of the bad behaviour that is occurring.
# 30s - 1 minute samples of:
iostat -x -d -m 5
vmstat 5 # IO and memory utilisation of your machine at the time of the problem.
# If the filesystem is hanging
echo w > /proc/sysrq-trigger
dmesg # will tell us all the hung processes in the machine, often pointing us directly to the cause of the hang.
And for advanced users, capturing an event trace using trace-cmd (git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) will be very helpful. In many cases the XFS developers will ask for this information anyway, so it's a good idea to be ready with it in advance. Start the trace with this command, either from a directory not on an XFS filesystem or with an output file destination on a non-XFS filesystem:
# trace-cmd record -e xfs\*
before the problem occurs, and once it has occurred, kill the trace-cmd with ctrl-C, and then run:
# trace-cmd report > trace_report.txt
Compress the trace_report.txt file and include that with the bug report. The reason for trying to host the output of the record command on a different filesystem is so that the writing of the output file does not pollute the trace of the problem we are trying to diagnose.
If you have a problem with xfs_repair(8), make sure that you save the entire output of the problematic run so that the developers can see exactly where it encountered the problem. You might be asked to capture the metadata in the filesystem using xfs_metadump(8) (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment