Archive for the tag 'repair'

SBDavid

How to find and Repair Unowned Files

How to find and Repair Unowned Files

The following command will discover and print any files on local partitions which do not belong to a valid user and a valid group. Run it once for each local partition PART:

# find PART -xdev \( -nouser -o -nogroup \) -print

If this command prints any results, investigate each reported file and either assign it to an appropriate user and group or remove it.

Unowned files are not directly exploitable, but they are generally a sign that something is wrong with some system process. They may be caused by an intruder, by incorrect software installation or incomplete software removal, or by failure to remove all files belonging to a deleted account. The files should be repaired so that they will not cause problems when accounts are created in the future, and the problem which led to unowned files should be discovered and addressed.

fsck - check and repair a Linux file system

fsck - check and repair a Linux file system

fsck is used to check and optionally repair one or more Linux file systems. filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2), a mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier (e.g. UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Normally, the fsck program will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of the filesystems.

If no filesystems are specified on the command line, and the -A option is not specified, fsck will default to checking filesystems in /etc/fstab serially.

This is equivalent to the -As options.

The exit code returned by fsck is the sum of the following conditions:

0 - No errors
1 - File system errors corrected
2 - System should be rebooted
4 - File system errors left uncorrected
8 - Operational error
16 - Usage or syntax error
32 - Fsck canceled by user request
128 - Shared library error

The exit code returned when multiple file systems are checked is the bit-wise OR of the exit codes for each file system that is checked.

Repair and rebuild all mail configuration in plesk.

This can be done with Plesk mchk utility:

Login to the server as user root and run the mchk utility.

Example:

# /usr/local/psa/admin/sbin/mchk –with-spam

Also check for the options

# /usr/local/psa/admin/sbin/mchk –help

mchk [OPTION]

–without-spam - restore all settings except for SpamAssassin configuration
–with-spam - restore all settings
–spam-only - restore only SpamAssassin settings

This utility rebuilds in line with Plesk database Qmail control files in the /var/qmail/control, /var/qmail/users directories and mail users’ settings. Also, it sets proper ownership/permissions for all mailboxes (/var/qmail/mailnames/*).

Repairing MyISAM mySQL Tables and Databases:

Repairing MyISAM mySQL Tables/Databases.
Please note that we assume your mySQL data directory is /var/lib/mysql

cd /var/lib/mysql/DBNAME
myisamchk -r *.MYI