Find If Processor CPU is 64 bit or 32 bit
Try this to find out if your CPU/Processor is 32 bit or 64 bit
NAME
getconf - Query system configuration variables
SYNOPSIS
getconf [-v specification] system_var
getconf [-v specification] path_var pathname
DESCRIPTION
-v
Indicate the specification and version for which to obtain
configuration variables.
system_var
A system configuration variable, as defined by sysconf(3) or
confstr(3).
path_var
A system configuration variable as defined by pathconf(3). This
must be used with a pathname.
Tags: 32, 64, bit, CPU
SAR or Sysstat
You can follow the below steps to install Sysstat Utilities which includes the “sar” command that is used to display your load average for the day.
1. Login to your server through SSH and login as root or su to the root user.
2. First just create a directory, or use one that you use to download temporary files.
3. Download the rpm.
wget ftp.ibiblio.org/pub/linux/system/status/sysstat-5.0.2-1.i386.rpm
4. Install the rpm.
rpm -ivh sysstat-5.0.2-1.i386.rpm
5. You can set cronjobs for systat
vi sysstat
Paste the following contents in it for recording load averages every 10 minutes.
# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib/sa/sa2 -A
Save the file and exit vi.
6. To look at your load averages. Type in:
This produces a better layout. It will show the loads recorded every ten minutes since midnight the night before. And then it will show your day’s average at the very bottom.
Tags: SAR, Sysstat
Mount windows drive to linux filesystem
Step 1: Take a Linux system. Install samba in your Linux system and start the service.
Step 2: Create a directory in Linux to which you will be mounting the files. Usually a subdirectory in “/mnt”
Step 3: Goto windows system. Share the drive/folder in windows system which you want to mount to Linux. Make sure that the drive/folder you are going to share is having the share permission for administrator.
Step 4: Go back to Linux system. Type the following command,
mount -t smbfs -o username=,password=,debug=4 //windowsservername or ip/drive or folder share name /mnt/share
Example:
mount -t smbfs -o username=administrator,password=gold,debug=4 //192.168.0.1/ewin$ /mnt/windrive
Step 5: Go to the directory you have made in Linux for mounting. Now you can see all the contents in windows drive/folder in that directory.
Tags: drive, filesystem, linux, Mount, windows
Logging server load to /var/log/messages
There can be issues when the server goes offline and you can’t find any related log entries in the server. One of the issue that can cause is high load in the server. But we wont be able to conclude whether the load was the exact issue after the server reboot.
The better solution to find the load is set a cronjob to enter the load in the server to /var/log/messages for a particular amount of time. A sample cron is shown below which will log the server load every 10 minutes to /var/log/messages.
*/10 * * * * uptime | logger -t “SERVER LOAD”
Now you will be able to get the load from /var/log/messages
Tags: /var/log/messages, Logging, server load
Difference in du and df results
We normally see issues where the “du” and “df” outputs different disk space usage.
A common scenario is filling up of /var partition due to log files.
We usually clear the logs and the “du” outputs the expected result whereas “df” still shows the earlier reading.
This is due to the fact that, some user processes keeps the deleted files open. “du” doesn’t show that since the file (if it is removed), or the file contents (if it is cleared) is not there in the current working directory.
“df” will continue to display the previous disk space, until the space is de-allocated. To de-allocate this space either the file descriptor of the file should close or the process should exit.
Therefore you can try restarting the daemons used by these files or reboot the server.
Tags: df, Difference, du, results