Monday, November 9, 2015

How to find if its VM or Real host

Linux -

    dmidecode | grep -i vmware

AIX -

    nonlpar# umame -L
    -1 NULL

    lparhost# uname -L
    5 lparhost

Solaris -

    bash-3.00# prtdiag -v | head -3
    System Configuration: VMware, Inc. VMware Virtual Platform
    BIOS Configuration: Phoenix Technologies LTD 6.00 10/13/2009

    bash-3.00# modinfo | grep -i vm
    148 fffffffff7e71000 3b38 244 1 vmxnet3s (VMware EtherAdapter v3 b341836)
    205 fffffffff78e7000 21b0 230 1 vmmemctl (VMware Memory Control b341836)

Thursday, November 5, 2015

Adding a Swap File to an RHEL6 System

Identifying Current Swap Space Usage

The current amount of swap used by an RHEL 6 system may be identified in a number of ways.


# free -k
             total       used       free     shared    buffers     cached
Mem:       3082356    2043700    1038656          0      50976    1646268
-/+ buffers/cache:     346456    2735900
Swap:      4192956          0    4192956



Swapon command with option -s, displays the current swap space in KB.

# swapon -s
Filename                        Type            Size    Used    Priority
/dev/sda2                       partition       4192956 0       -1
 

# cat /proc/swaps
Filename                        Type            Size    Used    Priority
/dev/sda2                       partition       4192956 0       -1

Adding a Swap File to an RHEL 6 System

The following dd command example creates a swap file with the name “myswapfile” under /root directory with a size of 1024MB (1GB).

# dd if=/dev/zero of=/root/myswapfile bs=1M count=1024
1024+0 records in
1024+0 records out

# ls -l /root/myswapfile
-rw-r--r--    1 root     root     1073741824 Aug 14 23:47 /root/myswapfile
 
Configure the file as swap:
Change the permission of the swap file so that only root can access it.

# chmod 600 /root/myswapfile

Make this file as a swap file using mkswap command.

# swapon /root/myswapfile
 
Verify whether the newly created swap area is available for your use.

 
# swapon -s
Filename                        Type            Size    Used    Priority
/dev/sda2                       partition       4192956 0       -1
/root/myswapfile                file            1048568 0       -2

# free -k
             total       used       free     shared    buffers     cached
Mem:       3082356    3022364      59992          0      52056    2646472
-/+ buffers/cache:     323836    2758520
Swap:      5241524          0    5241524

Finally, modify the /etc/fstab file to automatically add the new swap at system boot time by adding the following line:  

/root/myswapfile    swap    swap   defaults 0 0

Wednesday, November 4, 2015

Restore files from the TSM backup using the Command Line Interface


How to restore files from the TSM backup using the Command Line 
Interface

You can restore files from the backup yourself using the Command Line Interface in Terminal.app. This is slightly more tricky than using the GUI: primarily, you more or less need to know the name of the file you are looking for. Two sources of information
that can help is the daily logs in /CS/Backup (user readable) or the “master log” located in /Library/Logs/tivoli/tsm/dsmsched.log (readable by root only).  

NOTE: You need to know the name and password of an administrative user!!

Managing dsmc (the backup program):

1. Become root:
$ su adminusername
Enter admin user password
$ sudo -i
Enter admin user password again
2. Launch dsmc:
$ dsmc
3. When you are done, leave dsmc:
tsm> quit

Useful commands from the command line:

See when the computer was last backed up:
query filespace (or the short form: q fi)

Restore a single file, using the most recent backup, placing it in the original location:
restore "/Users/peter/Documents/My Thesis.rtf"
if the file name contains spaces, it must be surrounded by quotes!


Same as above, but placing it in the directory /Restored instead:
restore "/Users/peter/Documents/My Thesis.rtf" /Restored/
you must have a trailing slash in the name of the restore-directory
if the restore-directory doesn't exist, it will be created
If the file you are restoring no longer resides on your workstation, and you have run an incremental backup since deleting the file, there is no active backup of the file on the server. In this case, use the latest option to restore the most recent backup version. restore /Users/peter/h1.doc -latest

Restore an entire directory to the location /Users/tomas/Restoredfiles/, using the most recent backup:
restore -subdir=yes /Users/peter/Documents/* /Users/peter/ Restored/

Look for files from a specific date (pitd=Point In Time Date) and pick among those:
restore -pitd=2012-06-15 -subdir=yes "/Users/peter/*dmg" -pick
/Restored/
You will get a listing such as this that you can choose from


IBM Tivoli Storage Manager
Command Line Backup-Archive Client Interface
Client Version 6, Release 1, Level 4.0
Client date/time: 2012-11-15 15:27:51
(c) Copyright by IBM Corporation and other(s) 1990, 2010. All Rights Reserved.

Node Name: PARAVEL
Session established with server TSM1: Linux/x86_64
Server Version 5, Release 5, Level 0.0
Server date/time: 2012-11-15 15:27:51 Last access: 2012-11-15 15:27:42

Restore function invoked.


TSM Scrollable PICK Window - Restore

# Backup Date/Time File Size A/I File

--------------------------------------------------------------------------------------
1. |
2012-06-15 09:56:41
72
B
I
/Users/peterm
2. |
2011-09-13 10:15:22
72
B
A
/Users/peterm/InstaDMG/
3. |
2011-09-13 10:16:55
72
B
A
/Users/peterm/InstaDMG/Resources
4. |
2011-09-13 10:16:55
72
B
A
/Users/peterm/InstaDMG/Resources/Instadmg
|


|
|

0---------10--------20--------30--------40--------50--------60--------70--------80----
=Up =Down =Top =Bottom =Right =Left
=Goto Line # <#>=Toggle Entry <+>=Select All <->=Deselect All
<#:#+>=Select A Range <#:#->=Deselect A Range =Ok =Cancel pick>


All these commands can be run without actually starting dsmc; in that case just proceed the commands above with ”dsmc”!