Minggu, 28 November 2010

Setup Network Configuration in Zone


· Plumb NIC network for zone

global# ifconfig e1000g1 plumb

global# zonecfg -z zone1

zonecfg:zone1> add net

zonecfg: zone1:net> set physical=e1000g1 <------ set physical network

zonecfg: zone1:net> set address=192.168.0.43 <------ set network address

zonecfg: zone1:net> set defrouter=192.168.0.2 <------ set default router address

zonecfg: zone1:net> end

zonecfg: zone1> verify

zonecfg: zone1> commit

· list of configuration

zonecfg: zone1> info

zonename: zone1

zonepath: /test1/zone1

brand: native

autoboot: true

bootargs:

pool:

limitpriv:

scheduling-class:

ip-type: shared

inherit-pkg-dir:

dir: /lib

inherit-pkg-dir:

dir: /platform

inherit-pkg-dir:

dir: /sbin

inherit-pkg-dir:

dir: /usr

fs:

dir: /etc/passwd

special: /etc/passwd

raw not specified

type: lofs

options: [ro]

fs:

dir: /etc/shadow

special: /etc/shadow

raw not specified

type: lofs

options: [ro]

net:

address: 192.168.0.43

physical: e1000g1

defrouter: 192.168.0.2

how to boot and halt the zone

• how to boot zone
Global# zoneadm -z zone1 boot

• list zone was booted
global # zoneadm list -cv

ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 zone1 running /test1/zone1 native shared <---- status zone was booted

• how to halt the zone global
# zoneadm -z zone1 halt

• list zone was halted
global # zoneadm list -cv

ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 installed /test1/zone1 native shared <---- status zone was halted

How to Create Simple Zone


• Create directory for zonepath
global# mkdir /test1/zone1

• Change mode for 700
global# chmod 700 /test1/zone1

• Create zone
global# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set autoboot=true
zonecfg:zone1> set zonepath=/test1/zone1
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit

• list zone was created
global# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 configured /test1/zone1 native shared <--- status zone was configured

• Install O/S in zone
global# zoneadm -z zone1 install
Waiting for up to <300> seconds for zone administration commands to become available (another user is administering zones)
Preparing to install zone
.
Creating list of files to copy from the global zone.
Copying <2922> files to the zone.
Preparing to initialize <1104> packages on the zone.
Initializing zone product registry.
Determining zone package initialization order.
Initializing package <723> of <1104>: percent complete: 65%

--------> wait until 100% and next process when finish wil appear below message

Initialized <1104> packages on zone.
Zone
is initialized.
Installation of <2> packages was skipped.
The file

· list zone was installed

global # zoneadm list -cv

ID NAME STATUS PATH BRAND IP

0 global running / native shared

- zone1 installed /test1/zone1 native shared <---- status zone was installed

----> After installation login as console


global # zlogin -C zone1
[Connected to zone 'zone1' console]

You did not enter a selection.
What type of terminal are you using?
1) ANSI Standard CRT
2) DEC VT52
3) DEC VT100
4) Heathkit 19
5) Lear Siegler ADM31
6) PC Console
7) Sun Command Tool
8) Sun Workstation
9) Televideo 910
10) Televideo 925
11) Wyse Model 50
12) X Terminal Emulator (xterms)
13) CDE Terminal Emulator (dtterm)
14) Other
Type the number of your choice and press Return: 3
Creating new rsa public/private host key pair
Creating new dsa public/private host key pair
Configuring network interface addresses:.
Enter the host name which identifies this system on the network. The name
must be unique within your domain; creating a duplicate host name will cause
problems on the network after you install Solaris.

-------> and then will appear below message

A host name must have at least one character; it can contain letters,
digits, and minus signs (-).


Host name zone1-lab


────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

----------> press ESC+2

─ Time Zone ────────────────────────────────────────────────────────────────────

On this screen you must specify your default time zone. You can specify a
time zone in three ways: select one of the continents or oceans from the
list, select other - offset from GMT, or other - specify time zone file.

> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].


Continents and Oceans
──────────────────────────────────
- [ ] Africa
│ [ ] Americas
│ [ ] Antarctica
│ [ ] Arctic Ocean
│ [ ] Asia
│ [ ] Atlantic Ocean
│ [ ] Australia
│ [ ] Europe
v [ ] Indian Ocean

────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

----> choose the time zone and press ESC+2

─ Country or Region ────────────────────────────────────────────────────────────

> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].


Countries and Regions
────────────────────────
^ [ ] Azerbaijan
│ [ ] Bahrain
│ [ ] Bangladesh
│ [ ] Bhutan
│ [ ] Brunei
│ [ ] Cambodia
│ [ ] China
│ [ ] Cyprus
│ [ ] East Timor
│ [ ] Georgia
│ [ ] Hong Kong
│ [ ] India
v [X] Indonesia

────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

------> choose the region and press ESC+2

─ Time Zone ────────────────────────────────────────────────────────────────────

> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].


Time zones
─────────────────────────────────────────────────────────────────
[X] Java & Sumatra
[ ] west & central Borneo
[ ] east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
[ ] Irian Jaya & the Moluccas


────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

-----> choose the time zones and pres ESC+2

─ Confirm Information ──────────────────────────────────────────────────────────

> Confirm the following information. If it is correct, press F2;
to change any information, press F4.


Time zone: Java & Sumatra
(Asia/Jakarta)


────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-4_Change Esc-6_Help

------> confirmed and press ESC+2

─ Confirm Information ──────────────────────────────────────────────────────────

> Confirm the following information. If it is correct, press F2;
to change any information, press F4.


Time zone: Java & Sumatra
(Asia/Jakarta)


────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-4_Change Esc-6_Help

-----> press ESC+2

─ Root Password ────────────────────────────────────────────────────────────────

Please enter the root password for this system.

The root password may contain alphanumeric and special characters. For
security, the password will not be displayed on the screen as you type it.

> If you do not want a root password, leave both entries blank.

Root password: ********
Root password: ********

────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

-------> give root password and press ESC+2

System identification is completed.

rebooting system due to change(s) in /etc/default/init

[NOTICE: Zone rebooting]

SunOS Release 5.10 Version Generic_120011-14 64-bit
Copyright 1983-2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: zone1-lab

zone1-lab console login:
zone1-lab console login: root
Password:
Nov 22 14:05:16 zone1-lab login: ROOT LOGIN /dev/console
Last login: Mon Nov 22 13:49:58 on pts/4
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#



========================================================
Zone States
Zone state information can be viewed with zoneadm list -iv from the global zone. Non-global zones have one of the following states:
• configured: Configuration complete and in stable storage.
• incomplete: Installation or uninstallation underway
• installed: Configuration instantiated on system. Zone has no associated virtual platform.
• ready: Virtual platform established, zsched started, IPs plumbed, filesystems mounted, zone ID assigned. No zone processes started yet.
• running: This state entered when zone init process starts.
• shutting down: Zone being halted.
• down: Transitional state during zone shutdown.
Zone Control Commands
The following control commands can be used to manage and monitor transitions between states:
• zlogin options zone-name
• zoneadm -z zone-name boot
• zoneadm -z zone-name halt
• zoneadm -z zone-name install
• zoneadm -z zone-name ready
• zoneadm -z zone-name reboot
• zoneadm -z zone-name uninstall
• zoneadm -z zone-name verify
• zonecfg -z zone-name: Interactive mode; can be used to remove properties of the following types: fs, device, rctl, net, attr
• zonecfg -z zone-name commit
• zonecfg -z zone-name create
• zonecfg -z zone-name delete
• zonecfg -z zone-name verify

Rabu, 03 Februari 2010

Cara Mengenali hingga Mounting usb-disk di solaris 10

Umumnya, disk yang di mount di solaris 10 adalah internal disk yang sudah di partisi atau external disk baik itu FC atau SATA yang di attachkan pada system. Pertanyaan yang muncul, apakah usb-disk atau pendrive dapat di attachkan dan dikenali pada solaris 10? jawabnya bisa iya bisa tidak tergantung format file system pada usb-disk atau pendrivenya.

untuk lebih detailnya tentang usb disk dan utility lainnya bisa cek di

http://www.sun.com/io_technologies/usb/USB-Faq.html#Storage

berikut step-step yang pernah saya kerjakan di mesin Sun Fire V890

1. jadi superuser (Login as root)
2. lihat konfigurasikonfigurasi disk
#cfgadm -al

bash-3.00# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
PCI0 pci-pci/hp connected configured ok
PCI1 unknown empty unconfigured unknown
PCI2 pci-pci/hp connected configured ok
PCI3 unknown empty unconfigured unknown
PCI4 unknown empty unconfigured unknown
PCI5 unknown empty unconfigured unknown
PCI6 unknown empty unconfigured unknown
PCI7 fibre/hp connected configured ok
PCI8 fibre/hp connected configured ok
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 CD-ROM connected configured unknown
c1 fc-private connected configured unknown
c1::500000e017710e81 disk connected configured unknown
c1::500000e017711171 disk connected configured unknown
c1::500000e0181b8d91 disk connected configured unknown
c1::500000e0181c1d91 disk connected configured unknown
c1::508002000065d961 ESI connected configured unknown
c2 fc-private connected configured unknown
c2::200400a0b832c06d disk connected configured unknown
c3 fc-private connected configured unknown
c3::200400a0b829e0ce disk connected configured unknown
usb0/1 usb-storage connected configured ok
usb0/2 unknown empty unconfigured ok
usb0/3 unknown empty unconfigured ok
usb0/4 unknown empty unconfigured ok


terlihat : usb0/1 usb-storage connected configured ok

2. check dengan iostat -En (sekalian melihat ukuran size hardisknya)

bash-3.00# iostat -En
c4t0d0 Soft Errors: 54 Hard Errors: 1 Transport Errors: 40
Vendor: Seagate Product: FreeAgent Go Revision: 102D Serial No: Size: 320.07GB <320070320640 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 54 Predictive Failure Analysis: 0
c0t0d0 Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
Vendor: TSSTcorp Product: CD/DVDW TS-H652D Revision: SI00 Serial No:
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 1 Predictive Failure Analysis: 0
c5t0d0 Soft Errors: 315 Hard Errors: 3 Transport Errors: 3
Vendor: Seagate Product: FreeAgent Go Revision: 102D Serial No: Size: 320.07GB <320070320640 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 315 Predictive Failure Analysis: 0
c2t1d2 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0

3. cek dengan rmformat

ash-3.00# rmformat
Looking for devices...
1. Logical Node: /dev/rdsk/c0t0d0s2
Physical Node: /pci@8,700000/ide@1/sd@0,0
Connected Device: TSSTcorp CD/DVDW TS-H652D SI00
Device Type: DVD Reader/Writer
2. Logical Node: /dev/rdsk/c5t0d0s2
Physical Node: /pci@9,700000/usb@1,3/storage@1/disk@0,0
Connected Device: Seagate FreeAgent Go 0138
Device Type: Removable


4. format disk dengan tipe file system yang bisa terbaca pada solaris (menggunakan command fdisk)

bash-3.00# fdisk /dev/rdsk/c5t0d0s2
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
bash-3.00#


atau menggunakan command newfs -T

bash-3.00# newfs -T /dev/rdsk/c4t0d0s0
newfs: construct a new file system /dev/rdsk/c4t0d0s0: (y/n)? y
Warning: cylinder groups must have a multiple of 16 cylinders with the given
parameters
Rounded cgsize up to 64
Warning: insufficient space in super block for
rotational layout tables with nsect 63, ntrack 255, and nrpos 8.
Omitting tables - file system performance may be impaired.
Warning: 1 sector(s) in last cylinder unallocated
/dev/rdsk/c4t0d0s0: 625137344 sectors in 38913 cylinders of 255 tracks, 63 sectors
305242.8MB in 811 cyl groups (48 c/g, 376.52MB/g, 384 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 771216, 1542400, 2313584, 3084768, 3855952, 4627136, 5398320, 6169504,
6940688,
Initializing cylinder groups:
................
super-block backups for last 10 cylinder groups at:
617669264, 618440448, 619211632, 619982816, 620754000, 621525184, 622296368,
623067552, 623838736, 624609920

5. buat folder baru

mkdir /rmdisk

6. mount ke /rmdisk

# mount /dev/dsk/c5t0d0s2 /rmdisk
bash-3.00#
bash-3.00# ls
lost+found
bash-3.00# du -kh
8K ./lost+found
16K .
bash-3.00#


7. check mount poinnya

df -kh
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d0 14G 4.9G 9.4G 34% /
/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 26G 1.5M 26G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap2.so.1
14G 4.9G 9.4G 34% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap2.so.1
14G 4.9G 9.4G 34% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
/dev/md/dsk/d6 8.6G 816M 7.7G 10% /tmp
swap 26G 32K 26G 1% /var/run
/dev/md/dsk/d4 19G 408M 19G 3% /source
/dev/md/dsk/d5 29G 4.5G 24G 16% /arch01
/dev/md/dsk/d3 48G 18G 30G 38% /apps
/dev/dsk/c5t0d0s2 298G 64M 295G 1% /rmdisk