# grep VOL vxdisplay_s.txt| awk '{print "vxassist -g rez2_datadg make "$3 " " int($(NF -1)*1024)"m" }'
Generate a sun4u flar to apply to a sun4v server
# echo “PLATFORM_GROUP=sun4v” >> /var/sadm/system/admin/.platform
# nohup flarcreate -n `uname -n` -U “content_architectures=sun4u,sun4v” -c -S -R / /b/`uname -n`.flar &
edit VCS main.cf
# haconf -dump -makero
# hastop -all -force
# cd /etc/VRTSvcs/conf/config
# vi main.cf
# hacf -verify .
# hastart
CDOM and LDOM config
If your server doesn’t have a CDOM, you could create one by running something like this (create_config.ksh):
ldm add-vdiskserver primary-vds0 primary ldm add-vconscon port-range=5000-5100 primary-vcc0 primary ldm add-vswitch net-dev=igb0 primary-vsw0 primary ldm add-vswitch net-dev=nxge0 primary-vsw1 primary ldm set-vcpu 4 primary ldm set-memory 1g primary ldm add-config initial ldm list-config
Reboot the server.
Now let’s say you want to create an LDOM in that server, login to the cdom and do something like this (create_myldom.ksh):
ldm add-domain myldom ldm set-vcpu 16 myldom ldm set-memory 13G myldom ldm add-vnet vnet1 primary-vsw0 myldom ldm add-vnet vnet2 primary-vsw1 myldom ldm add-vdsdev /dev/dsk/
c0t600601605A203100A44CDC74C08 2E211d0s2 vol2@primary-vds0 ldm add-vdisk vdisk0 vol2@primary-vds0 myldom ldm bind myldom ldm set-var auto-boot?=true myldom ldm start-domain myldom
Some veritas commands
Remove a volume
# vxassist -g <dg> remove volume <volume>
Create a volume
# vxassist -g <dg> make <volume> <size>
Change a volume’s owner and permissions
# vxedit -g <dg> set user=<user> group=<group> mode=<perms> <vol>
– rdircio
Extract files from a FLAR file (flash archive)
# flar split flarfile.flar
# mv archive archive.Z
# uncompress archive.Z
# cat archive | cpio -ivt
# cpio -ivdm opt/tivoli/* < archive
tunnel NFS over ssh on solaris
if your “remotehost” solaris server cannot mount your “nfsserver” ‘s mountpoints, you can tunnel nfs over ssh
from the nfsserver
# ssh -R "3049:localhost:2049" remotehost
once in the “remotehost”
# mount -o port=3049 nfs://localhost:/nfs/share /mount/point
Dhcp client in a solaris 10 nic
to get an address
ifconfig nxge0 plumb ifconfig nxge0 dhcp start ifconfig nxge0 dhcp status
Netmask table
Bitmask (Bits) | Dotted Decimal | Hexadecimal | Binary |
---|---|---|---|
/0 | 0.0.0.0 | 0x00000000 | 00000000 00000000 00000000 00000000 |
/1 | 128.0.0.0 | 0x80000000 | 10000000 00000000 00000000 00000000 |
/2 | 192.0.0.0 | 0xc0000000 | 11000000 00000000 00000000 00000000 |
/3 | 224.0.0.0 | 0xe0000000 | 11100000 00000000 00000000 00000000 |
/4 | 240.0.0.0 | 0xf0000000 | 11110000 00000000 00000000 00000000 |
/5 | 248.0.0.0 | 0xf8000000 | 11111000 00000000 00000000 00000000 |
/6 | 252.0.0.0 | 0xfc000000 | 11111100 00000000 00000000 00000000 |
/7 | 254.0.0.0 | 0xfe000000 | 11111110 00000000 00000000 00000000 |
/8 | 255.0.0.0 | 0xff000000 | 11111111 00000000 00000000 00000000 |
/9 | 255.128.0.0 | 0xff800000 | 11111111 10000000 00000000 00000000 |
/10 | 255.192.0.0 | 0xffc00000 | 11111111 11000000 00000000 00000000 |
/11 | 255.224.0.0 | 0xffe00000 | 11111111 11100000 00000000 00000000 |
/12 | 255.240.0.0 | 0xfff00000 | 11111111 11110000 00000000 00000000 |
/13 | 255.248.0.0 | 0xfff80000 | 11111111 11111000 00000000 00000000 |
/14 | 255.252.0.0 | 0xfffc0000 | 11111111 11111100 00000000 00000000 |
/15 | 255.254.0.0 | 0xfffe0000 | 11111111 11111110 00000000 00000000 |
/16 | 255.255.0.0 | 0xffff0000 | 11111111 11111111 00000000 00000000 |
/17 | 255.255.128.0 | 0xffff8000 | 11111111 11111111 10000000 00000000 |
/18 | 255.255.192.0 | 0xffffc000 | 11111111 11111111 11000000 00000000 |
/19 | 255.255.224.0 | 0xffffe000 | 11111111 11111111 11100000 00000000 |
/20 | 255.255.240.0 | 0xfffff000 | 11111111 11111111 11110000 00000000 |
/21 | 255.255.248.0 | 0xfffff800 | 11111111 11111111 11111000 00000000 |
/22 | 255.255.252.0 | 0xfffffc00 | 11111111 11111111 11111100 00000000 |
/23 | 255.255.254.0 | 0xfffffe00 | 11111111 11111111 11111110 00000000 |
/24 | 255.255.255.0 | 0xffffff00 | 11111111 11111111 11111111 00000000 |
/25 | 255.255.255.128 | 0xffffff80 | 11111111 11111111 11111111 10000000 |
/26 | 255.255.255.192 | 0xffffffc0 | 11111111 11111111 11111111 11000000 |
/27 | 255.255.255.224 | 0xffffffe0 | 11111111 11111111 11111111 11100000 |
/28 | 255.255.255.240 | 0xfffffff0 | 11111111 11111111 11111111 11110000 |
/29 | 255.255.255.248 | 0xfffffff8 | 11111111 11111111 11111111 11111000 |
/30 | 255.255.255.252 | 0xfffffffc | 11111111 11111111 11111111 11111100 |
/31 | 255.255.255.254 | 0xfffffffe | 11111111 11111111 11111111 11111110 |
/32 | 255.255.255.255 | 0xffffffff | 11111111 11111111 11111111 11111111 |
Solaris Recovery mode with disksuite
http://docs.oracle.com/cd/E19253-01/817-1985/mirror-1/index.html
remember to fsck after umounting the metadevice