Friday 27 April 2012

How to clone data VG & restore to other system without downtime/fast clone


Steps: 
This steps have been done on AIX 6.1. TL6
 
Map the hdiskY or lun to both the system

On system1:-

lspv

cfgmgr   ** to get new hdiskY/lun

Now Extendvg

extendvg vgname hdisky/lun

-----------------------------------------------------------------------------------------------

******if you are unable to extendvg due to Max pp limitation then change the Vg properties.

chvg -t 2|3|4 (etc)  vgname
-----------------------------------------------------------------------------------------------
 

extendvg vgname hdiskY

mirrorvg vgname hdiskY

lsvg -l vgname   * check all fs are syncd and consistent, else wait to get it consistent.

Now split the VG

splitvg -y new_vgname -c 2 -i old_vgname  

 ( -i is used so that hdiskY cant join the vg again and lv/fs remain consistent, else if you need the hdisk to rejoin the vg then dont use -i , -c 2 is to separate the second copy of lv i.e hdiskY)

varyoffvg new_vgname

exportvg new_vgname

rmdev -Rdl hdiskY
=======================
ON System 2:

Then map same hdiskY/lun to different system if you have not done earlier

lpsv

cfgmgr

lspv

importvg -y vgname( name you like to put) hdiskY

cp -p /etc/filesystems /etc/filesystems_copy

edit /etc/filesystems  remove unwanted prefix like /fs/fs etc
mount all

check VG is doenst have any stale Lv.

Check files and application.
Remove mapping of hdisky/lun from system1.

Monday 27 June 2011

your huwawei modem is giving error: > > Cannot open /dev/ttyUSB0: Device or resource busy

If your huwawei modem is giving u the error :
> > Cannot open /dev/ttyUSB0: Device or resource busy
 if you do this command: 
 lsusb
 Bus 002 Device 019: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270 HSDPA/HSUPA Mode
 and you do this command
ls -ll /dev
crw-rw----  1 root uucp      188,   0 Jun 27 14:18 ttyUSB0
crw-rw----  1 root uucp      188,   1 Jun 27 14:18 ttyUSB1
 and you have those ttyUSB 
and dmesg gives you this outpu
dmesg
[20567.359261] option 2-1:1.0: GSM modem (1-port) converter detected
[20567.359379] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[20567.362205] option 2-1:1.1: GSM modem (1-port) converter detected
[20567.362296] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
[20567.363034] scsi47 : usb-storage 2-1:1.2
[20567.364026] scsi48 : usb-storage 2-1:1.3
[20568.368922] scsi 47:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[20568.371161] scsi 48:0:0:0: Direct-Access     HUAWEI   MMC Storage      2.31 PQ: 0 ANSI: 2
[20568.371366] sd 48:0:0:0: Attached scsi generic sg2 type 0
[20568.380524] sr1: scsi-1 drive
[20568.380662] sr 47:0:0:0: Attached scsi CD-ROM sr1
[20568.380742] sr 47:0:0:0: Attached scsi generic sg3 type 5
[20568.383510] sd 48:0:0:0: [sdb] Attached SCSI removable disk

and comgt is giving u the similar
 
comgt -x -d /dev/ttyUSB0
High speed overide (115200 is now 57600).
SIM ready
Waiting for Registration..(120 sec max)
Registered on Home network: "xxxxx",2
Signal Quality: 26,99

check if the directory lock is in /var  and create one
 
mkdir /var/lock

ls -ll /var/lock
total 4
-rw-r--r-- 1 root root 11 Jun 27 13:11 LCK..ttyUSB0
 
Good luck and enjoy the surfing, do not forget to like my coments if ithas helped you
 



Wednesday 25 May 2011

Upgrade AIX from 5.3 TL12 to AIX 6.1 TL5 and challenges


PHASE I: Checking System
  • Ensure you do a full system backup and ensure that you create a mksysb before upgrading AIX.
  • Check if the hardware microcode is up to date - see the microcode update document on this web site.
  • Ensure all hardware including external devices are connected and powered on.
  • Check for any existing faults on the server using the command errpt -a and fix as required.
  • Ensure that there is enough free disk space available.
  • On the server you want to upgrade check what disk rootvg is installed on. To do this type lsvg -p rootvg. In this case I found rootvg to be installed on hdisk0.
  • Check that the CDROM drive is listed in the bootlist before the hard disk by typing bootlist -m normal -o If the CD drive is not listed before the hard disk i.e. hdisk0 cd0, then change the boot order by typing bootlist -m normal cd0 hdisk0.
  • It is advisable to reboot the server before updating it to ensure that if the server fails to reboot the cause can be more easily determined and not attributed to the update process. To reboot the server shutdown any applications and then type shutdown -Fr.
  • Also run lppchk -v, this will check to see if all the currently installed software is correctly entered in the Software Vital Product Database (SWVPD) and that all filesets have all the required requisites and are completely installed.
  1. Mksysb backup
Mksysb has been done 
  1. Updating MICROCODE

the server was sitting at this microcode:
lsmcode
The current permanent system firmware image is SF240_202.
The current temporary system firmware image is SF240_202.

I have downloaded SF240_403 and as we are going to the same update only the microcode were be disruptive.
Steps:
1. Transfer the microcode rpm file to the server: /xxxx
01SF240_403
2.go to the directory and perform a rpm extract like this
rpm -Uvh –ignoreos /xxxx/01SF240_403/01SF240_403_382.rpm
and the extracted file will be going to /tmp/fwupdate
3.Install extracted microcode

After updating
cd /tmp/fwupdate
/usr/lpp/diagnostics/bin/update_flash -f  01SF240_403_382
and system has rebooted wit the following code: CA2799FD and CA2799FF.
After reboot:
The current permanent system firmware image is SF240_202
The current temporary system firmware image is SF240_403
  1. Changing the bootlist info:

before

bootlist -m normal -o
hdisk0 blv=hd5
hdisk1 blv=hd5
cd0
rmt0
command: bootlist -m normal cd0 hdisk0 hdisk1 rmt0



After:
bootlist -m normal -o
cd0
hdisk0 blv=hd5
hdisk1 blv=hd5
rmt0
  1. Check for any existing faults on the server using the command errpt -a and fix as required
errpt -a gives no result everything is fine
  1. Ensure that there is enough free disk space available
lsvg -L rootvg
VOLUME GROUP: rootvg VG IDENTIFIER:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1092 (139776 megabytes)
MAX LVs: 256 FREE PPs: 881 (112768 megabytes)
LVs: 12 USED PPs: 211 (27008 megabytes)
OPEN LVs: 11 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
I do have space on my internal disk
  1. Where rootvg is installed

lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 546 438 109..69..42..109..109
hdisk1 active 546 443 109..74..42..109..109
  1. Check inconsistent software
lppchk -v
no inconsistent software


PHASE II: UPGRADING

Put the AIX 6.1 base operating system DVD into the CD/DVD drive
The console for this upgrade was a dumb vt100 type terminal, the display may be slightly different for a graphical display
Reboot the server type shutdown -Fr (being a root)
The server should boot off the media in the CD/DVD drive and a screen should display some selectable options as follows
-----------------------------------------------------------------------------------------------------------------------
1 = SMS menu                    5 = Default bootlist
8 = Open Firmware               6 = Stored bootlist
-----------------------------------------------------------------------------------------------------------------------
Ignore these for now and the installation should continue
The next screen should display
-----------------------------------------------------------------------------------------------------------------------
Starting Software
Please wait
-----------------------------------------------------------------------------------------------------------------------
Next screen
-----------------------------------------------------------------------------------------------------------------------
Please define the System Console
Type a 1 and press Enter to use this terminal as the system console
-----------------------------------------------------------------------------------------------------------------------
Type 1 and press enter
-----------------------------------------------------------------------------------------------------------------------
1. Type 1 and press Enter to have English during install
>>>choice[1]:
-----------------------------------------------------------------------------------------------------------------------
Again type 1 and press enter
-----------------------------------------------------------------------------------------------------------------------
Welcome to Base Operating System Installation and Maintenance
Type the number of your choice and press Enter. Choice is indicated by >>>
>>>1. Start Install now with Default Settings
   2. Change/show Installation Settings and Install
   3. Start Maintenance Mode for System Recovery
   4. Configure Network Disks (iSCSI)
   88 Help?
   99 Previous Menu
   Choice[1]: 2
-----------------------------------------------------------------------------------------------------------------------
Type 2 and press enter to change the installation settings
-----------------------------------------------------------------------------------------------------------------------
Installation and Settings
Either type 0 and press Enter to install with current settings 
or type the number of the setting you want to change and press Enter
1. System Settings:
   Method of Installation ......................Migration
   Disk where you want to Install ..............hdisk0    
2. Primary Language Environment settings (AFTER Install):
   Cultural Conventions ........................English (United States)
   Language ....................................English (United States)
   Keyboard ....................................English (United States)
   Keyboard Type ...............................Default
3. Security Model...............................Default
4. More Options (Software install options)
>>> 0 Install with the current settings listed above
88 Help?
99 Previous Menu
>>> Choice[0]:
-----------------------------------------------------------------------------------------------------------------------
Change the "Method of Installation" to "Migration" if not already selected
Ensure that the "Disk where you want to Install" is set to the correct disk
Change the "Cultural Conventions", "Language" and "Keyboard" to your prefered location
Type 4 and press enter for "More Options (Software install options)"
-----------------------------------------------------------------------------------------------------------------------
Install Options
1. Enable System Backup to install any system....Yes
2. Import User Volume Groups.....................Yes
3. Remove Java 1.1.8 Software....................No
>>> 0 Install with the current settings listed above
88 Help?
99 Previous Menu
>>> Choice[0]:
-----------------------------------------------------------------------------------------------------------------------
Check the values for the fields are as listed above and then press enter to accept the default value of 0 "Install with the current settings listed above (Adjust according to your language and keyboard)
-----------------------------------------------------------------------------------------------------------------------
Migration Installation Summary
Disks: hdisk0
Cultural Convention: en_GB
Language: en_US
Keyboard: en_GB
Import User Volume Groups: Yes
Enable System Backup to install any system: Yes
Remove Java 1.1.8 Software: No
>>> 1 Continue with Install
88 Help?
99 Previous Menu
>>> Choice[1]:
-----------------------------------------------------------------------------------------------------------------------
Check the fields if all the values as correct then press enter to accept the default value 1 "Continue with Install
-----------------------------------------------------------------------------------------------------------------------
Migration menu preparation
Please wait
Approximate                     Elapsed time
% task complete                 (in minutes)
-----------------------------------------------------------------------------------------------------------------------
Next screen
-----------------------------------------------------------------------------------------------------------------------
Migration Confirmation
Either type 0 and press Enter to continue the installation 
or type the number of your choice and press Enter
1. List the saved Base System Configuration files which will not be merged into the system
   These files are saved in /tmp/bos
2. List the filesets which will be removed and not replaced
3. List directories which will have all current contents removed
4. Reboot without migrating
Acceptance of license agreements is required before using system. 
You will be prompted to accept after the system reboots
>>> 0 Continue with the migration
WARNING: Selected files, directories and filesets (installable options) 
from the Base System will be removed. 
Choose 2 or 3 for more information
88 Help?
99 Previous Menu
>>> Choice[0]:
-----------------------------------------------------------------------------------------------------------------------
Have a look at each menu option then type 0 and press enter to "Continue with the migration"
-----------------------------------------------------------------------------------------------------------------------
Saving system configuration files in /tmp/bos
Removing obsolete filesets, directories and files
Installing Base Operating System
Please wait
Approximate                     Elapsed time
% task complete                 (in minutes)
-----------------------------------------------------------------------------------------------------------------------
The installation should continue and eventually finish and present a login screen
Login and check the version of AIX by typing
oslevel -s
6100-05-01-1016



Challenge:
After installing AIX 6.1 you may have the challenge of not having a console, the problem is that the system arriving at this step of inittab it hangs
install_assist:2:wait:/usr/sbin/install_assist </dev/console >/dev/console 2>&1
this line is to complete install by smitty ( very crucial for fresh install not migration)
so access the system by telnet or SSH and comment out this in inittab line and reboot the system.
Good Luck and do not forget to vote me!!

Tuesday 5 April 2011

Extend boot volume on Windows Server 2000/2003

 
Before you begin, make sure that you do not have an active snapshot on the VM, extending a virtual disk with a snapshot will cause corrpution

Extend the boot volume of Windows Server 2003 Virtual Machine
To start, I have a Windows Server 2003 Virtual Machine that has a 5.3G disk allocated to it, I need to expand this disk to 10G.



Step 1: Power off the virtual machine that holds the boot volume that you want to extend.

Step 2: Make a backup copy of your virutal disk, this is optional but if you mess up don't call me unless you're willing to pay.

Step 3: From the service console, increase the size of the .dsk or .vmdk virtual disk file. This can also be accomplished through the Virtual Infrastructure Client if you are using VirtualCenter 2.x+.

[root@esx-test local]# ls -lah test.vmdk
-rw-------    1 root     root         5.4G Jul 18 13:57 test.vmdk
Extend the virtual disk with vmkfstools. The input to the -X switch is the size that you want the disk file to be not the size you want to extend the disk file by.
[root@esx-test local]# vmkfstools -X 10G test.vmdk
View the new size of test.vmdk
[root@esx-test local]# ls -lah test.vmdk
-rw-------    1 root     root          10G Jul 18 13:57 test.vmdk
Step 4: For this step you will need an additional Virtual Machine running Windows Server 2003. Power off the second Virtual Machine, and add the disk from the first Virtual Machine to it through the mui. Power up the second Virtual Machine and verify that the imported disk has unallocated space on it.



From the run menu type "diskpart.exe" to enter the command line utility to resize disk partitions in Windows Server 2003.



The command list volume will show you all the available volumes. Select your volume as shown below. select volume 1 corresponds to the "D" volume that I want to exntend. Finally extend the volume with the extend command.



If all goes well, the partition will be immediately exnteded under the Disk Management snap in.



Step 5: Shut down the second Virtual Machine and remove the disk from the second Virtual Machine. Power on the first Virtual Machine and check out your new space.





VirtualBOX setup after upgrading Kernel

>>>  - Run "sudo /etc/rc.d/vboxdrv setup", every time your kernel is upgraded,
>>>    to compile virtualbox driver modules for a new kernel version.
>>>  - Add your users to the vboxusers group:
>>>      gpasswd -a USERNAME vboxusers
>>>  - Customize your "/etc/conf.d/vboxdrv"; usually, defaults are OK.
>>>  - Add "vboxdrv" to DAEMONS array in your "/etc/rc.conf", if needed.
>>>  - If USB does not work for you out-of-the-box, add the following line
>>>    to your "/etc/fstab":
none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0
Optional dependencies for virtualbox-sun
    alsa-lib: for ALSA support
    dkms: for building and loading vboxhost modules
    libgl: for shared OpenGL support
    libxt: for shared clipboard support
    mesa: for OpenGL support
    pulseaudio: for PulseAudio support
    python2: for VirtualBox SDK
    qt: for Oracle VirtualBox QT4 GUI on X-Window System
    sdl: for Oracle VBoxSDL and VirtualBox GUI on console
    vfuse: for mounting VBox (VDI/VMDK/VHD) disk images