How to check BerkeleyDB version info? Just run this command:
#grep DB_VERSION_STRING /usr/include/db4/db.h
#define DB_VERSION_STRING “Sleepycat Software: Berkeley DB 4.3.29: (September 19, 2009)”
Then your BerkeleyDB version is 4.3.29.
If there’s no /usr/include/db4 directory, you may check to see whether there’s /usr/include/db3 or even /usr/include/db2 directory in your server. And run the respective command with db4 substituted by db3 or db2.
Now assume you want to create a file with 10M space:
Under Solaris:
root@beisoltest02 / # mkfile 10m disk1.img
root@beisoltest02 / # ls -lh disk1.img -rw——T 1 root root 10M Jun 22 00:41 disk1.img
Under Linux:
[root@beivcs02 downloads]# dd if=/dev/zero of=disk1.img bs=1024k count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.01096 seconds, 957 MB/s
[root@beivcs02 downloads]# ls -lh disk1.img
-rw-r–r– 1 root root 10M Jun 22 00:37 disk1.img
This was sometimes because the user under which nagios runs by had no read permission to the file systems check_disk is going to check.
For example, if you received alert:
DISK CRITICAL – /apps/vcc/logs/way is not accessible: Permission denied
You then can log on your server, under root, run:
/usr/local/nagios/libexec/check_disk -p /apps/vcc/logs/way, you may see:
DISK OK – free space: /apps/vcc/logs/way 823 MB (21% inode=90%);| /=2938MB;;3966;0;3966
But when you run this under user nagios, you may see DISK CRITICAL again.
Resolution:
Grant read permission to the filesystem/directory that had problem.
Mac:
sudo dscacheutil -flushcache
Linux:
Here’re ways to flush dns cache on linux/windows/mac:
On linux:
rndc flush
or
/etc/init.d/nscd restart
On Windows:
ipconfig /flushdns
On Mac:
sudo dscacheutil -flushcache
You can install DNS cache plug-in to automatically flush DNS cache for you if you have Firefox installed.
When you’re trying to extend root file system under lvm environment, here are the steps:
1.Extend the root volume:
#lvextend -L500G /dev/VolGroup00/apps-yourapp
2.Grow file system:
#resize2fs /dev/VolGroup00/apps-yourapp 500G
Shrinking can’t be done that easily and requires an umount. To shrink the FS, do the following:
umount <logical-volume-device>
e2fsck -f <logical-volume-device>
resize2fs <logical-volume-device> <new-size-minus-50MB>
lvreduce -L <new-size> <logical-volume-device>
This procedure is for normal(not root) file systems. But what should we do when we want to shrink root/home partition/file system?
You need go to linux rescue mode using a bootable device(Such as the first cd of your linux distro), type linux rescue, and when there jumps out an alert says whether to mount system to /mnt/sysimage, select skip. Read more…
Now, open two tabs on the same server using xshell, on each tab(session), run tty:
root@testserver# tty
/dev/pts/7
root@testserver# tty
/dev/pts/25
First experiment – echo an string between ttys
From /dev/pts/7, run:
root@testserver# echo hi>/dev/pts/25
Then, from the other tab(session), you’re sure to see:
root@testserve# hi Read more…