Routing the world

Routing & IT System Administration

Archive for April 2012

XFS corruption recovery. Tips, tricks and tools

leave a comment »

If you have a very large LVM or phisical partitions formated with XFS filesystem with multiple accesses and protocols you can get XFS corruption. XFS partitions are not checked at boot time like ext3 or ext4 for example so you should make manual XFS tests periodically to avoid problems on production environments.

To check the XFS filesystem:

xfs_check /dev/mapper/lvm_partition

In this case I use LVM.

Although you have a 64bit system with a large amount of memory, sometimes you can get an “Out of memory” error because a XFS recovery and test is a high memory consumption process.

You can do a workaround about this issue making a “Repairing Test“. This is an option of the xfs_repair command that allows you to simulate a repairing process without make any change in the disk.

xfs_repair -n /dev/mapper/lvm_partition

Looking to the results of this command you can have a very realistic idea about what is happening.

If you decide to continue you can use the next command to recover the XFS log. In most cases it is a solution but if you have lost the XFS log there is a lot of possibilities that you have data corruption what is not recoverable.

xfs_repair -L /dev/mapper/lvm_partition

This a process that can be very slow and can take several hours. You can see all is working good if you have a process running with a lot of “wait” processor time. You can see this with a simple “top” command.

Written by Root

April 24, 2012 at 15:56

Delete messages from sendmail queue based on an email address

leave a comment »

To delete a massive message from sendmail queue you can use:

cd /var/spool/mqueue
find . -name "[d,q,Q,D]f*" -exec grep -nil "" {} \; | xargs rm

The only thing you have to change is the Mail Spool Queue directory and the “” to whatever you want or need.

%d bloggers like this: