יום שלישי, 21 במאי 2013

Add new hardware on Linux CentOS / Redhat - Persistent net rules

1.       Setup -->Text Mode Setup Utility -->Change Network Configuration IP & name
2.       Remove “HWADDR” form all ethX:
a.       Path: /etc/sysconfig/network-scripts/ifcfg-ethX
3.       Remove Persistent rules:
a.       Rm –rf  /etc/udev/rules.d/70-persistent-net.rules

יום שני, 13 במאי 2013

Extend an LVM root filesystem

#fdisk -l
#fdisk /dev/sdb
e8 
w

#lvdisplay
#pvcreate /dev/sdb2

#vgextend VolGroup00 /dev/sdb2
(this associates the physical volume with our volume group VolGroup00)
At this point our new partition is available in our volume group as free space.  We use the following command to confirm that and also to record the amount of free space:
#vgdisplay
From the output of this command we should see an entry called “Free PE” – this is the free physical extents (in other words our free space).  We can use this value to extend our existing logical volume LogVol00 for example (this shows 1234 free extents):
#lvextend -l +1234 /dev/VolGroup00/LogVol00
After this command completes the logical volume LogVol00 will be extended by the amount of free space our new partition has.  You can display this using the command:
#lvdisplay
You should notice the “LV size” has increased.  At this point our / filesystem still doesn’t know about the new space, so the last piece of the jigsaw is to let it know about the new space:
#resize2fs /dev/VolGroup00/LogVol00
Once this command completes our / filesystem should see our new free space.  You can confirm this using the command:
#df -h /

useful link:
http://geekswing.com/geek/unix/extending-a-linux-disk-with-lvm-extending-root-partition/


Intermission to add new disk and power on if necessary
# fdisk -l
To see the new disk size on /dev/sda which we just extended, or to see new disks we just presented (/dev/sdb, /dev/sdc, etc.)
# fdisk /dev/sda
To create new partitions for the OS to use. These new partitions will be added to the VG so we can extend the LV that the “/” partition is on. My newly created partition in the example is /dev/sda3. For new disks you would use /dev/sdb, or /dev/sdc. If you are using an extended /dev/sda like in my case, you will need to reboot for the changes to be seen
# fdisk -l
To see the new partitions
# pvdisplay
View current physical volumes a.k.a. pv
# pvcreate /dev/sda3
Allow Linux OS to use the new partition in LVM
# pvdisplay
See the new pv /dev/sda3
# vgdisplay
View the current volume groups
# vgextend vg_cents6364bit /dev/sda3
Add the new PV /dev/sda3 to the existing VG vg_cents6364bit
# vgdisplay
Now you can see the new size of the VG vg_cents6364bit. Note the new amount of free PE’s (physical extents)
# lvdisplay
View the current LV. In my example, /dev/vg_cents6364bit/lv_root which is the root partition
# lvextend -l +2559 /dev/vg_cents6364bit/lv_root
Now make the LV larger. Growing the LV /dev/vg_cents6364bit/lv_root by 2559 PEs
# lvdisplay
Now you can see the larger size of the LV
# resize2fs /dev/vg_cents6364bit/lv_root
Online resize of the actual filesystem now on that LV
# df -h
You can see the new size now using the “df” command

DONE!!

יום ראשון, 12 במאי 2013

Failure to install VMware Tools: Cannot find the answer BINDIR in the installer database (1013159)

Details

If a VMware Tools installation is stopped before it can set the BINDIR (which occurs after the first prompted question), the installer is stopped prematurely and displays the following message:

A previous installation of VMware Tools has been detected.

The previous installation was made by the tar installer (version 4).

Keeping the tar4 installer database format.

You have a version of VMware Tools installed. Continuing this install will
first uninstall the currently installed version. Do you wish to continue?
(yes/no) [yes]
 
If you select yes, the following error message appears:

Error: Unable to find the binary installation directory (answer BINDIR)
in the installer database file "/etc/vmware-tools/locations".

Uninstall failed. Please correct the failure and re run the install.

Execution aborted.

Solution

To solve this issue, remove the /etc/vmware-tools/locations file and reinstall VMware Tools.


Link: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1013159

How to install VMware tools on Centos 6.4 Redhat 6.4 RHEL Fedora 18

1. Open Vmware Worstation or ESX console
2. Choose your CentOS or Redhat or Fedora Server  which you want to install vmware tool.
3. Choose VM tab –> Install VMware tools Mount cd to Centos Server and install VMware-tools

[root@Centos6 ]# mount /dev/cdrom /mnt
[root@Centos6 ]# cd /mnt
[root@Centos6 mnt]# cp VMwareTools-* /tmp
[root@Centos6 mnt]#cd /tmp
[root@Centos6 tmp]# tar -xzvf VMwareTools-*
[root@Centos6 tmp]# cd vmware-tools-distrib
[root@Centos6 vmware-tools-distrib]# ./vmware-install.pl -d