How to assign DVD to LPAR ? How to move it another LPAR? ( VIOS)

Share Button

Here is our scenario :
-We want to assign the  DVD to LPAR2.
-We want to dynamically move one DVD (or tape) from LPAR2 to LPAR3.

Assigning the attached physical DVD to LPAR2 :

1. Check DVD status on VIOS
$ lsdev -type optical
name             status      description
cd0              Available   SATA DVD-ROM Drive

2. Checked the vhost connections to the VIO clients
$ lsmap -all | grep vhost
vhost0          U9117.MMA.101F1A0-V1-C3          0x00000002
vhost1          U9117.MMA.101F1A0-V1-C4          0x00000003
vhost2          U9117.MMA.101F1A0-V1-C5          0x00000004

Where the partition IDs for his VIO clients are 2, 3, and 4

3. Assign the DVD to partition ID 2
$ mkvdev -vdev cd0 -vadapter vhost0

4. Check the mapping :
$ lsmap -vadapter vhost0

5. Go to partition ID 2 (LPAR2) and run cfgmgr
# cfgmgr
# lsdev -Cc cdrom
cd0 Available  Virtual SCSI Optical Served by VIO Server

Dynamically move the DVD from LPAR2 to LPAR3

6.Remove the DVD from LPAR2
# rmdev -dl cd0

7. Unmap the DVD from that partition i.e unattach the DVD from LPAR2 from VIOS level:
$ rmvdev -vdev cd0

8. Assign the DVD to LPAR3 by mapping it to vhost1:
$ mkvdev -vdev cd0 -vadapter vhost0

9. Go to partition ID 3 (LPAR3) and run cfgmgr and check the DVD :

# cfgmgr
# lsdev -Cc cdrom
cd0 Available  Virtual SCSI Optical Served by VIO Server

Share Button

How to restrict ftp access in AIX?

Share Button

Sometimes , We need to have only one directory accessible by hundreds of users .Instead of creating individual  users to each person , We can create only one user to each one . The most important question here is “how to restrict accesses to that directory?” . If we misconfigure the system , we may end up with a box full of holes to itruders who can easily mess with our box. Here comes the importance role of /etc/ftpaccess.ctl  file , which is not generated by default and you have to create it manually.

Here is the precdure you need to get it done :

1. Create a ftp user : (prefer to user “smitty user” )

useradd -d /home/ftp_user -u 1000 ftp_user

 

2. Assign a password for “ftp_user”

# passwd ftp_user

Changing password for “ftp_user”

ftp_user’s New password:

Re-enter ftp_user’s new password:

You can give that password to each one to get access to the home directory of ftp_user user

 

3. Remove user access for telnet and login

vi /etc/security/user

 

ftp_user:

admin = false

login = false

rlogin = false

 

4. check user directory and access

cat /etc/passwd |grep ftp_user

ftp_user:!:1000:1::/home/ftp_user:/usr/bin/ksh

 

create the /home/ftp_user and change the permission

# mkdir /home/ftp_user

# chown -R ftp_user.employee /home/ftp_user

# ls -al /home/ftp_user

total 0

drwxr-xr-x    2 ftp_user    employee           256 May  6 17:23 .

drwxr-xr-x    6 bin      bin             256 May  6 17:23 ..

 

 

5. Create a file, ftpaccess.ctl to control user access to home directory only

vi /etc/ftpaccess.ctl

=============================

#Restricted user to access home directory only

useronly:ftp_user

=============================

 

6. Check the /etc/ftpaccess.ctl permission

# ls -al /etc/ftpaccess.ctl

-rw-r–r–    1 root     system           62 July  6 17:27 /etc/ftpaccess.ctl

 

For more information , refer to :

http://www-01.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.files/ftpaccess.ctl.htm?lang=en

Share Button

How to start Tivoli Integrated Portal (TIP) in Linux?

Share Button

Use the following set of commands to start up the TIP server to get able to access to Admin Center :

 

# cd /opt/IBM/tivoli/tipv2/bin/

# ./startServer.sh server1
ADMU0116I: Tool information is being logged in file
/opt/IBM/tivoli/tipv2/profiles/TIPProfile/logs/server1/startServer.log
ADMU0128I: Starting tool with the TIPProfile profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 4348

 

TIP

Share Button

How to backup TSM DB?

Share Button

Here is the needed steps to backup TSM DB for the first time :

Step1
Preparthe system for database backups i.e specify the device class to be used for backups.We use use
SET DBRECOVERY  command to set the device class to store the DB backup.

set dbrecovery device_class_name
dbb1
Step2
Use BACKUP DB command to back up a Tivoli Storage Manager database to sequential access volumes.

In that demo , I used the following command :

backup db devc=file_devc type=full wait=yes

For more info , refer to :

http://pic.dhe.ibm.com/infocenter/tsminfo/v6r3/index.jsp?topic=%2Fcom.ibm.itsm.srv.ref.doc%2Fr_cmd_db_backup.html

dbb2

Step3

Check the the output of “query db f=d” command to make sure the backup succeeded.

dbb3

Also , I do recommend checking volume history file to find out if it reflects the backup.

Here is a part of the output of “query volhist” command which reflects that last DB backup:

Share Button

How to change TSM storage pool name?

Share Button

For some reason , I wanted to change the name of one storage pool in my test environment . Here is my old STG name :

rename1

I wanted to change TEST_STG_POOL name  to TEST_POOL ,so I invoked the following command from TSM CLI :

RENAME STG TEST_STG_POOL TEST_POOL

rename2

Share Button

How to change a machine hostname in Redhat/Centos 6 ?

Share Button

You can temporary  or permanently change the host name of Linux box depends on your needs.

 

To change hostname temporary 

Simply issue hostname command then the new hostname then press Enter.

For example , I am going to show you how to change the hostname to New_HostName:

# hostname New_Hostname

To check the current hostname , run :

#hostname

New_Hostname

but once you reboot the machine , the old/original hostname will be effective.

hostname

 

To change hostname permanently

Change HOSTNAME in /etc/syscinfig/network file to the value that you want then restart the network services :

# /etc/init.d/network restart

2

but bear in your mind that that method will disconnect you if you are connecting to the server via SSH.

 

Share Button

How to check BIOS sever version from Linux CLI?

Share Button

dmidecode could be used to check the BIOS version of Linux sever. dmidecode should be installed in RHEL/Cento 6 , if it is not , you can install it via issuing the following command :

yum install dmidecode

Here is the exact command you should use :

dmidecode –type bios

Example

# dmidecode –type bio

# dmidecode 2.12
SMBIOS 2.4 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: Phoenix Technologies LTD
Version: 6.00
Release Date: 07/02/2012
Address: 0xEA0C0
Runtime Size: 89920 bytes
ROM Size: 64 kB
Characteristics:
ISA is supported
PCI is supported
PC Card (PCMCIA) is supported
PNP is supported
APM is supported
BIOS is upgradeable
BIOS shadowing is allowed
ESCD support is available
Boot from CD is supported
Selectable boot is supported
EDD is supported
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
CGA/mono video services are supported (int 10h)
ACPI is supported
Smart battery is supported
BIOS boot specification is supported
Function key-initiated network boot is supported
Targeted content distribution is supported
BIOS Revision: 4.6
Firmware Revision: 0.0

 

bios_linux_CLI

Share Button

How to set password for Single User Mode in RedHat or CentOS?

Share Button

Here are 2 step to set password for Redhat/Centos Single user mood :-

 

Step1

Insert the following line to /etc/inittab file above the line containing initdefault :

su:S:wait:/sbin/sulogin

1

Step2

Edit the file /etc/sysconfig/init and change the following line:

SINGLE=/sbin/sushell
to
SINGLE=/sbin/sulogin

2

 

Final Step is testing booting into single user mood to :

3

 

4

 

Also , I recommend having a look at How to set password for Linux GRUB (RedHat , Centos & Fedora)?

http://unixhood.com/main/2014/05/20/how-to-set-password-for-linux-grub-redhat-centos-fedora/

Share Button

Read-only file system in Linux single-user mode

Share Button

For some reason , my /etc/fstabe got corrupted so I went to Single user mood to get it fixed but the surprise was that i tkept telling me the file is in read-only mood.

I did a lil bit research and the following command saved my day:

mount -o remount, rw X /

 

After that , I was able to edit /etc/fstab and the sever booted properly.

Share Button

How to set password for Linux GRUB (RedHat , Centos & Fedora)?

Share Button

In that article , I am going to show how to set password for Linux GRUB (GRand Unified Bootloader)

 

Step1

As root user , run the following command :

# grub-md5-crypt
Password:
Retype password:
$1$hkAIj1$VeRc4OR7hvZk.2XSsf5zk.

step1

$1$hkAIj1$VeRc4OR7hvZk.2XSsf5zk. is the md5 password that you will use

Step2
/boot/grub/menu.lst & /boot/grub/grub.conf are symbolic link to each other , You will need to edit one of them.
Add the following line in /boot/grub/grub.conf file :
password –md5 $1$hkAIj1$VeRc4OR7hvZk.2XSsf5zk.
step2
Step3
reboot to test how effective the password that you set. When the system boots , press “p” and it will ask you for password to be able to enter into single user mood or to edit the GRUB menu.
step3
The screenshoot below shows what happened when I entered the wrong password :
step3_failed
Share Button