Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Wednesday, July 4, 2018

How to Increase Root Partition of CentOS 7 VMware

Part 1: Add a vmdk

1. Shutdown your CentOS 7 VMware and re-launch VMware player

2. Select your CentOS 7 VMware and click "Edit Virtual Machine Settings"


3. In the Hardware tab, click "Add.." button. "Add Hardware Wizard" dialog box will open


4. In the "Add hardware Wizard", select "Hard Disk". click "Next >"

5. Select "SCSI" as disk type. click "Next >"


6. Select "Create a new virtual disk". click "Next >"


7. Specify disk size in GB and select "Split virtual disk into multiple files." click "Next >"


8. Specify file name of the disk file. recommended to leave it as default. click "Finish".


9. In the "Virtual Machine Settings", you will now see "New Hard Disk" in the "Hardware" tab



Part 2: Configure LVM

1. Scan the host
find /sys -type f -iname "scan" -print

2. You will see the following list as shown below
[root@centos7vm localuser]# find /sys -type f -iname "scan" -print
/sys/devices/pci0000:00/0000:00:07.1/ata1/host1/scsi_host/host1/scan
/sys/devices/pci0000:00/0000:00:07.1/ata2/host2/scsi_host/host2/scan
/sys/devices/pci0000:00/0000:00:10.0/host0/scsi_host/host0/scan

3. Rescan the SCSI bus by passing to each host the "- - -".
# echo "- - -" > /sys/devices/pci0000:00/0000:00:07.1/ata1/host0/scsi_host/host0/scan
# echo "- - -" > /sys/devices/pci0000:00/0000:00:07.1/ata2/host1/scsi_host/host1/scan
# echo "- - -" > /sys/devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2/scan

4. create new pv for the new disk
pvcreate /dev/sdb

5. Now check if the new disk is now available
ls -ltr /dev/disk/by-id/

6. You will see the following list from above command
[root@centos7vm localuser]# ls -lrt /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Jul  4 15:36 lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb
lrwxrwxrwx 1 root root  9 Jul  5  2018 ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001 -> ../../sr0
lrwxrwxrwx 1 root root 10 Jul  5  2018 lvm-pv-uuid-GEwd0z-EDrV-hdB6-0o8M-S8eL-RzqU-gnSCIh -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-uuid-LVM-VhqLdEZRC9TbJfAu3v0q3aUREkRKgZbQl7dtNtoPOoI8yhrsKP3RFs70WdmfTP4o -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-name-centos_centos7vm-root -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-uuid-LVM-VhqLdEZRC9TbJfAu3v0q3aUREkRKgZbQL9essrhuujmOBF6M9VcK2LK0BUEeWlMR -> ../../dm-1
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-name-centos_centos7vm-swap -> ../../dm-1

7. One of the disk listed above points to our new disk /dev/sdb. in our above list, it's 
lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb

8. Get your volume group of the root partition that we wish to expand
vgdisplay | grep 'VG Name'

    the output will be as shown below where "centos_centos7vm" is the volume group
[root@centos7vm localuser]# vgdisplay | grep 'VG Name'
  VG Name               centos_centos7vm

9. Let's now extend the root partition with the new disk
vgextend centos_centos7vm /dev/disk/by-id/lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb

10. Do this command to finalize extending the root partition with the new disk. Note that the command says +20GiB but you can set the value to the size you set your new disk.
lvextend -r -L +20GiB /dev/centos_centos7vm/root

   

11. Finally, verify the change
[root@centos7vm localuser]# df -k
Filesystem                        1K-blocks     Used Available Use% Mounted on
/dev/mapper/centos_centos7vm-root  41141472 18793492  20444880  48% /
devtmpfs                            2006452        0   2006452   0% /dev
tmpfs                               2021876      156   2021720   1% /dev/shm
tmpfs                               2021876     9180   2012696   1% /run
tmpfs                               2021876        0   2021876   0% /sys/fs/cgroup
/dev/sda1                            999320   121212    809296  14% /boot
tmpfs                                404376        0    404376   0% /run/user/0
tmpfs                                404376       12    404364   1% /run/user/1001







Monday, June 18, 2018

READ THIS if you are trying to use Fademo (GEM Host Simulator) on any platform

CentOS7

  • must create a symbolic link libexpat.so.0 -> /usr/lib/libexpat.so.1.6.0 as fademo references to libexpat.so.0. Note that in previous versions of CentOS, this link may point out to an older version of libexpat (e.g libexpat.so.1.5.0 in CentOS 6.2) libexpat but that's fine. it works.

Tuesday, March 20, 2018

How to Fix Unison 6.2 VM's issue where lmhostid returns "" and not mac address

edit /etc/udev/rules.d/70-persistent-net.rules

it contains:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:aa:6d:77", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

just change NAME= to NAME="eth0", keep the rest as is.



edit /etc/sysconfig/network-scripts/ifcfg-eth0

it contains:
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:0C:29:AA:6D:77"
DOMAIN="ltx.com ltx-credence.com ltxc.com"
IPV6INIT="no"
IPV6_AUTOCONF="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"

make sure the HWADDR is set to correct mac address. you can get mac address from call to ifconfig


restart the system

Sunday, March 18, 2018

How To Install Unison In CentOS

Instructions for extracting Evx releases and patches.

1.  If you do not have gnu tar and gzip, retrieve the files
    gnutar and gzip. By clicking the download link.
    

2. Retrieve the appropriate release. By clicking the download link. 

   

   NOTE: You will need approximately 500 Meg free on your machine
   to hold the file, and approximately 2 Gig to extract it.
   

3. Once the transfer is complete, you can extract the file.  You
   must use gnu tar to extract the file.  The directory nesting
   of an Evx release is too deep for most unix tars.
   Again, make sure you have at least 2 Gig free in the directory
   where you will be extracting the tar file.
   Assuming that gnutar, gzip and the downloaded archive are all
   in the same directory, run the following commands to extract the
   archive:

   Make gnutar and gzip executable
   # chmod 755 gnutar gzip

   Uncompress the archive
   # ./gzip -dc R12.2.0.gnutar.gz | ./gnutar xf -
   
   Uncompress command for R12.4.0 and above:
   # ./gzip -dc R12.4.0.gnutar.gz | ./gtar xf - 

   Uncompress command for Linux Example:
   # /bin/gzip -dc R15.4.0.i686_linux_2.6.9.gnutar.gz | /bin/gtar xf -

4. Once the archive has been extracted, you will find installation
   instructions in the doc directory








~Uxx/x86*/pkgs/install_evx

[root@centos62 pkgs]# ./install_evx
QT v5.2.1 can be installed to a local directory or to a network directory.
You can also link to an existing directory that is network accessible.
Would you like to link to an existing installation?: (Y/[N]): ^C
You have new mail in /var/spool/mail/localuser
[root@centos62 pkgs]# pwd
/home/localuser/Desktop/U5.2.2.1/x86_64_linux_2.6.32/pkgs
[root@centos62 pkgs]# ./install_evx
QT v5.2.1 can be installed to a local directory or to a network directory.
You can also link to an existing directory that is network accessible.
Would you like to link to an existing installation?: (Y/[N]): N

The default location for v5.2.1 is /opt/ltx/Qt
Hit enter to use /opt/ltx/Qt or enter an alternate directory:
Continue installation using /opt/ltx/Qt? ([Y]/N): Y
Installing QT ...
QT install complete
Preparing...                ########################################### [100%]
package LTXC3pdi_installer-1.2-1.x86_64 (which is newer than LTXC3pdi_installer-1.1-1.x86_64) is already installed
The default location for U5.2.2.1 is /opt/ltx/releases
Use the default location?
1. Yes
2. No
USE DEFAULT LOCATION [1]: Y
Use the default location?
1. Yes
2. No
USE DEFAULT LOCATION [1]: 1
Installing LTXevx .....
Preparing...                ########################################### [100%]
   1:LTXevx-U5.2.2.1        ########################################### [100%]
Updating doc indexes for add-ons

Make this the default tester release?

1.   Yes
2.   No

SELECT DEFAULT RELEASE [1]: 1

The links in /opt/ltx/bin contain release independent
executables (i.e. launcher) and should always point to
the latest (highest numbered) installed release.
Currently these files are linked to nothing.
Should these links be changed to point to this release?

Make this the default tester release
for /opt/ltx/bin links?

1.   Yes
2.   No
DEFAULT RELEASE FOR BIN LINKS [1]: 1
Adding support for rsh to /etc/pam.d/rsh
Adding support for rlogin to /etc/pam.d/rlogin
Setting U5.2.2.1 as the default release
Setting U5.2.2.1 as the default release for bin objects

This release supports permission controls that
can restrict one user from stopping another user's
tester processes.

Refer to the documentation for instructions on
setting up permission controls with the
/opt/ltx/site/RestartTester.Users file.

Installing common files ..... passed
Preparing...                ########################################### [100%]
   1:LTXCglobalrules        ########################################### [100%]
Created /etc/udev/rules.d/98-LTXCglobal.rules
Preparing...                ########################################### [100%]
package LTXCpython-2.6.4-1.i686 is already installed

The default location for LTXCfmitool-43.0-1.i686 is /opt/ltx
Press Enter to use /opt/ltx or input an alternate directory:
Continue installation using /opt/ltx? ([Y]/N): Y
Installing LTXCfmitool-43.0-1.i686.rpm
package LTXCfmitool-44.0-1.i686 (which is newer than LTXCfmitool-43.0-1.i686) is already installed
Error installing LTXCfmitool-43.0-1.i686.rpm
/opt/ltx/releases/U5.2.2.1/x86_64_linux_2.6.32/bin/fmiTool: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory

To complete the installation, set the LM_LICENSE_FILE variable, then run:

/opt/ltx/releases/U5.2.2.1/x86_64_linux_2.6.32/bin/fmiTool -c U5.2.2.1
Preparing...                ########################################### [100%]
   1:hedgehog-U5.2.2-Rev1   ########################################### [100%]
Updating doc indexes for add-ons
Preparing...                ########################################### [100%]
   1:pixel-U5.2.2-Rev1      ########################################### [100%]
Updating doc indexes for add-ons
Install Acrobat for access to help documentation? ([Y]/N): N
Install of Unison and related packages complete.
You have new mail in /var/spool/mail/localuser

Sunday, January 21, 2018

GEM FAQ's


How to enable GEM in Unison/CentOS
  • SECS/Gem is initially disabled in Unison. To enable SECS/Gem in Unison, you will need to run the config_gem command from xterm. This command is found in the /ltx/com directory. 
  • config_gem <tester_name> [-enable|-disable] [-verbose] [-reset]
  • The execution of config_gem tool will create the gem_config file for CGem in the tester pwrup directory
    • /ltx/testers/<tester_name>/pwrup/gem_config

SECS-GEM on CentOS 7.2, U1709

  • make sure to yum install the latest version. the first U1709 version release has issue on GEM component and may require update so...


Monday, May 1, 2017

How To Compile a C++ Source Code in CentOS

  • Linux (CentOS)
    • g++ <source code>
      • g++ foo.c where foo.c is the source code, output will be a.out
    • g++ -o <output> <source code>
      • g++ -o foo foo.c where foo is executable, and foo.c is the source code

Friday, July 15, 2016

EIM FAQ

  • MethodCompiler location
    • Solaris 8 Sun OS: /opt/ltx/bin/, /opt/ltx/releases/<release>/DNT/customer/bin
    • CentOS 4.6: /opt/ltx/releases/<release>/i686*/bin
  • Default EIM source code location
    • enVision (Solaris): /opt/ltx/releases/<version>/customer/test_methods/
    • enVision (CentOS 4.6): 
  • Custom EIM binary location (where the compiled "evso" file is to be placed)
    • enVision (Solaris): 
      • /opt/ltx/releases/<version>/customer/custom_methods/DNT
      • /opt/ltx/releases/<version>/customer/custom_methods/FX1
      • DNT for CX testers while FX1 for FX testers but need to confirm this 
    • enVision (CentOS 4.6): 
      • /opt/ltx/releases/<version>/i686*/custom_methods/DNT
      • /opt/ltx/releases/<version>/i686*/custom_methods/FX1
      • DNT for CX testers while FX1 for FX testers 
  • Command to compile EIM source code
    • >MethodCompiler -t DNT/FX1 -f <file>.tmk
      • Note: Some systems required you to set the full path of MethodCompiler command. 
      • Specify either DNT for DX systems,  or FX1 for X-series systems
  • Do's in Developing EIM 
  • Don'ts in Developing EIMl
  • How to Properly load an EIM into MethodTool
    • enVision only loads EIM's (evso files) that are located in default EIM source code location and custom EIM binary locations.
    • If you have an EIM source code and wishes to load it into MethodTool, follow this:
      • open OpTool>MethodTool
      • in OpTool>MethodTool>Method Directory:, specify the path where your EIM source code is located (cxx, hxx, mid, makefile, etc...)
      • set OpTool>MethodTool>Edit>Tool Mode>External Interface. If you are in the right path, a pop-up will appear letting you select which EIM object to load. select which one you prefer
      • press OpTool>MethodTool>Reload
      • If successful, press OpTool>MethodTool>ExternalInterface and select your EIM. Press OK and your EIM will be loaded successfully

Monday, March 7, 2016

How to Install GIT on CentOS (4.6)

Installing GIT on CentOS 4.6
The version that works for me is v1.7.8.1
I tried the latest version (as of this writing) v2.7 but I kept failing on ./configure

Here are the steps:

$ wget http://git-core.googlecode.com/files/git-1.7.8.1.tar.gz
$ tar xvzf git-1.7.8.1.tar.gz
$ cd git-1.7.8.1
$ ./configure
$ make
$ make install

In case our are prompted to install required libraries GIT has dependency on, run the below command to install them:

$ sudo yum install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel



If you are having trouble with yum, maybe you need to reconfigure your yum. Do the following:

1. Open /etc/yum.repos.d/CentOS-Base.repo in an editor
2. Comment out the "mirrorlist" entries.
3. Uncomment the "baseurl" entries and change them to http://vault.centos.org/4.9/os/$basearch