blkid can be used to display the swap label:
# blkid /dev/md2
/dev/md2: TYPE="swap" LABEL="SWAP-md2"
BlogsShow swap labelSubmitted by sandip on Thu, 07/15/2010 - 11:43blkid can be used to display the swap label: # blkid /dev/md2 »
smartctl notesSubmitted by sandip on Thu, 07/15/2010 - 10:25Below is a list of smartctl commands I frequently use to quickly verify disk health and status, specially when you have smartd logging errors to messages log file.
smartctl -a /dev/sda smartctl --smart=on /dev/sda smartctl -i /dev/sda smartctl -c /dev/sda smartctl -H /dev/sda smartctl -A /dev/sda smartctl -t offline /dev/sda smartctl -t long /dev/sda smartctl -l selftest /dev/sda smartctl -l error /dev/sda There are more examples in man smartctl. Non-desctructive read-write badblocks disk checkSubmitted by sandip on Wed, 07/14/2010 - 17:14Below command can be run on unmounted partitions to do a disk check of badblocks. Use -p if you need to automatically fix issues. Single "c" will only do a badblock read test. e2fsck -vfcc -C 0 /dev/sdb4 "-C 0" -- displays progress »
resend all mails in sendmail queueSubmitted by sandip on Sun, 07/11/2010 - 23:31As root you can redeliver all mail in the mail server queue via: sendmail -v -q »
mismatch_cnt is not 0Submitted by sandip on Sun, 07/04/2010 - 21:02Mismatch_cnt (/sys/block/md#/md/mismatch_cnt) is the number of unsynchronized blocks in the raid. Not much of an issue if this is reported on raid-0 or raid-1 and can be ignored. See bugzilla report: Bug 566828. The repair is to rebuild the raid: echo repair >/sys/block/md#/md/sync_action This does not reset the count, but if you force a check after the rebuild is complete: echo check >/sys/block/md#/md/sync_action Count should return to zero. Verify with: cat /sys/block/md#/md/mismatch_cnt »
Upgrade CentOS 5.4 to 5.5 for OpenVZ containersSubmitted by sandip on Fri, 07/02/2010 - 23:38Edit "/vz/template/centos/5/{ARCH}/config/yum.conf", and change the base and updates repositories as below: [base] Do a `vzyum {VEID} clean all`. List updates: vzyum {VEID} list updates Update: vzyum {VEID} update Confirm that all VEs' have been updated to 5.5 with: cat /vz/root/{VEID}/etc/redhat-release You should see "CentOS release 5.5 (Final)". »
Change server timezoneSubmitted by sandip on Tue, 06/29/2010 - 11:26To change the server timezone, just create a link to the respective zone you're on. ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime Check with the `date` command. »
lighttpd redirect to external url if file not foundSubmitted by sandip on Mon, 06/28/2010 - 14:57Below is a rewrite/redirect rule using url.rewrite-[repeat]-if-not-file similar to Apaches' "!-f" RewriteRule. # Redirect to external url if image file not found »
Deny access to .htaccess files in lighttpdSubmitted by sandip on Sun, 06/27/2010 - 21:36In lighttpd you can use mod_access to deny files starting with a certain expression, such as hidden dot files. (example: .htaccess or .svn) # Deny access to hidden files »
Find files that have not been accessed for a whileSubmitted by sandip on Wed, 06/09/2010 - 16:25Below one liner uses the find command to list files sorted by access time beyond the provided "number of days". find </path/to/folder> -type f -atime +<number of days> -exec ls -ultr {} \; This becomes handy if you want to do archive and cleanup of your web folders that have grown to a huge size. »
|
User loginRecent blog posts
Who's onlineThere are currently 0 users and 7 guests online.
|