Sunday, July 1, 2012

CentOS 6.2 + Qpidd

When CentOS 6.2 is installed in GUI mode then it install Qpidd by default.


Tasks: 700 total,   5 running, 695 sleeping,   0 stopped,   0 zombie
Cpu(s): 12.2%us, 19.5%sy,  0.0%ni, 67.3%id,  0.0%wa,  0.0%hi,  1.1%si,  0.0%st
Mem:  32866212k total,  5185096k used, 27681116k free,   365688k buffers
Swap: 33554424k total,        0k used, 33554424k free,  3212884k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4358 root      20   0 4428m  68m  10m S 338.7  0.2   6291:59 dsm_om_connsvcd
 3310 root      20   0 5574m 885m  10m S 146.8  2.8   3095:24 java
 3259 root      20   0  113m 8316 4612 S 99.8  0.0   3155:52 java
 3554 qpidd     20   0 1960m  12m 3108 S 23.5  0.0 620:13.01 qpidd


# rpm -qa | grep qpid
qpid-cpp-server-0.14-14.el6_2.x86_64
qpid-cpp-client-0.14-14.el6_2.x86_64
qpid-cpp-client-ssl-0.14-14.el6_2.x86_64
qpid-qmf-0.14-7.el6_2.x86_64
qpid-cpp-server-ssl-0.14-14.el6_2.x86_64

It has dependecy on

Dependencies Resolved

===========================================================================================================================================
 Package                                 Arch                       Version                             Repository                    Size
===========================================================================================================================================
Removing:
 qpid-cpp-client                         x86_64                     0.14-14.el6_2                       @updates                     4.0 M
 qpid-cpp-client-ssl                     x86_64                     0.14-14.el6_2                       @updates                     341 k
 qpid-cpp-server                         x86_64                     0.14-14.el6_2                       @updates                     3.3 M
 qpid-cpp-server-ssl                     x86_64                     0.14-14.el6_2                       @updates                     147 k
 qpid-qmf                                x86_64                     0.14-7.el6_2                        @updates                     1.4 M
Removing for dependencies:
 matahari                                x86_64                     0.4.4-12.el6_2                      @updates                      18 k
 matahari-agent-lib                      x86_64                     0.4.4-12.el6_2                      @updates                      81 k
 matahari-broker                         x86_64                     0.4.4-12.el6_2                      @updates                      32 k
 matahari-host                           x86_64                     0.4.4-12.el6_2                      @updates                     102 k
 matahari-network                        x86_64                     0.4.4-12.el6_2                      @updates                      72 k
 matahari-service                        x86_64                     0.4.4-12.el6_2                      @updates                     126 k
 matahari-sysconfig                      x86_64                     0.4.4-12.el6_2                      @updates                      54 k

Transaction Summary
===========================================================================================================================================
Remove       12 Package(s)


[root@imonitor etc]# rpm -qa | grep matahari
matahari-broker-0.4.4-12.el6_2.x86_64
matahari-0.4.4-12.el6_2.x86_64
matahari-network-0.4.4-12.el6_2.x86_64
matahari-sysconfig-0.4.4-12.el6_2.x86_64
matahari-lib-0.4.4-12.el6_2.x86_64
matahari-host-0.4.4-12.el6_2.x86_64
matahari-service-0.4.4-12.el6_2.x86_64
matahari-agent-lib-0.4.4-12.el6_2.x86_64

To stop it use
# /etc/init.d/qpidd stop

To Remove it & its dependency completely

#yum remove qpid-*

Running Transaction
  Erasing    : matahari-0.4.4-12.el6_2.x86_64                                                                                         1/12
  Erasing    : matahari-broker-0.4.4-12.el6_2.x86_64                                                                                  2/12
  Erasing    : qpid-cpp-server-ssl-0.14-14.el6_2.x86_64                                                                               3/12
  Erasing    : matahari-host-0.4.4-12.el6_2.x86_64                                                                                    4/12
  Erasing    : matahari-network-0.4.4-12.el6_2.x86_64                                                                                 5/12
  Erasing    : matahari-service-0.4.4-12.el6_2.x86_64                                                                                 6/12
  Erasing    : matahari-sysconfig-0.4.4-12.el6_2.x86_64                                                                               7/12
  Erasing    : matahari-agent-lib-0.4.4-12.el6_2.x86_64                                                                               8/12
  Erasing    : qpid-qmf-0.14-7.el6_2.x86_64                                                                                           9/12
  Erasing    : qpid-cpp-client-ssl-0.14-14.el6_2.x86_64                                                                              10/12
  Erasing    : qpid-cpp-server-0.14-14.el6_2.x86_64                                                                                  11/12
  Erasing    : qpid-cpp-client-0.14-14.el6_2.x86_64                                                                                  12/12

Removed:
  qpid-cpp-client.x86_64 0:0.14-14.el6_2         qpid-cpp-client-ssl.x86_64 0:0.14-14.el6_2     qpid-cpp-server.x86_64 0:0.14-14.el6_2
  qpid-cpp-server-ssl.x86_64 0:0.14-14.el6_2     qpid-qmf.x86_64 0:0.14-7.el6_2

Dependency Removed:
  matahari.x86_64 0:0.4.4-12.el6_2              matahari-agent-lib.x86_64 0:0.4.4-12.el6_2    matahari-broker.x86_64 0:0.4.4-12.el6_2
  matahari-host.x86_64 0:0.4.4-12.el6_2         matahari-network.x86_64 0:0.4.4-12.el6_2      matahari-service.x86_64 0:0.4.4-12.el6_2
  matahari-sysconfig.x86_64 0:0.4.4-12.el6_2


or

#yum erase matahari-lib matahari-agent-lib matahari-broker matahari-host matahari-service matahari-sysconfig matahari-network matahari qpid-cpp-client qpid-cpp-client-ssl qpid-cpp-server-ssl qpid-cpp-server sigar polkit dbus qpid-qmf boost ConsoleKit eggdbus boost-filesystem boost-program-options boost-graph boost-date-time boost-serialization boost-test boost-thread boost-regex boost-wave  boost-signals boost-iostreams boost-python ConsoleKit-libs libicu



Thursday, June 28, 2012

How to kill thousands of rogue process in linux by single command

In my case there was a dstat process which was scheduled by cron went viral and due to this the system start throwing the error as


Jun 28 09:49:01 machine kernel: VFS: file-max limit 10000 reached
Jun 28 09:49:01 machine kernel: VFS: file-max limit 10000 reached
Jun 28 09:50:01 machine  kernel: VFS: file-max limit 10000 reached
Jun 28 09:50:01 machine  kernel: VFS: file-max limit 10000 reached

By login as root and running the below command you can get the no if times it run with PID.
now it will be very time consuming if you kill each pid one by one.
better approach

# ps -ef | grep dstat | grep -v grep | awk '{print $2}'

then pass the command to the kill -9  and it will kill all the PID related to this process.
# kill -9 `ps -ef | grep dstat | grep -v grep | awk '{print $2}'`

 

Friday, June 22, 2012

Disk I/O monitoring on linux (iostat/sar)


# iostat -dkx 30
 
On every Linux box the following should be graphed at 5 minute averages
  • %util: When this figure is consistently approaching above 80% you will need to take any of the following actions -
    • increasing RAM so dependence on disk reduces
    • increasing RAID controller cache so disk dependence decreases
    • increasing number of disks so disk throughput increases (more spindles working parallely)
    • horizontal partitioning
  • (await-svctim)/await*100: The percentage of time that IO operations spent waiting in queue in comparison to actually being serviced. If this figure goes above 50% then each IO request is spending more time waiting in queue than being processed. If this ratio skews heavily upwards (in the >75% range) you know that your disk subsystem is not being able to keep up with the IO requests and most IO requests are spending a lot of time waiting in queue. In this scenario you will again need to take any of the actions above
  • %iowait: This number shows the % of time the CPU is wasting in waiting for IO. A part of this number can result from network IO, which can be avoided by using an Async IO library.

Wednesday, June 20, 2012

Install PHP-Mcrypt on CentOS 6.2


# rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
#yum install php-mcrypt

Restart httpd
#service httpd restart

Monday, June 18, 2012

Monitor CPU Temperature on Linux (CentOS/RHEL)


lm_sensor is a tool that can monitor linux hardware - works great with 2.6 + kernel onwards
install
#yum install lm_sensors

Configure
#sensors-detect

Press YES to all prompt 

Output depend on your type of MB
=====================

Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver `w83627ehf':
  * ISA bus, address 0xa10
    Chip `Winbond W83627DHG-P Super IO Sensors' (confidence: 9)

Driver `sbs':
  * Bus `i915 gmbus reserved'
    Busdriver `drm', I2C address 0x0b
    Chip `Smart Battery' (confidence: 5)

Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no):
Starting lm_sensors: loading module sbs w83627ehf          [  OK  ]
Unloading i2c-dev... OK
==============================

Instead of system restart - load the module (if any)by modprobe command 

#modprobe i2d-dev

you can check the modules as
# cat /etc/sysconfig/lm_sensors


Run the command to check the cpu current temperature & high/critical limit

[root@imonitor tmp]# sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +23.0°C  (high = +89.0°C, crit = +105.0°C)   >> here +23 deg C is the current Temp
Core 2:      +18.0°C  (high = +89.0°C, crit = +105.0°C)

w83627dhg-isa-0a10
Adapter: ISA adapter
Vcore:       +0.90 V  (min =  +0.00 V, max =  +1.74 V)
in1:         +0.78 V  (min =  +1.27 V, max =  +0.52 V)   ALARM
AVCC:        +3.39 V  (min =  +2.98 V, max =  +3.63 V)
VCC:         +3.39 V  (min =  +2.98 V, max =  +3.63 V)
in4:         +1.30 V  (min =  +0.93 V, max =  +1.48 V)
in5:         +0.77 V  (min =  +0.06 V, max =  +0.64 V)   ALARM
in6:         +1.06 V  (min =  +0.01 V, max =  +0.03 V)   ALARM
3VSB:        +3.36 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:        +3.34 V  (min =  +2.70 V, max =  +3.30 V)   ALARM
fan1:          0 RPM  (min = 112500 RPM, div = 4)  ALARM
fan2:          0 RPM  (min = 3924 RPM, div = 4)  ALARM
fan3:          0 RPM  (min = 337500 RPM, div = 4)  ALARM
fan5:          0 RPM  (min = 13775 RPM, div = 2)  ALARM
temp1:       +24.0°C  (high = -68.0°C, hyst = -123.0°C)  ALARM  sensor = diode
temp2:       +23.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = diode
temp3:      +127.0°C  (high = +80.0°C, hyst = +75.0°C)  ALARM  sensor = thermistor
cpu0_vid:   +2.050 V

if you want to see the temperature in Fahrenheit then 
#sensors -F

if you want to monitor it live then use the below command

#watch 'sensors | grep "core''


Reading


Sunday, June 17, 2012

Ftp Access to /var/www/html for website editing [CentOS/RHEL + Vsftpd]

1. Create a group for website users , say webgroup   # groupadd webgroup
2. give them proper permissions  : chown -R root:webgroup /var/www/html
3.chmod g+s  /var/www/html    {this will help if a user "x" creates a file/dir then it will be owned by him , so set a SETGID bit to the parent directory so that any new file by default have group id as webgroup}
4. chmod 770 /var/www/html
5. usermod -aG webgroup apache


How to Set VSFTPD

#yum install vsftpd
# service vsftpd start
#chkconfig vsftpd on
# netstat -a | grep ftp


Contents of vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=002
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ftpd_banner=Hello world
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
pam_service_name=vsftpd
userlist_enable=YES
listen=YES
tcp_wrappers=YES


Contents of vsftpd.chroot_list

webftpuser


contents of : cat /etc/pam.d/vsftpd
#%PAM-1.0
auth       required     pam_listfile.so item=user sense=deny file=/etc/vsftpd.ftpusers onerr=succeed
auth       required     pam_stack.so service=system-auth
auth       required     pam_shells.so
account    required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth






Friday, June 15, 2012

Monitor per core CPU utilization in Linux (CentOS/RHEL)

1. Run Top  and press numeric 1 to get core wise CUP utilization
#top
1

Other tags

 Z,B       Global: 'Z' change color mappings; 'B' disable/enable bold
  l,t,m     Toggle Summaries: 'l' load avg; 't' task/cpu stats; 'm' mem info
  1,I       Toggle SMP view: '1' single/separate states; 'I' Irix/Solaris mode

  f,o     . Fields/Columns: 'f' add or remove; 'o' change display order
  F or O  . Select sort field
  <,>     . Move sort field: '<' next col left; '>' next col right
  R,H     . Toggle: 'R' normal/reverse sort; 'H' show threads
  c,i,S   . Toggle: 'c' cmd name/line; 'i' idle tasks; 'S' cumulative time
  x,y     . Toggle highlights: 'x' sort field; 'y' running tasks
  z,b     . Toggle: 'z' color/mono; 'b' bold/reverse (only if 'x' or 'y')
  u       . Show specific user only
  n or #  . Set maximum tasks displayed

  k,r       Manipulate tasks: 'k' kill; 'r' renice
  d or s    Set update interval
  W         Write configuration file
  q         Quit

2. Use Sar

#Sar -A

 

Thursday, June 14, 2012

sosreport in CentOS and RHEL >> ‘Generate debugging information for this system

# yum install sos

“sosreport” will generate a compressed a bz2 file under /tmp.

# /usr/sbin/sosreport

sosreport (version 2.2)

This utility will collect some detailed  information about the
hardware and setup of your Red Hat Enterprise Linux system.
The information is collected and an archive is  packaged under
/tmp, which you can send to a support representative.
Red Hat Enterprise Linux will use this information for diagnostic purposes ONLY
and it will be considered confidential information.

This process may take a while to complete.
No changes will be made to your system.

Press ENTER to continue, or CTRL-C to quit.
 


Press Enter

Please enter your first initial and last name [sapp1-rl]: Mr Aqua
 

Please enter the case number that you are generating this report for:dummy


  Running plugins. Please wait ...

  Completed [53/53] ...
Creating compressed archive...

 

Your sosreport has been generated and saved in:
  /tmp/sosreport-MrAqua-20120614230734-28d7.tar.xz

The md5sum is: ffc2e235390412ccade7e4a1e50428d7

Please send this file to your support representative.

You have mail in /var/spool/mail/root
 


It contains linux configuration files/all startup/shutdown scripts, all kind of current system information (dmidecode, lsmod, lspci, netstat, iptables, rpm, network routes

Thursday, June 7, 2012

passwd: Authentication token manipulation error + CentOS


if you see this error then just run the "pwconv" from root prompt as shown in the example and  you will be all set.

[root@aqua ~]# passwd myuser
Changing password for user myuser.
passwd: Authentication token manipulation error
[root@aqua ~]# pwconv
[root@aqua ~]# passwd myuser
Changing password for user myuser.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@aqua ~]#



Wednesday, May 23, 2012

SSD & CentOS 6+


SSD  & CentOS 6+

SSDs can be divided into three classes, based on throughput:
  • The first class of SSDs use a PCI-Express connection, which offers the fastest I/O throughput compared to other classes. This class also has a very low latency for random access.
  • The second class uses the traditional SATA connection, and features fast random access for read and write operations (though not as fast as SSDs that use PCI-Express connection).
  • The third class also uses SATA, but the performance of SSDs in this class do not differ substantially from devices that use 7200rpm rotational disks.
For all three classes, performance degrades as the number of used blocks approaches the disk capacity. The degree of performance impact varies greatly by vendor. However, all devices experience some degradation.
Enabling discard support is most useful when there is available free space on the file system, but the file system has already written to most logical blocks on the underlying storage device.
At present, ext4 is the only fully-supported file system that supports discard. 

To enable discard commands on a device, use the mount option discard. For example, to mount /dev/sda2 to /data with discard enabled, run:
mount -t ext4 -o discard /dev/sdb1 /data

By default, ext4 does not issue the discard command.
This is mostly to avoid problems on devices which may not properly implement the discard command. The Linux swap code will issue discard commands to discard-enabled devices, and there is no option to control this behavior.

There are basically two big things to do
-        enable discard/trim support in the file system
-       Limit write operations to the SSD. You want to enable discard to deal with underlying drive specific performance degradation that will happen over time

Move /tmp to ram.  This depends on how much ram you have and how much /tmp space you use, but it really helps to limit writes to the SSD

Change the mount options for your ext4 filesystem
-       change data from the default of ordered to writeback. This reduces the journal data to meta-data only, thus limiting writes.
-       change the commit value from the default of 5 seconds to 10, or 15. This gets you a 2 to 3x write savings, though you risk losing a bit more data if you lose power.
-       If you don't need access time records (mtime and ctime should be enough for most folks) disabling atime will also limit write operations. 
Ex:   /dev/sdb1        /      ext4     defaults,discard,data=writeback,noatime,commit=15     1 1
A/ mount file systems with the "noatime" option.
"noatime" prevents the file system from updating file access times.
"noatime" includes "nodiratime" (prevents directory access time updates).

Consider whether you need journals
            File system journals make file system reconstruction (fsck for
example) possible, and running without any journal makes catastrophic
file system failure far more likely. On the other hand, journals
require extra write operations, Sometimes it's easy enough to
reconstruct a file system that it's not worth the cost in terms of SSD
write operations.
echo "noop" > /sys/block/sda/queue/scheduler
in /etc/rc.d/rc.local.
OR
one can eliminate journaling altogether by doing this to a unmounted or read-only ext4
tune2fs -O ^has_journal /dev/sda1
 Then there will be no journal. While you are at it the command:
tune2fs -r 1024 /dev/sda1
will reduce the root-reserved blocks to 1k (4MB) 
Get rid of /tmp
Put it on ramdisk. The X11 server makes a huge number of tiny
writes to /tmp and if these flush to disk at a high rate it creates a
load of writes. Adding this line to /etc/fstab does the trick.
none /tmp tmpfs defaults 0 0

To enable trim, use the "discard' mount option in fstab for all mounted partitions from the SSD. The "swap" partition automatically uses TRIM. For example from /etc/fstab ....

Code:
UUID=ffc6a6fc-1bf3-4f25-ab17-067b0515e85a /   ext4    noatime,discard,data=writeback 1 1
UUID=24941fe7-6d23-4969-951e-0872d4b81b0e /home      ext4    noatime,discard,data=writeback 1 2
UUID=2bbebe51-c0f8-4296-ba0a-e715bf84dc67 swap       swap    defaults                       0 0


Few useful Commands

fdisk -u -l /dev/sdX
cat /sys/block/sda/queue/scheduler
Use iotop -oPa and sort by disk writes to see how much programs are writing to disk
Using “tune2fs –l /dev/sdb”, we can see the file system block size is 4KB with journal turned on.
Using “more /sys/fs/ext4/sdc/lifetime_write_kbytes” to see how much has been written to the disk so far





stop all application/System  services on the box,
unmount sdbX and sdcX
run tune2fs to set stride, stripe-width options
change mounting option on sdb, sdc to use noatime
mount again
start application/System services 



mkfs.ext4 -b 1024 -E stride=128,stripe-width=128 -O ^has_journal /dev/sda1
mkfs.ext4 -b 4096 -E stride=32,stripe-width=32 /dev/sda3 

Ref

Monday, May 21, 2012

Exchange 2007 DG & List of all forwarding address list

Fetch the DG members from Exchange 2007

Get-DistributionGroupMember –identity “group name” | ft name, primarysmtpaddress | Export-CSV c:members.csv



Find all users with Forwarding Address is set

Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, ForwardingAddress, DeliverToMailboxAndForward c:/myfile.txt 









Tuesday, May 15, 2012

Mail Server - TODO

- Check for the open relay  , it should not configured for that :)
- Restrict the application servers by IP to relay email. you can use to test (http://www.abuse.net/relay.html )
- Check for the DNS and Reverse DNS
- Use SPF
- Use AntiSpam & Antivirus tools
- Monitor incoming and outgoing tools.
- Check RBL for the mail server blacklisting
-

Partition Alignment

#sudo fdisk -luc

turn off MSDOS mode

#sudo fdisk -H 32 -S 32 -cu /dev/yourdisk

1 Gigabyte = 2,097,152 sectors
1 Megabyte = 2,048 sectors


total_sectors / 2,097,152 (sectors in 1GB) = Total Gigabytes
remaining_sectors / 2,048 (sectors in 1MB) = Total Megabytes

Example
2,097,152 X 25 = 52,428,800 (25GB)
2,048 X 750 = 1,536,000 (750MB)
(2,097,152 X 12) + (2,048 X 500) = 26,189,824 (12GB+500MB)


Remember: If you're aligning partitions make sure to start at a sector evenly divisable by 512.
When asked for the size of your partition you'll need to prefix a + to your sectors.
Your last partition may consume the rest of the disk without a worry.


Alignment.

thumb rule is all about your partition starting at a sector evenly divisable by 512. The size of your partition and/or where it ends does not matter. As long as your partition starts at a sector divisable by 512 you're good.

If you had the following partitions sizes ready to go and you could sacrifice 512 bytes per partition without a worry, you subtract 1 sector from each partition. Doing it this way insures no gaps between partitions.


52,428,800 (25GB) - 1 sector = 52,428,799
1,536,000 (750MB) - 1 sector = 1,535,999
26,189,824 (12GB+500MB) - 1 sector = 26,189,823


start at 2,048 because this is the most common start sector in almost all guides. The following example assumes you don't mind shaving 512 bytes per partition by subtracting 1 sector each. In other words you don't need the absolute size and in that process create no gaps between partitions.


Start       End
2,048       +52,428,799  # This partition ends at 52,430,847, the next partition starts at 52,430,848 (evenly divisable by 512)
52,430,848  +1,535,999   # This partition ends at 53,966,847, the next partition starts at 53,966,848 (evenly divisable by 512)


The following example assumes you do mind shaving 512 bytes and want absolute sizes. If you need an absolute size per partition and cannot subtract 1 sector per partition you simply start your next partition at a sector evenly divisable by 512.


Start       End
2,048       +52,428,800  # This partition ends at 52,430,848, our next partition cannot start there. It will start at 52,430,848 + 512 = 52,431,360 (evenly divisable by 512)
52,431,360  +1,536,000   # This partition ends at 53,967,360, our next partition cannot start there. It will start at 53,967,360 + 512 = 53,967,872 (evenly divisable by 512)
53,967,872  +26,189,824  # This partition ends at 80,157,696, our next partition cannot start there. It will start at 80,157,696 + 512 = 80,158,208 (evenly divisable by 512)


Reinstalling the agents on ESX

Reinstalling the agents on ESX

  1. Disconnect the ESX host in vCenter Server. Right-click the host and click Disconnect.
  2. Log in as root to the ESX host using an SSH client.
  3. Run this string of commands in the SSH session:

    service mgmt-vmware stop && service vmware-vpxa stop && service vmware-vmkauthd stop && service xinetd restart && rpm -qa | grep -i vpxa | awk '{print $1}' | xargs rpm -ef $1 && userdel vpxuser && rpm -qa | grep -i aam | awk '{print $1}' | xargs rpm -ef $1 && service mgmt-vmware start && service vmware-vmkauthd start

    Note: This is a concatenated list of commands strung together with the "&&" operator. This is useful in stringing together multiple commands as the next command does not start until the previous one has completed successfully.

    These are the commands you are running:
    • service mgmt-vmware stop && service vmware-vpxa stop && service vmware-vmkauthd stop && service xinetd restart stops the management services for the service console.
    • rpm -qa | grep -i vpxa | awk '{print $1}' | xargs rpm -ef $1 removes the vpxa agent.
    • userdel vpxuser removes the vpxa user that is installed once you connect the host to vCenter Server.
    • rpm -qa | grep -i aam | awk '{print $1}' | xargs rpm -ef $1 removes the AAM RPM (HA) which is reinstalled when you configure HA.
    • service mgmt-vmware start && service vmware-vmkauthd start restarts the services.
    • vmware-cmd -l lets you know when hostd is up and running so that you can reattach it to vCenter Server.
    Note: When you see a list of virtual machines output, the command sequence is complete.
  4. Log in to the vCenter Server using VMware Infrastructure/vSphere Client.
  5. Choose the ESX host from the Inventory.
  6. Right-click on the ESX host and click Connect. This step initiates a re-install of the agent.

Friday, May 4, 2012

Create ext4 partition


  1. Upgrade your system: yum update 
  2. Format the partition: mkfs.ext4 /dev/sdxY (replace sdxY with the device to format (e.g. sda1))
  3. Mount the partition
  4. Add an entry to /etc/fstab, using the filesystem 'type' ext4 
 df -T | awk '{print $1,$2,$NF}' | grep "^/dev"

Format an external/Second HDD with ext4

First,  delete any existing partition and create a new Linux partition using fdisk:

1
# fdisk /dev/sdb
Assuming /dev/sdb is the external or second hard disk. Use d to delete the partition and use n to create a new partition. 83 is the ID of the native Linux partition.
Them,  use mkfs.ext4 to format the partition with ext4:

1
# mkfs.ext4 /dev/sdb1
Note that mkfs.ext4 expects a partition as its argument.
use tune2fs to adjust some parameters:

1
2
# tune2fs -m 0 /dev/sdb1
# tune2fs -L secondDisk01 /dev/sdb1
The -m option is for adjusting the percentage of reserved blocks. The reserved blocks are used by privileged processes which is by default 5% of the hard disk size. Since I’m using the external/second hard disk solely as a storage, I set this to 0 so I can also use those 5% for storage. The -L option is for labeling the filesystem.