Contains technical document about Unix/Linux, Java, Python, Raspberry Pi and other IT related topics. Not a full tutorial but as a quick reference guide
Monday, November 26, 2012
Create a Soalris 8 zone (32bit) to a container
1. Create zone configuration
root@sol10 # zonecfg -z z_sol8
z_sol8: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:z_sol8> create -t SUNWsolaris8
zonecfg:z_sol8> set zonepath=/pool/zone/sol8
zonecfg:z_sol8> set autoboot=false
zonecfg:z_sol8> set ip-type=shared
zonecfg:z_sol8> add net
zonecfg:z_sol8:net> set address=192.168.123.123
zonecfg:z_sol8:net> set physical=nxge0
zonecfg:z_sol8:net> end
zonecfg:z_sol8> verify
zonecfg:z_sol8> commit
zonecfg:z_sol8> exit
Next install the zone from the flar image:
Thursday, November 22, 2012
Failed to exclude directories when running flarcreate on Solaris 8
flarcreate -n
where -c is enable compression, -S is ignore size stats, -R is the root path
However, the directories /one and /two are still in the flar !
After doing some investigation and research from the web, it is believed that there is a bug of this script of the current version. Since it's too old and I don't want to apply any patch on it, I'd rather modify the script a bit in order fulfill my requirement:
Friday, October 26, 2012
Check utilization for Solaris 10
#prstat -Z
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
5147 root 206M 33M sleep 59 0 0:03:10 0.0% webservd/30
1378 noaccess 157M 129M sleep 59 0 0:02:41 0.0% java/18
2333 root 130M 90M sleep 59 0 0:07:52 0.0% java/72
5060 root 82M 14M sleep 59 0 0:03:11 0.0% webservd/71
5088 106 81M 20M sleep 59 0 0:03:11 0.0% webservd/72
1865 root 63M 24M sleep 101 - 0:00:04 0.0% rgmd/43
1009 root 51M 24M sleep 59 0 0:00:22 0.0% fmd/30
1719 root 48M 4080K sleep 100 - 0:00:19 0.0% rpc.pmfd/23
1119 root 44M 28M sleep 59 0 0:34:05 0.0% poold/8
11 root 36M 29M sleep 59 0 0:00:30 0.0% svc.startd/13
5094 root 34M 16M sleep 59 0 0:00:50 0.0% opceca/2
861 root 28M 3520K sleep 59 0 0:00:00 0.0% pmmd/20
5146 root 26M 3344K sleep 59 0 0:00:07 0.0% webservd/2
5087 root 26M 2976K sleep 59 0 0:00:07 0.0% webservd/2
5059 root 26M 2600K sleep 59 0 0:00:07 0.0% webservd/2
ZONEID NPROC SWAP RSS MEMORY TIME CPU ZONE
0 95 734M 566M 0.9% 1:05:10 0.0% global
1 37 275M 112M 0.2% 0:10:00 0.0% zone1
3 44 113M 112M 0.2% 3:18:50 0.1% zone2
2 23 18M 26M 0.0% 0:01:21 0.0% zone3
Total: 199 processes, 4159 lwps, load averages: 0.43, 0.39, 0.38
Note that I run this command one a container with 3 zones. The -Z parameter provide a glance of the utilization of each zone. To view the utilization of an individual zone, you can run "prstat -z
Thursday, October 25, 2012
Change network speed and duplex mode on Solaris 10
root@sunserver # dladm show-dev
nxge0 link: down speed: 0 Mbps duplex: unknown
nxge1 link: down speed: 0 Mbps duplex: unknown
nxge2 link: unknown speed: 0 Mbps duplex: unknown
nxge3 link: unknown speed: 0 Mbps duplex: unknown
igb0 link: up speed: 100 Mbps duplex: half
igb1 link: unknown speed: 0 Mbps duplex: half
igb2 link: up speed: 100 Mbps duplex: full
igb3 link: up speed: 1000 Mbps duplex: full
Seems 100 Half is a wrong setting. Since the speed is set by auto negotiation mode, we have to change it manually:
First, check the interface properties by "ndd":
root@sunserver # ndd -get /dev/igb0 ?
? (read only)
mtu (read and write)
min_allowed_mtu (read only)
max_allowed_mtu (read only)
adv_autoneg_cap (read and write)
adv_1000fdx_cap (read and write)
adv_1000hdx_cap (read only)
adv_100fdx_cap (read and write)
adv_100hdx_cap (read and write)
adv_10fdx_cap (read and write)
adv_10hdx_cap (read and write)
adv_100T4_cap (read only)
link_status (read only)
link_speed (read only)
link_duplex (read only)
autoneg_cap (read only)
pause_cap (read only)
asym_pause_cap (read only)
1000fdx_cap (read only)
1000hdx_cap (read only)
100fdx_cap (read only)
100hdx_cap (read only)
10fdx_cap (read only)
10hdx_cap (read only)
lp_autoneg_cap (read only)
lp_pause_cap (read only)
lp_asym_pause_cap (read only)
lp_1000hdx_cap (read only)
lp_1000fdx_cap (read only)
lp_100fdx_cap (read only)
lp_100hdx_cap (read only)
lp_10fdx_cap (read only)
lp_10hdx_cap (read only)
link_autoneg (read only)
tx_copy_thresh (read and write)
tx_recycle_thresh (read and write)
tx_overload_thresh (read and write)
tx_resched_thresh (read and write)
rx_copy_thresh (read and write)
rx_limit_per_intr (read and write)
intr_throttling (read and write)
adv_pause_cap (read only)
adv_asym_pause_cap (read only)
As those "read only" properties are not useful, let's filter out further:
Thursday, October 11, 2012
SUN Cluster (3.3) installation screen dump
Just a screen dump of the installation. Assumed the Solaris 10 is installed and media of the cluster is ready. # cd# ./installer Unable to access a usable display on the remote system. Continue in command-line mode?(Y/N) Y Java Accessibility Bridge for GNOME loaded.
Friday, March 09, 2007
Clone a new machine by spliting a miror disk (Vertias VM encapsulated)
Situation: suppose you are going to clone the machine A to machine B
- Before cloning, make sure the disks are in sync (vxprint -htA, format, etc..)
- Machine A and Machien B: Shutdown to OK prompt (init 0)
- Removal of disks should be in OK prompt
- Insertion of disks can be in OS level
Machine A:
Remove one of the disk and try to boot it with single in OK prompt (boot
) - after the OS is up, vxprint should shown the another disk is missing/fault
- insert a new disk and issue "vxdctl enable"
vxdiskadm -> 5
- resync should be in progress, use "vxtask list" to monitor
Double check (vxprint -htA) and format, if the partition label is not correct, issue "/etc/vx/bin/vxbootsetup
(the cxtxdx doesn't work. use 'vxdisk list' to get the disk name first)" - Try to reboot once again
Machine B:
insert the disk of Machine A and boot in OK prompt (boot
) - after the OS is up, vxprint should shown the another disk is missing/fault
- insert a new disk and issue "vxdctl enable"
vxdiskadm -> 5
- resync should be in progress, use "vxtask list" to monitor
Double check (vxprint -htA) and format, if the partition label is not correct, issue "/etc/vx/bin/vxbootsetup
(the cxtxdx doesn't work. use 'vxdisk list' to get the disk name first)" - Try to reboot once again
Tuesday, February 13, 2007
How to add a swap file in Solaris
- # mkfile 10m /tmp2/swapfile
- # swap -a /tmp2/swapfile
- # swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0d0s1 102,1 8 303400 303400
/dev/dsk/c0d1s6 102,70 8 21160 21160
/tmp2/swapfile - 8 20472 20472
- (Optional, if need to make the change permanent)
- Edit /etc/vfstab
/tmp2/swapfile - - swap - no -
- reboot
- Edit /etc/vfstab