To Change Hostname in Solaris 10
1. To temporarily Change Hostname in Solaris10.
bash-3.00# hostname linuxtutors
Note: This command will change your server’s hostname temporarily. But, if the server reboots, this “<hostname>” will not stay.
2. To change your hostname permanently i.e, even if the server reboots <hostname> should same.
bash-3.00# echo linuxtutors > /etc/nodename
bash-3.00# echo linuxtutors > /etc/hosts
bash-3.00# echo linuxtutors > /etc/hostname.e1000g0
Reboot the system
bash-3.00# init 5
Check the hostname
bash-3.00# hostame
linuxtutors
Read more...
Saturday, April 20, 2013
Solaris: Change hostname in Solaris
Labels:
Solaris
VxVM: Installation of Vertias Volume Manager(VxVM)
bash-3.00# devfsadm -Cv
bash-3.00# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 1563 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
1. c0d1 <DEFAULT cyl 4093 alt 2 hd 128 sec 32>
/pci@0,0/pci-ide@1,1/ide@0/cmdk@1,0
Specify disk (enter its number): 1
selecting c0d1
Controller working list found
[disk formatted, defect list found]
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> p
WARNING - This disk may be in use by an application that has
modified the fdisk table. Ensure that this disk is
not currently in use before proceeding to use fdisk.
format> fdisk
No fdisk table exists. The default partition for the disk is:
a 100% "SOLARIS System" partition
Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y
format> p
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> print
Current partition table (original):
Total disk cylinders available: 4092 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 4091 7.99GB (4092/0/0) 16760832
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 2.00MB (1/0/0) 4096
9 alternates wm 1 - 2 4.00MB (2/0/0) 8192
partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
Enter partition id tag[unassigned]: ?
Expecting one of the following: (abbreviations ok):
unassigned boot root swap
usr backup stand var
home alternates reserved
Enter partition id tag[unassigned]: alternates
Enter partition permission flags[wm]: ?
Expecting one of the following: (abbreviations ok):
wm - read-write, mountable
wu - read-write, unmountable
rm - read-only, mountable
ru - read-only, unmountable
Enter partition permission flags[wm]:
Enter new starting cyl[1]:
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 5gb
partition> l
Ready to label disk, continue? y
partition> p
Current partition table (unnamed):
Total disk cylinders available: 4092 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 alternates wm 1 - 2560 5.00GB (2560/0/0) 10485760
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 4091 7.99GB (4092/0/0) 16760832
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 2.00MB (1/0/0) 4096
9 alternates wm 1 - 2 4.00MB (2/0/0) 8192
partition> q
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> q
bash-3.00# newfs /dev/rdsk/c0d1s0
newfs: construct a new file system /dev/rdsk/c0d1s0: (y/n)? y
Warning: 2048 sector(s) in last cylinder unallocated
/dev/rdsk/c0d1s0: 10485760 sectors in 1707 cylinders of 48 tracks, 128 sectors
5120.0MB in 107 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
9539744, 9638176, 9736608, 9835040, 9933472, 10031904, 10130336, 10228768,
10327200, 10425632
bash-3.00# mount /dev/dsk/c0d1s0 /opt
bash-3.00# df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c0d0s0 7.8G 3.6G 4.1G 48% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 722M 920K 721M 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
7.8G 3.6G 4.1G 48% /lib/libc.so.1
fd 0K 0K 0K 0% /dev/fd
swap 722M 80K 721M 1% /tmp
swap 721M 32K 721M 1% /var/run
/dev/dsk/c0d0s3 945M 1.0M 887M 1% /export/home
/dev/dsk/c0d1s0 4.9G 5.0M 4.9G 1% /opt
bash-3.00# vi /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0d0s1 - - swap - no -
/dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 / ufs 1 no -
/dev/dsk/c0d0s3 /dev/rdsk/c0d0s3 /export/home ufs 2 yes -
/devices - /devices devfs - no -
sharefs - /etc/dfs/sharetab sharefs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -
### Partition for Vertias Installation ###
/dev/dsk/c0d1s0 /dev/rdsk/c0d1s0 /opt ufs 2 yes -
bash-3.00# df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c0d0s0 7.8G 3.6G 4.1G 48% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 722M 920K 721M 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
7.8G 3.6G 4.1G 48% /lib/libc.so.1
fd 0K 0K 0K 0% /dev/fd
swap 721M 80K 721M 1% /tmp
swap 721M 32K 721M 1% /var/run
/dev/dsk/c0d0s3 945M 1.0M 887M 1% /export/home
/dev/dsk/c0d1s0 4.9G 5.0M 4.9G 1% /opt
bash-3.00# scp -r root@192.168.56.102:/root/VRTS_SF_Basic_6.0.1_Solaris_x64.tar.gz /opt
The authenticity of host '192.168.56.102 (192.168.56.102)' can't be established.
RSA key fingerprint is 05:02:00:6e:6e:05:b5:c0:40:14:bb:f2:97:19:55:35.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.56.102' (RSA) to the list of known hosts.
root@192.168.56.102's password:
VRTS_SF_Basic_6.0.1_ 100% |*********************************| 360 MB 00:32 AETA
bash-3.00# ls
VRTS_SF_Basic_6.0.1_Solaris_x64.tar.gz lost+found
bash-3.00# gunzip VRTS_SF_Basic_6.0.1_Solaris_x64.tar.gz
bash-3.00# ls
VRTS_SF_Basic_6.0.1_Solaris_x64.tar lost+found
bash-3.00# tar -xvf VRTS_SF_Basic_6.0.1_Solaris_x64.tar
x ./dvd4_sfb-sol_x64, 0 bytes, 0 tape blocks
x ./dvd4_sfb-sol_x64/sol10_x64, 0 bytes, 0 tape blocks
x ./dvd4_sfb-sol_x64/sol10_x64/storage_foundation_basic, 0 bytes, 0 tape blocks
.
.
bash-3.00# ls
VRTS_SF_Basic_6.0.1_Solaris_x64.tar
dvd4_sfb-sol_x64
lost+found
bash-3.00# cd dvd4_sfb-sol_x64/; ls
sol10_x64 sol11_x64
bash-3.00# cd sol10_x64/; ls
copyright pkgs
installer scripts
perl storage_foundation_basic
bash-3.00# ./installer
Storage Foundation and High Availability Solutions 6.0.1 Install Program
Copyright (c) 2012 Symantec Corporation. All rights reserved.
Symantec, the Symantec Logo are trademarks or registered trademarks of Symantec Corporation or its affiliates in the U.S. and other countries. Other names may be trademarks of their respective owners.
The Licensed Software and Documentation are deemed to be "commercial computer software" and "commercial computer software documentation" as defined in FAR Sections 12.212 and DFARS Section 227.7202.
Logs are being written to /var/tmp/installer-201304182104vuz
while installer is in progress.
Storage Foundation and High Availability Solutions 6.0.1 Install Program
Symantec Product Version
Installed Licensed
================================================================================
Symantec Licensing Utilities (VRTSvlic) are not installed due to which products and licenses are not discovered.
Use the menu below to continue.
Task Menu:
P) Perform a Pre-Installation Check I) Install a Product
C) Configure an Installed Product G) Upgrade a Product
O) Perform a Post-Installation Check U) Uninstall a Product
L) License a Product S) Start a Product
D) View Product Descriptions X) Stop a Product
R) View Product Requirements ?) Help
Enter a Task: [P,I,C,G,O,U,L,S,D,X,R,?] I
Storage Foundation and High Availability Solutions 6.0.1 Install Program
Veritas Storage Foundation Basic (SF) is the only product available for installation
Do you agree with the terms of the End User License Agreement as specified in the storage_foundation_basic/EULA/en/EULA_SF_Basic_Ux_6.0.1.pdf file present on media? [y,n,q,?] y
Veritas Storage Foundation Basic 6.0.1 Install Program
1) Install minimal required packages - 379 MB required
2) Install recommended packages - 595 MB required
3) Install all packages - 597 MB required
4) Display packages to be installed for each option
Select the packages to be installed on all systems? [1-4,q,?] (2)
Enter the Solaris x64 system names separated by spaces: [q,?](linuxtutors)
Veritas Storage Foundation Basic 6.0.1 Install Program
linuxtutors
Logs are being written to /var/tmp/installer-201304182104vuz while installer is in progress
Verifying systems: 100%
Estimated time remaining: (mm:ss) 0:00 8 of 8
Checking system communication .................... Done
Checking release compatibility ................... Done
Checking installed product ....................... Done
Checking prerequisite patches and packages ....... Done
Checking platform version ........................ Done
Checking file system free space .................. Done
Checking product licensing ....................... Done
Performing product prechecks ..................... Done
System verification checks completed
The following warnings were discovered on the systems:
CPI WARNING V-9-40-3995 Solaris 10 Update 6 is installed on linuxtutors. It is strongly recommended to install Solaris 10 Update 8 or later
CPI WARNING V-9-30-2167 The RAM size on linuxtutors is 768 megabytes, the recommended RAM size required by product SF is 1024 megabytes
CPI WARNING V-9-30-1997 The swap size on linuxtutors is 614 megabytes, the minimal swap size required by product SF is 1024 megabytes
CPI WARNING V-9-40-4970 To avoid a potential reboot after installation, you should modify the /etc/system file on linuxtutors with the appropriate values, and reboot prior to package installation.
Appropriate /etc/system file entries are shown below:
set lwp_default_stksize=0x6000
set rpcmod:svc_default_stksize=0x6000
Do you want to continue? [y,n,q] (y)
Veritas Storage Foundation Basic 6.0.1 Install Program
linuxtutors
The following Veritas Storage Foundation Basic packages will be installed on all systems:
Package Package Description
VRTSperl Veritas Perl 5.14.2 Redistribution
VRTSvlic Veritas Licensing
VRTSspt Veritas Software Support Tools by Symantec
VRTSvxvm Veritas Volume Manager Binaries
VRTSaslapm Veritas Volume Manager - ASL/APM
VRTSob Veritas Enterprise Administrator Service by Symantec
VRTSvxfs Veritas File System
VRTSsfmh Veritas Storage Foundation Managed Host by Symantec
VRTSsfcpi601 Veritas Storage Foundation Installer
Press [Enter] to continue:
Veritas Storage Foundation Basic 6.0.1 Install Program
linuxtutors
Logs are being written to /var/tmp/installer-201304182104vuz while installer is in progress
Installing SF: 100%
Estimated time remaining: (mm:ss) 0:00 11 of 11
Performing SF preinstall tasks ................... Done
Installing VRTSperl package ...................... Done
Installing VRTSvlic package ...................... Done
Installing VRTSspt package ....................... Done
Installing VRTSvxvm package ...................... Done
Installing VRTSaslapm package .................... Done
Installing VRTSob package ........................ Done
Installing VRTSvxfs package ...................... Done
Installing VRTSsfmh package ...................... Done
Installing VRTSsfcpi601 package .................. Done
Performing SF postinstall tasks .................. Done
Veritas Storage Foundation Basic Install completed successfully
Checking system licensing
Storage Foundation Basic successfully registered on
linuxtutors
SF is licensed on the systems
The updates to VRTSaslapm package are released via the Symantec SORT web page: https://sort.symantec.com/asl. To make sure you have the latest version of VRTSaslapm (for up to date ASLs and APMs), download and install the latest package from the SORT web page.
Veritas Storage Foundation Basic cannot be started without configuration.
Run the '/opt/VRTS/install/installsf601 -configure' command when you are ready to configure Veritas Storage Foundation Basic.
Checking online updates for Veritas Storage Foundation Basic 6.0.1
Attempted to connect to https://sort.symantec.com to check for product updates, but connection failed.
Please visit https://sort.symantec.com to check for available product updates and information.
The following packages require reboot while installing them on
linuxtutors:
VRTSvxfs
It is strongly recommended to reboot the following systems:
linuxtutors
Execute '/usr/sbin/shutdown -y -i6 -g0' to properly restart your systems
installer log files, summary file, and response file are saved at:
/opt/VRTS/install/logs/installer-201304182104vuz
Would you like to view the summary file? [y,n,q] (n)
bash-3.00#
bash-3.00# /usr/sbin/shutdown -y -i6 -g0
Shutdown started. Thu Apr 18 21:22:25 IST 2013
Changing to init state 6 - please wait
Broadcast Message from root (pts/4) on linuxtutors Thu Apr 18 21:22:25...
THE SYSTEM linuxtutors IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged
bash-3.00#
bash-3.00# vxdctl enable
VxVM vxdctl ERROR V-5-1-307 vxconfigd is not running, cannot enable
bash-3.00# vxdisk list
VxVM vxdisk ERROR V-5-1-684 IPC failure: Configuration daemon is not accessible
bash-3.00# vxconfigd
bash-3.00# echo $?
2
bash-3.00# vxdctl init
bash-3.00# echo $?
0
bash-3.00# vxdctl enable
bash-3.00# echo $?
0
bash-3.00# vxdisk -e list
DEVICE TYPE DISK GROUP STATUS OS_NATIVE_NAME ATTR
c0d0s2 auto:none - - online invalid c0d0s2 -
c0d1s2 auto:none - - online invalid c0d1s2 -
bash-3.00#
bash-3.00# cat /etc/vx/volboot
volboot 3.1 0.1 120
hostid linuxtutors
hostguid {f5e9e4cc-a841-11e2-98f5-0800276013c7}
request_threads 2
Command_Shipping 1
end
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
#############################################################
bash-3.00#
Setting OS based naming Scheme:
bash-3.00# vxddladm set namingscheme=osn
bash-3.00# vxddladm get namingscheme
NAMING_SCHEME PERSISTENCE LOWERCASE USE_AVID
============================================================
OS Native No Yes Yes
bash-3.00# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0d0s2 auto:none - - online invalid
c0d1s2 auto:none - - online invalid
Setting Enclosure based naming Scheme:
bash-3.00# vxddladm set namingscheme=ebn
bash-3.00# vxddladm get namingscheme
NAMING_SCHEME PERSISTENCE LOWERCASE USE_AVID
============================================================
Enclosure Based Yes Yes Yes
bash-3.00# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0d0s2 auto:none - - online invalid
c0d1s2 auto:none - - online invalid
Note: You can change the naming scheme on fly.
VxVM: VxVM vxdmpadm ERROR V-5-1-684 IPC failure: Configuration daemon is not accessible
I have setup the VxVM installation on laptop for practicing the VxVM. After installation, I have rebooted the system and executed the below command and getting output error message.
-bash-3.00# vxdctl enable
VxVM vxdctl ERROR V-5-1-307 vxconfigd is not running, cannot enable
VxVM vxdisk ERROR V-5-1-684 IPC failure: Configuration daemon is not accessible
To resolve the issue:
---------------------
The "install-db" file prevents the vxconfigd daemon from starting on system boot. Verify if the file "install-db" is present.
bash-3.00# ls -l /etc/vx/reconfig.d/state.d/install-db
-rw-r--r-- 1 root other 0 Apr 18 21:09 /etc/vx/reconfig.d/state.d/install-db
If the file is present, remove the install-db file:
bash-3.00# rm /etc/vx/reconfig.d/state.d/install-db
To start the vxvm daemons
-bash-3.00# vxconfigd
To initialize vxvm
-bash-3.00# vxdctl init
To enable vxvm
-bash-3.00# vxdctl enable
To list disk
-bash-3.00# vxdisk -e list
or
bash-3.00# vxdctl init <hostname>
bash-3.00# vxdctl init linuxtutor
Restart vxconfigd with the following commands
bash-3.00# vxconfigd -k
Restart the Volume Manager configuration daemon, setting the boot:
bash-3.00# vxconfigd -k -m boot
bash-3.00# echo $?
0
Enable modes for startup of vxconfigd after reboot:
bash-3.00# vxconfigd -k -m enable
bash-3.00# echo $?
0
Check the Vx process
bash-3.00# ps -ef | grep -i vx | grep -v grep
root 2421 1817 0 13:26:56 pts/1 0:00 vxconfigd -k -m enable
bash-3.00# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0d0s2 auto:none - - online invalid
c0d1s2 auto:none - - online invalid
c1t1d0s2 auto:none - - online invalid
Thursday, April 4, 2013
Autologin through SSH using bash script
Autologin using bash script
1. Create a new ssh RSA keygen:
[root@linuxtutors# ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (//.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in //.ssh/id_rsa.
Your public key has been saved in //.ssh/id_rsa.pub.
The key fingerprint is:
4a:0d:db:6a:06:c9:c8:62:e0:f3:cb:93:5f:de:d6:f4 root@-i
Keys are stored at /.ssh/ directory:
[root@linuxtutors# ~]# cd /.ssh/
List the files
[root@linuxtutors# .ssh]# ls -l; cd
total 6
-rw------- 1 root root 883 Apr 4 17:50 id_rsa
-rw-r--r-- 1 root root 217 Apr 4 17:50 id_rsa.pub
-rw-r--r-- 1 root root 633 Apr 4 17:43 known_hosts
2. Create the Bash Script to copy public key to remote server:
[root@linuxtutors# ~]# vi autossh.sh
#!/bin/bash
ips=/tmp/List_Of_Machine_IPs.txt
for x in $(cat $ips)
do
cat .ssh/id_rsa.pub | ssh root@$x 'cat >> .ssh/authorized_keys'
cat .ssh/id_rsa.pub | ssh root@$x 'cat >> .ssh/authorized_keys2'
ssh root@$x 'chmod 640 .ssh/authorized_keys'
ssh root@$x 'chmod 640 .ssh/authorized_keys2'
ssh root@$x 'chmod 700 .ssh'
done
Save and Exit:
:wq
3. Assign the execute permission to the script:
[root@linuxtutors# ~]# chmod a+x autossh.sh
4. List all the machine ip which you want to autologin:
[root@linuxtutors# ~]# vi /tmp/List_Of_Machine_IPs.txt
192.168.1.100
192.168.1.101
192.168.1.102
Save and Exit:
:wq
5. Execute the script
[root@linuxtutors# ~]# sh autossh.sh
The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established.
RSA key fingerprint is ae:14:11:0f:cc:2a:28:03:b4:13:7f:35:ce:ab:f5:ee.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.100' (RSA) to the list of known hosts.
root@192.168.1.100's password:
root@192.168.1.100's password:
The authenticity of host '192.168.1.101 (192.168.1.101)' can't be established.
RSA key fingerprint is ae:14:11:0f:cc:2a:28:03:b4:13:7f:35:ce:ab:f5:ee.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.101' (RSA) to the list of known hosts.
root@192.168.1.101's password:
root@192.168.1.101's password:
The authenticity of host '192.168.1.102 (192.168.1.102)' can't be established.
RSA key fingerprint is ae:14:11:0f:cc:2a:28:03:b4:13:7f:35:ce:ab:f5:ee.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.102' (RSA) to the list of known hosts.
root@192.168.1.102's password:
root@192.168.1.102's password:
[root@linuxtutors# ~]#
Labels:
Linux
Wednesday, April 3, 2013
Install & Configure Openfiler
Labels:
openfiler
Sunday, March 3, 2013
Passed RHCE
Lot of thanks to all for following my blogs.
Labels:
Linux
Subscribe to:
Posts (Atom)