mandag 17. oktober 2011

How to rescue your partition tables with gpart - and reinstall grub in Red Hat

Extending disk in vmware.
All the partition tables are missing. Whole disc are unallocated.

start with gpart livecd
Start with gpart /dev/sda (searching for missing partition tables in sda) Write down your cylinder.
Start parted
-unit s
-rescue
--start (cylinder number 'start' in partition1)
--end (cylinder number 'end' in partition1)

Repeat that if you have more than one partition.

You will now find sda1 and sda2 in /dev/*.

Sda1 = boot (ok)
sda2 = / (ok)
sda3 = SWAP-sda3 (I recreate a new swap disk with gpart, it is not necessary but it is far easier because sda3 has many links around the configuration files in my system.)

mount sda2 to /mnt/sda2/
mount sda1 to /mnt/sda2/boot/

go too /mnt/sda2/sbin/
start: grub-installation /dev/sda2
installing grub.

It perfectly works.

In some cases you also need to reconfigure the network card.
nano /etc/sysconfig/network-scripts/ifcg-eth0 .

torsdag 13. oktober 2011

Scan HBA for new devices - PowerPath

The host bus adapter driver in the 2.6 kernel exports the scan
function to the /sys directory which can be used to rescan the SCSI
devices on that interface. The scan function is available as follows:
# cd /sys/class/scsi_host/hostX/
# ls -al scan
# echo ‘- - -’ > scan
"X" will be the HBA number which is zoned to see the disk.
The three dash marks refer to channel, target, and LUN numbers.

Commit your change
#powermt config

Find your new logical device and write down the Pseudo name.
#powermt display dev=all


Find your new disk and pseudo name in
#fdisk -l

Run fdisk command which used to create and manipulate partition tables.
#fdisk
n - 1 - t (83 for linux system)
You should find pseudname and pseudname1 in /dev/
(in my system emcpowerb - emcpowerb1)

Format the new partition with
#mkfs.ext3 /dev/pseudoname1/

Mount the new disk in a directory and use it.

torsdag 15. september 2011

All server sessions are currently in use

ANS1351E Session rejected: All server sessions are currently in use


Problem solving example:
tsm> setopt maxsession 750
tsm> set maxschedsession 100

This parameter specifies the maximum number of simultaneous client sessions that can connect with the TSM server

lørdag 10. september 2011

How long since the last time the tape cartridge have been used

A tape cartridge is a mechanical product requiring physical maintenance once in a while. All you need is run a query for how long since the last time the tape cartridge have been used.
select volume_name,date(last_write_date) as write_date,date(last_read_date) as read_date from volumes where stgpool_name='LTO4POOL' order by read_date asc

You can check the tape cartridge for inconsistencies.
audit volume volumename fix=no

tirsdag 6. september 2011

TSM for Linux - nightly routine full backup for CentOS

Script created in /etc/cron.daily/

[root@name cron.daily]# cat dsmc.sh
#!/bin/bash

cd /var/log

/opt/tivoli/tsm/client/ba/bin/dsmc incremental / -subdir=yes | mail -s "backup report " mail@mail.com

Examples - restore:
dsmc restore -filelist=/home/dir2/restorelist.txt /home/NewRestoreLocation/
dsmc restore /home/monnett/h1.doc -latest
dsmc restore "/user/project/*"-pick -inactive
dsmc restore /home/monnett/h1.doc /home/newdoc/h2.doc
dsmc restore -pitd=9/10/2011 -pitt=13:23:20 /home/mydir/
dsmc restore "/home/projectA/*.bak" /home/projectB/ 



Examples - backup:

dsmc incremental / -subdir=yes
dsmc incremental -domain="/fs1 /fs2"
dsmc selective /home/proj/ -subdir=yes
dsmc selective /usr/dir1/sub1/ -subdir=yes -snapshotroot=/snapshot/day1