Sunday, 10 April 2011

solutions for solaris,backup and storage: Hardware RAID configuration in T3-1 Oracle server

solutions for solaris,backup and storage: Hardware RAID configuration in T3-1 Oracle server: "Today I got a chance to configure Hardware RAID in T3-1 oracle server. T3-1 servers are recently launched Chip Multithread servers (CMT) fro..."

Hardware RAID configuration in T3-1 Oracle server

Today I got a chance to configure Hardware RAID in T3-1 oracle server.
T3-1 servers are recently launched Chip Multithread servers (CMT) from oracle which provides a good platform for virtualization applications especially for LDOMS(Unfortunate that i havent tried yet),Containers..
The method of configuring Hardware Raid is simple.The thing is that we will get confused after following steps suggested from Oracle.I have made it simpler.Its mentioned below.Seems Interesting.

Login to the server,you will find 2 harddisk in the server(By default).

1)root@PSBL223 # format
Searching for disks...done




AVAILABLE DISK SELECTIONS:
       0. c0t5000CCA0151C7EB4d0 <SUN300G cyl 46873 alt 2 hd 20 sec 625>
          /scsi_vhci/disk@g5000cca0151c7eb4
       1. c0t5000CCA0151C7F80d0 <SUN300G cyl 46873 alt 2 hd 20 sec 625>
          /scsi_vhci/disk@g5000cca0151c7f80
Specify disk (enter its number): ^C
-----------------------------------------------------------
Now poweroff server to go to SC prompt.What i did was, i gave a tip connection from another solaris server and worked from a remote location.

2)#init 5
-----------------------------------------------------------
Start the SP console. 
Note: Before starting the console please check in which all slots are the HDD's are  inserted in.When I got the server 2 HDD's were there, in which 1 HDD was in the 0th slot and other one in 3rd slot.What i did was i took out the HDD from 3rd slot and inserted it in 1st slot

3)-->start /SYS

Are you sure you want to start /SYS (y/n)? y
Starting /SYS
 /SYS
      Targets: 
           MB 
           MB_ENV 
           USBBD  
           DVD  
           PS0 
           PS1 
           SASBP 
           PDB 
           CONNBD 
           FANBD 
           INTSW 
           PWRBS 
           VPS 
           T_AMB 
           OK 
           LOCATE  
           SERVICE 
           PS_FAULT 
           TEMP_FAULT 
           FAN_FAULT 

    Properties:
           type = Host System 
           ipmi_name = /SYS 
           keyswitch_state = Normal 
           product_name = SPARC T3-1 
           product_part_number = 4745525-4 
           product_serial_number = 1052BDR5A3 
           product_manufacturer = Oracle Corporation 
          fault_state = OK 
          clear_fault_action = (none) 
          power_state = On 

    Commands: 
         cd 
         reset 
         set 
         show 
         start 
         stop
 
----------------------------------------------------------------
Now you can go to the console from SP conssole

4)-> start /HOST/console

Are you sure you want to start /HOST/console (y/n)? y


Serial console started.  To stop, type #.

----------------------------------------------------------------

Check for all the devices connected in server using below command and you will find the below output

5){0} ok show-devs
/pci-performance-counters@400
/niu@480
/pci@400
/cpu@7f
/cpu@7e
/cpu@7d
/cpu@7c
/cpu@7b
/cpu@7a
/cpu@79
/cpu@78
/cpu@77
/cpu@76
/cpu@75
/cpu@74
/cpu@73
/cpu@72
/cpu@71
/cpu@70
/cpu@6f
/cpu@6e
/cpu@6d
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/cpu@6c
/cpu@6b
/cpu@6a
/cpu@69
/cpu@68
/cpu@67
/cpu@66
/cpu@65
/cpu@64
/cpu@63
/cpu@62
/cpu@61
/cpu@60
/cpu@5f
/cpu@5e
/cpu@5d
/cpu@5c
/cpu@5b
/cpu@5a
/cpu@59
/cpu@58
/cpu@57
/cpu@56
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/cpu@55
/cpu@54
/cpu@53
/cpu@52
/cpu@51
/cpu@50
/cpu@4f
/cpu@4e
/cpu@4d
/cpu@4c
/cpu@4b
/cpu@4a
/cpu@49
/cpu@48
/cpu@47
/cpu@46
/cpu@45
/cpu@44
/cpu@43
/cpu@42
/cpu@41
/cpu@40
/cpu@3f
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/cpu@3e
/cpu@3d
/cpu@3c
/cpu@3b
/cpu@3a
/cpu@39
/cpu@38
/cpu@37
/cpu@36
/cpu@35
/cpu@34
/cpu@33
/cpu@32
/cpu@31
/cpu@30
/cpu@2f
/cpu@2e
/cpu@2d
/cpu@2c
/cpu@2b
/cpu@2a
/cpu@29
/cpu@28
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/cpu@27
/cpu@26
/cpu@25
/cpu@24
/cpu@23
/cpu@22
/cpu@21
/cpu@20
/cpu@1f
/cpu@1e
/cpu@1d
/cpu@1c
/cpu@1b
/cpu@1a
/cpu@19
/cpu@18
/cpu@17
/cpu@16
/cpu@15
/cpu@14
/cpu@13
/cpu@12
/cpu@11
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/cpu@10
/cpu@f
/cpu@e
/cpu@d
/cpu@c
/cpu@b
/cpu@a
/cpu@9
/cpu@8
/cpu@7
/cpu@6
/cpu@5
/cpu@4
/cpu@3
/cpu@2
/cpu@1
/cpu@0
/virtual-devices@100
/iscsi-hba
/virtual-memory
/memory@m0,20000000
/aliases
/options
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/openprom
/chosen
/packages
/pci@400/pci@2
/pci@400/pci@1
/pci@400/pci@2/pci@0
/pci@400/pci@2/pci@0/pci@f
/pci@400/pci@2/pci@0/pci@c
/pci@400/pci@2/pci@0/pci@a
/pci@400/pci@2/pci@0/pci@8
/pci@400/pci@2/pci@0/pci@7
/pci@400/pci@2/pci@0/pci@6
/pci@400/pci@2/pci@0/pci@4
/pci@400/pci@2/pci@0/pci@0
/pci@400/pci@2/pci@0/pci@f/pci@0
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,1
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@4
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2/device@4
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2/hub@3
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2/device@4/mouse@1
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2/device@4/keyboard@0
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2/hub@3/storage@2
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2/hub@3/storage@2/disk
/pci@400/pci@2/pci@0/pci@7/network@0,1
/pci@400/pci@2/pci@0/pci@7/network@0
/pci@400/pci@2/pci@0/pci@6/network@0,1
/pci@400/pci@2/pci@0/pci@6/network@0
/pci@400/pci@2/pci@0/pci@4/scsi@0
/pci@400/pci@2/pci@0/pci@4/scsi@0/disk
/pci@400/pci@2/pci@0/pci@4/scsi@0/tape
/pci@400/pci@2/pci@0/pci@0/pci@0
/pci@400/pci@2/pci@0/pci@0/pci@0/display@0
/pci@400/pci@1/pci@0
/pci@400/pci@1/pci@0/pci@8
/pci@400/pci@1/pci@0/pci@6
/pci@400/pci@1/pci@0/pci@4
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/pci@400/pci@1/pci@0/pci@0
/pci@400/pci@1/pci@0/pci@4/scsi@0
/pci@400/pci@1/pci@0/pci@4/scsi@0/disk
/pci@400/pci@1/pci@0/pci@4/scsi@0/tape
/virtual-devices@100/channel-devices@200
/virtual-devices@100/console@1
/virtual-devices@100/random-number-generator@e
/virtual-devices@100/ncp@6
/virtual-devices@100/n2cp@7
/virtual-devices@100/tpm@f
/virtual-devices@100/flashprom@0
/virtual-devices@100/channel-devices@200/virtual-domain-service@0
/virtual-devices@100/channel-devices@200/virtual-channel-client@2
/virtual-devices@100/channel-devices@200/virtual-channel-client@1
/virtual-devices@100/channel-devices@200/virtual-channel@3
/virtual-devices@100/channel-devices@200/virtual-channel@0
/iscsi-hba/disk
/openprom/client-services
/packages/obp-tftp
/packages/kbd-translator
/packages/SUNW,asr
/packages/dropins
/packages/terminal-emulator
[7m More [<space>,<cr>,q,n,p,c] ? [m
                               
/packages/disk-label
/packages/deblocker
/packages/SUNW,builtin-drivers
{0} ok    
{0} ok  


----------------------------------------------------------------------------
Run probe-scsi-all command and check its showing all targets present in the server
Here you can find 2 targets Target 9 and Target a,though only Target 9 is working..we need to select new SCSI device.

6){0} ok probe-scsi-all
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2/hub@3/storage@2
  Unit 0   Removable Read Only device       AMI     Virtual CDROM   1.00

/pci@400/pci@2/pci@0/pci@4/scsi@0

FCode Version 1.00.54 , MPT Version 2.00, Firmware Version 5.00.17.00

Target 9 
  Unit 0   Disk   HITACHI  H103030SCSUN300G A2A8    585937500 Blocks, 300 GB
  SASDeviceName 5000cca0151c7f80  SASAddress 5000cca0151c7f81  PhyNum 0 
Target a 
  Unit 0   Removable Read Only device      TEAC    DV-W28SS-R      1.0C                                                            
  SATA device  PhyNum 6 

/pci@400/pci@1/pci@0/pci@4/scsi@0

FCode Version 1.00.54 , MPT Version 2.00, Firmware Version 5.00.17.00

Target 9 
  Unit 0   Disk   HITACHI  H103030SCSUN300G A2A8    585937500 Blocks, 300 GB
  SASDeviceName 5000cca0151c7eb4  SASAddress 5000cca0151c7eb5  PhyNum 0 

-------------------------------------------------------------------------------------------

Now if you give you show-children we can clearly see only one target.

7){0} ok select /pci@400/pci@1/pci@0/pci@4/scsi@0  (or select scsi0)

   {0} ok show-children

FCode Version 1.00.54 , MPT Version 2.00, Firmware Version 5.00.17.00

Target 9 
  Unit 0   Disk   HITACHI  H103030SCSUN300G A2A8    585937500 Blocks, 300 GB
  SASDeviceName 5000cca0151c7eb4  SASAddress 5000cca0151c7eb5  PhyNum 0 


-----------------------------------------------------------------
Now select the other scsi1 in which we have inserted the 2nd Hdd. The 2 devices needed to be selected i have marked in red colour in show-devs OBP command

8){0} ok select /pci@400/pci@2/pci@0/pci@4/scsi@0

{0} ok show-children

FCode Version 1.00.54, MPT Version 2.00, Firmware Version 5.00.17.00

Target 9
  Unit 0   Disk   HITACHI  H103030SCSUN300G A2A8    585937500 Blocks, 300 GB
  SASDeviceName 5000cca0151c7eb4  SASAddress 5000cca0151c7eb5  PhyNum 0
Target a
  Unit 0   Disk   HITACHI  H103030SCSUN300G A2A8    585937500 Blocks, 300 GB
  SASDeviceName 5000cca0151c7f80  SASAddress 5000cca0151c7f81  PhyNum 1


-----------------------------------------------------------------

Now you can create a RAID using following command with volume size and a volume name.

9){0} ok 9 a create-raid1-volume
Target 9 size is 583983104 Blocks, 298 GB
Target a size is 583983104 Blocks, 298 GB
The volume can be any size from 1 MB to 285148 MB
What size do you want?  [285148]
Volume size will be 583983104 Blocks, 298 GB
Enter a volume name:  [0 to 15 characters] v0
Volume has been created
 
-----------------------------------------------------------------------------

Check for if its showing volumes properly

10){0} ok show-volumes
Volume 0 Target 389  Type RAID1 (Mirroring)
  Name v0  WWID 04b8a3893433dc55
  Optimal  Enabled  Background Init In Progress
  2 Members                                         583983104 Blocks, 298 GB
  Disk 0
    Primary  Optimal
    Target 9      HITACHI  H103030SCSUN300G A2A8
  Disk 1
    Secondary  Optimal
    Target a      HITACHI  H103030SCSUN300G A2A8
-------------------------------------------------------------
After starting the server please verify the format output that it will show only one disk as Raid formation of 2 disk.
11)# format
Searching for disks...done

c0t34B8A3893433DC55d0: configured with capacity of 277.99GB


AVAILABLE DISK SELECTIONS:
       0. c0t34B8A3893433DC55d0 <LSI-LogicalVolume-3000 cyl 65533 alt 2 hd 64 sec 139>
          /pci@400/pci@1/pci@0/pci@4/scsi@0/iport@v0/disk@w34b8a3893433dc55,0
Specify disk (enter its number): 0
selecting c0t34B8A3893433DC55d0
[disk formatted]
Disk not labeled.  Label it now? n
Thus Hardware RAID is configured..In case of any doubts please ask your questions  in my blog..

Saturday, 9 April 2011

X-Manager Configuration in Solaris 10

I was asked to install oracle client. but then i found it difficult as i was not able to login to server through X-Manager.The server was Oracle Solaris 10 and it was in a T3-1 server.A server recently launched with New feature of Hardware RAID.Configuration of hardware raid in T3-1 will be posted in my next article.Here is how i configured X-manager for the server through service configure

Earlier in Solaris 9(before release of solaris 10 )every services was in the form of file systems.Like for starting SSH, u need to go to /etc/init.d and start a particular service linked with rc.xx scripts.But after the release of Solaris 10 A concept like that of registry in windows was put into this unix flavour...andn this structure we can configure.Seems interestin, right???.Another thing is even we can make a new service

Before that let me put a word on X-manager which is a tool through which we can login to any Unix server in GUI mode.There are some other tools like humming Bird..etc...But X-Manager is preferred due to its flexibility and performance.

Through command svccfg we can configure any service
1)# svccfg
svc:>



from here if you press tab button 2 times you can see which all are the services.and for X-Manager select the service 'cde-login'
-----------------------------------------------------------

2)select cde-login
svc:/application/graphical-login/cde-login>


here again if you give tab button 2 times you can see various options.I have listed property 'arg'


3)svc:/application/graphical-login/cde-login>

add         delhash     exit        inventory   repository  validate
addpg       delpg       export      list        select
apply       delprop     extract     listpg      set
archive     editprop    help        listprop    setprop
delete      end         import      quit        unselect

svc:/application/graphical-login/cde-login> listprop arg

-----------------------------------------------------------
now i set the property dtlogin/args with udp port 177 and quit it
4)svc:/application/graphical-login/cde-login> setprop dtlogin/args=astring:" -udpPort 177"
svc:/application/graphical-login/cde-login> quit

-----------------------------------------------------------
after that i restarted the service cde-login.
5)# svcadm restart cde-login
check for the service if its running or not..you are supposed to get a service running on udpPort 177
and if its running then its done.Else you do one thing.(sshhh.... take a hammer and make it into a round shape..we can play football)
-------------------------------------------------------------
6)# pgrep -lf dtlogin
18325 /usr/dt/bin/dtlogin -daemon -udpPort 177

Now you can login to your server through X-manager

Saturday, 12 March 2011

Adding SWAP space and DUMP space to a ZFS installed solaris SPARC machine.

Its very easy to add swap space in ZFS installed machine and the concept is same as that of UFS.
In UFS we make use of commands 'mkfile' and 'swap -a'.Here with the use of a single command we add swap space and dump space.Below i have mentioned the step by step procedure:


1st check the size given for dump size using the below command

1)bash-3.00# zfs get volsize zpool/dump
  NAME        PROPERTY  VALUE    SOURCE
  zpool/dump  volsize   1G       local

------------------------------------------
now i am going to change the size of dump using the below command

2)bash-3.00# zfs set volsize=2G zpool/dump

------------------------------------------

we can check the swap size and we can find the size is changed to 2G

3)bash-3.00# zfs get volsize zpool/dump
  NAME        PROPERTY  VALUE    SOURCE
  zpool/dump  volsize   2G       local

------------------------------------------


similarly for swap

1)bash-3.00# zfs get volsize zpool/swap
  NAME        PROPERTY  VALUE    SOURCE
  zpool/swap  volsize   14.6G    local

2)bash-3.00# zfs set volsize=20G zpool/swap

3)bash-3.00# zfs get volsize zpool/swap
NAME        PROPERTY  VALUE    SOURCE
zpool/swap  volsize   20G      local


----------------------------------------------

Creating Alternate Boot Enviornment for ZFS

 Today i learned how to create an alternate boot enviornment for a ZFS installed solaris SPARC machine.
I follwed the below steps:
                                                                                                                          

Check if any boot enviornments are created already or not
1)bash-3.00# lustatus
  ERROR: No boot environments are configured on this system
  ERROR: cannot determine list of all boot environment names
---------------------------------------------------------------------------------------

so here only one boot enviornment is configured,now we can create
one more boot enviornment by 'lucreate' command with the alternate 
boot enviornment name as 's10s_u9wos_14a2'(here i have given name to my choice) 

2)bash-3.00# lucreate -n s10s_u9wos_14a2
  
  Analyzing system configuration.
  No name for current boot environment.
  INFORMATION: The current boot environment is not named - assigning name <s10s_u9wos_14a>.
  Current boot environment is named <s10s_u9wos_14a>.
  Creating initial configuration for primary boot environment <s10s_u9wos_14a>.
  The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
  PBE configuration successful: PBE name <s10s_u9wos_14a> PBE Boot Device </dev/dsk/c1t0d0s0>.
  Comparing source boot environment <s10s_u9wos_14a> file systems with the
  file system(s) you specified for the new boot environment. Determining
  which file systems should be in the new boot environment.
  Updating boot environment description database on all BEs.
  Updating system configuration files.
  Creating configuration for boot environment <s10s_u9wos_14a2>.
  Source boot environment is <s10s_u9wos_14a>.
  Creating boot environment <s10s_u9wos_14a2>.
  Cloning file systems from boot environment <s10s_u9wos_14a> to create boot environment <s10s_u9wos_14a2>.
  Creating snapshot for <zpool/ROOT/s10s_u9wos_14a> on <zpool/ROOT/s10s_u9wos_14a@s10s_u9wos_14a2>.
  Creating clone for <zpool/ROOT/s10s_u9wos_14a@s10s_u9wos_14a2> on <zpool/ROOT/s10s_u9wos_14a2>.
  Setting canmount=noauto for </> in zone <global> on <zpool/ROOT/s10s_u9wos_14a2>.
  Creating snapshot for <zpool/ROOT/s10s_u9wos_14a/var> on <zpool/ROOT/s10s_u9wos_14a/var@s10s_u9wos_14a2>.
  Creating clone for <zpool/ROOT/s10s_u9wos_14a/var@s10s_u9wos_14a2> on <zpool/ROOT/s10s_u9wos_14a2/var>.
  Setting canmount=noauto for </var> in zone <global> on <zpool/ROOT/s10s_u9wos_14a2/var>.
  Creating dataset <zpool/ROOT/s10s_u9wos_14a2/zoneds/zonesan-s10s_u9wos_14a2> for zone <zonesan>
  Copying root of zone <zonesan>.
  Creating snapshot for <zpool/export/home/zonejos> on <zpool/export/home/zonejos@s10s_u9wos_14a2>.
  Creating clone for <zpool/export/home/zonejos@s10s_u9wos_14a2> on <zpool/export/home/zonejos-s10s_u9wos_14a2>.
  Population of boot environment <s10s_u9wos_14a2> successful.
  Creation of boot environment <s10s_u9wos_14a2> successful.
----------------------------------------------------------------------------------

Check for the new boot enviornment created
3)bash-3.00# lustatus
  Boot Environment           Is       Active Active    Can    Copy
  Name                       Complete Now    On Reboot Delete Status
  -------------------------- -------- ------ --------- ------ ----------
  s10s_u9wos_14a             yes      yes    yes       no     -
  s10s_u9wos_14a2            yes      no     no        yes    -


-----------------------------------------------------------------------------------

4)bash-3.00# zfs list
NAME                                                        USED  AVAIL  REFER  MOUNTPOINT
zpool                                                      22.9G   111G    97K  /zpool
zpool/ROOT                                                 5.57G   111G    21K  legacy
zpool/ROOT/s10s_u9wos_14a                                  5.47G   111G  5.38G  /
zpool/ROOT/s10s_u9wos_14a@s10s_u9wos_14a2                  78.5K      -  5.38G  -
zpool/ROOT/s10s_u9wos_14a/var                              93.0M   111G  92.9M  /var
zpool/ROOT/s10s_u9wos_14a/var@s10s_u9wos_14a2                59K      -  92.9M  -
zpool/ROOT/s10s_u9wos_14a2                                  104M   111G  5.38G  /
zpool/ROOT/s10s_u9wos_14a2/var                                 0   111G  92.9M  /var
zpool/dump                                                 2.00G   111G  2.00G  -
zpool/export                                                201M   111G    23K  /export
zpool/export/home                                           201M   111G   104M  /export/home
zpool/swap                                                 15.1G   126G    16K  -

-----------------------------------------------------------
if you have created zones the boot enviornment will reflect there also.
here i configured a zone 'zonejos'
5)bash-3.00# zfs list
NAME                                                        USED  AVAIL  REFER  MOUNTPOINT
zpool                                                      22.9G   111G    97K  /zpool
zpool/ROOT                                                 5.57G   111G    21K  legacy
zpool/ROOT/s10s_u9wos_14a                                  5.47G   111G  5.38G  /
zpool/ROOT/s10s_u9wos_14a@s10s_u9wos_14a2                  78.5K      -  5.38G  -
zpool/ROOT/s10s_u9wos_14a/var                              93.0M   111G  92.9M  /var
zpool/ROOT/s10s_u9wos_14a/var@s10s_u9wos_14a2                59K      -  92.9M  -
zpool/ROOT/s10s_u9wos_14a2                                  104M   111G  5.38G  /
zpool/ROOT/s10s_u9wos_14a2/var                                 0   111G  92.9M  /var
zpool/ROOT/s10s_u9wos_14a2/zoneds                           103M   111G    23K  /zoneds
zpool/ROOT/s10s_u9wos_14a2/zoneds/zonesan-s10s_u9wos_14a2   103M   111G   103M  /zoneds/zonesan-s10s_u9wos_14a2
zpool/dump                                                 2.00G   111G  2.00G  -
zpool/export                                                201M   111G    23K  /export
zpool/export/home                                           201M   111G   104M  /export/home
zpool/export/home/zonejos                                  97.0M   111G  97.0M  /export/home/zonejos
zpool/export/home/zonejos@s10s_u9wos_14a2                      0      -  97.0M  -
zpool/export/home/zonejos-s10s_u9wos_14a2                  39.5K   111G  97.0M  /export/home/zonejos-s10s_u9wos_14a2
zpool/swap                                                 15.1G   126G    16K  -

---------------------------------------------------------------
you can boot from alternate boot envionment using boot -L command from ok> prompt or using luactivate command and its recommended highly not to give reboot commands or shutdoen commands
6)bash-3.00# luactivate s10s_u9wos_14a2
A Live Upgrade Sync operation will be performed on startup of boot environment <s10s_u9wos_14a2>.
---------------------------------------------------------------
{2} ok boot -L
Boot device: /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w500000e0129fa191,0:a  File and args: -L
1 s10s_u9wos_14a
2 s10s_u9wos_14a2
Select environment to boot: [ 1 - 2 ]: 2

To boot the selected entry, invoke:
boot [<root-device>] -Z zpool/ROOT/s10s_u9wos_14a2
{2} ok boot -Z rpool/ROOT/zfsnv_952BE
Resetting ...
{2} ok boot -Z zpool/ROOT/s10s_u9wos_14a2
Resetting ...


Software Reset

Enabling system bus....... Done
Initializing CPUs......... Done
Initializing boot memory.. Done
Initializing OpenBoot
Probing system devices
Probing I/O buses

Sun Fire V490, No Keyboard
Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.18.8, 8192 MB memory installed, Serial #71211080.
Ethernet address 0:14:4f:3e:98:48, Host ID: 843e9848.





Rebooting with command: boot -Z zpool/ROOT/s10s_u9wos_14a2
Boot device: /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w500000e0129fa191,0:a  File and args: -Z zpool/ROOT/s10s_u9wos_14a2
SunOS Release 5.10 Version Generic_142909-17 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
Hostname: PTEST231
Reading ZFS config: done.
Mounting ZFS filesystems: (19/19)

PTEST231 console login:
----------------------------------------------------------------------------
now the boot environment is the new one created.At times we will get an error that root file system will not get mounted,what i did was:
got to single user mode from cdrom
{2}ok boot cdrom -s
now just try restarting system usin init command(Please don't use reboot or shutdown command)
#init 6
again if its coming to ok prompt then we have to try another method,
1) Boot the machine to Single User mode from solaris dvd 
 {2}ok boot cdrom -s
  
----------------------------------------------------------------------
Now mount / directory (from current boot environment) on to a new directory,say /mnt after that run command 'luactivate' which activte earlier boot enviornment
2) #zpool import zpool 
3) #zfs get mountpoint zpool/ROOT/s10s_u9wos_14a
4) #zfs get mounted zpool/ROOT/s10s_u9wos_14a
5) #zfs set mountpoint=/mnt zpool/ROOT/s10s_u9wos_14a
6) #zfs mount zpool/ROOT/s10s_u9wos_14a (name of my pool is 'zpool' and don't get confused)
7) #/mnt/sbin/luactivate
8) #init 6
it will be successful

Wednesday, 9 March 2011

Breaking ROOT Password in ZFS Solaris SPARC machine





Today i learnd how to reset the root password for a ZFS installed OS on a sparc machine.The concept is same as in UFS except for the commands used .Below i have mentioned it in a systematic way:

I booted the system into single user mode after inserting the solaris 10 cd





1)# boot cdrom -s
{10} ok boot cdrom -s
Resetting ...


Software Reset

Enabling system bus....... Done
Initializing CPUs......... Done
Initializing boot memory.. Done
Initializing OpenBoot
Probing system devices
Probing I/O buses

Sun Fire V490, No Keyboard
Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.18.8, 32768 MB memory installed, Serial #712224356.
Ethernet address 0:14:4f:3r:9t:42, Host ID: 843e11324.

Rebooting with command: boot cdrom -s
Boot device: /pci@8,700000/ide@6/cdrom@0,0:f  File and args: -s
SunOS Release 5.10 Version Generic_142909-17 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
Booting to milestone "milestone/single-user:default".
Configuring devices.
Using RPC Bootparams for network configuration information.
Attempting to configure interface ce5...
Skipped interface ce5
Attempting to configure interface ce4...
Skipped interface ce4
Attempting to configure interface ce3...
Skipped interface ce3
Attempting to configure interface ce2...
Skipped interface ce2
Attempting to configure interface ce1...
Skipped interface ce1
Attempting to configure interface ce0...
Configured interface ce0
WARNING: ce0 has duplicate address 010.131.048.221 (in use by 0:14:4f:3r:9t:42); disabled
Requesting System Maintenance Mode
SINGLE USER MODE
# df -h
Filesystem             size   used  avail capacity  Mounted on
/ramdisk-root:a        197M   175M   2.3M    99%    /
/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                   7.4G   344K   7.4G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
swap                   7.4G   592K   7.4G     1%    /tmp
/tmp/dev               7.4G   592K   7.4G     1%    /dev
fd                       0K     0K     0K     0%    /dev/fd
/devices/pci@8,700000/ide@6/sd@0,0:f
                       2.1G   2.1G     0K   100%    /cdrom
df: cannot statvfs /platform/sun4u-us3/lib/libc_psr.so.1: Operation not applicable
df: cannot statvfs /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1: Operation not applicable
swap                   7.4G     8K   7.4G     1%    /tmp/root/var/run
---------------------------------------------------------------------------------
If you need to work on vi,just export your EDITOR and TERMINAL
just check for ZFS file systems mounted 
2) #export EDITOR=vi
export TERM=vt100

# zfs list
no datasets available
--------------------------------------------------------------------------------
as there are no pools we have to import pools and 
this will tell what all pools are there to import

3)# zpool import
  pool: zpool
    id: 12781544736217994069
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

        zpool       ONLINE
          c1t0d0s0  ONLINE
--------------------------------------------------------------------------------
import the pool required and it will display the following message.
These ZFS file systems doesn't get mounted but still it exists

4)# zpool import zpool
cannot mount '/export': failed to create mountpoint
cannot mount '/export/home': failed to create mountpoint
cannot mount '/zpool': failed to create mountpoint
--------------------------------------------------------------------------------
now check for the ZFS filesystems mounted,we can notice that the /etc/shadow file 
that we need to access is in zpool/ROOT/s10s_u9wos_14a which is mounted on / is in use  

5)# zfs list
NAME                            USED  AVAIL  REFER  MOUNTPOINT
zpool                          21.6G   112G    96K  /zpool
zpool/ROOT                     5.46G   112G    21K  legacy
zpool/ROOT/s10s_u9wos_14a      5.46G   112G  5.37G  /
zpool/ROOT/s10s_u9wos_14a/var  92.3M   112G  92.3M  /var
zpool/dump                     1.00G   112G  1.00G  -
zpool/export                     44K   112G    23K  /export
zpool/export/home                21K   112G    21K  /export/home
zpool/swap                     15.1G   127G    16K  -
---------------------------------------------------------------------------------
Just check the status of that mount point(zpool/ROOT/s10s_u9wos_14a) mounted on root 
and set a mount point  

6)# zfs get mountpoint zpool/ROOT/s10s_u9wos_14a
NAME                       PROPERTY    VALUE       SOURCE
zpool/ROOT/s10s_u9wos_14a  mountpoint  /           local
  # zfs get mounted zpool/ROOT/s10s_u9wos_14a
NAME                       PROPERTY  VALUE    SOURCE
zpool/ROOT/s10s_u9wos_14a  mounted   no       -
  # zfs set mountpoint=/mnt zpool/ROOT/s10s_u9wos_14a
  # zfs list
  NAME                            USED  AVAIL  REFER  MOUNTPOINT
  zpool                          21.6G   112G    96K  /zpool
  zpool/ROOT                     5.46G   112G    21K  legacy
  zpool/ROOT/s10s_u9wos_14a      5.46G   112G  5.37G  /mnt
  zpool/ROOT/s10s_u9wos_14a/var  92.3M   112G  92.3M  /mnt/var
  zpool/dump                     1.00G   112G  1.00G  -
  zpool/export                     44K   112G    23K  /export
  zpool/export/home                21K   112G    21K  /export/home
  zpool/swap                     15.1G   127G    16K  -
-----------------------------------------------------------------------------------
Just check the status of that mount point(zpool/ROOT/s10s_u9wos_14a) mounted on root 
and set a mount point  

6)# zfs get mountpoint zpool/ROOT/s10s_u9wos_14a
NAME                       PROPERTY    VALUE       SOURCE
zpool/ROOT/s10s_u9wos_14a  mountpoint  /           local
  # zfs get mounted zpool/ROOT/s10s_u9wos_14a
NAME                       PROPERTY  VALUE    SOURCE
zpool/ROOT/s10s_u9wos_14a  mounted   no       -
  # zfs set mountpoint=/mnt zpool/ROOT/s10s_u9wos_14a
  # zfs list
  NAME                            USED  AVAIL  REFER  MOUNTPOINT
  zpool                          21.6G   112G    96K  /zpool
  zpool/ROOT                     5.46G   112G    21K  legacy
  zpool/ROOT/s10s_u9wos_14a      5.46G   112G  5.37G  /mnt
  zpool/ROOT/s10s_u9wos_14a/var  92.3M   112G  92.3M  /mnt/var
  zpool/dump                     1.00G   112G  1.00G  -
  zpool/export                     44K   112G    23K  /export
  zpool/export/home                21K   112G    21K  /export/home
  zpool/swap                     15.1G   127G    16K  -
------------------------------------------------------------------------------
go to /etc/shadow file using VI,create a copy of shadow file and change the value in 
encrypted password field

8)# cd /mnt
  # ls
   bin       dev       export    lib       opt       sbin      usr       zpool
   boot      devices   home      mnt       platform  system    var
   cdrom     etc       kernel    net       proc      tmp       vol
  # cd /etc/
  # vi shadow
   "shadow" 17 lines, 338 characters
    root::6445::::::
    daemon:NP:6445::::::
    bin:NP:6445::::::
    sys:NP:6445::::::
    adm:NP:6445::::::
    lp:NP:6445::::::
    uucp:NP:6445::::::
    nuucp:NP:6445::::::
    smmsp:NP:6445::::::
    listen:*LK*:::::::
    gdm:*LK*:::::::
    webservd:*LK*:::::::
    postgres:NP:::::::
    svctag:*LK*:6445::::::
    nobody:*LK*:6445::::::
    noaccess:*LK*:6445::::::
    nobody4:*LK*:6445::::::
(its difficult for vi rditor to work in some systems..in that case please make use of  other unix commands to make changes to the file.For me also this didn't work.what i did was using vi commands like-w,cw,dw-i made changes)
-------------------------------------------------------------------------
umount the ZFS file system and change the mount point back to /
9)# cd /
  # zfs umount zpool/ROOT/s10s_u9wos_14a
  # zfs set mountpoint=/ zpool/ROOT/s10s_u9wos_14a
  # zfs list
  NAME                            USED  AVAIL  REFER  MOUNTPOINT
  zpool                          21.6G   112G    96K  /zpool
  zpool/ROOT                     5.46G   112G    21K  legacy
  zpool/ROOT/s10s_u9wos_14a      5.46G   112G  5.37G  /
  zpool/ROOT/s10s_u9wos_14a/var  92.3M   112G  92.3M  /var
  zpool/dump                     1.00G   112G  1.00G  -
  zpool/export                     44K   112G    23K  /export
  zpool/export/home                21K   112G    21K  /export/home
  zpool/swap                     15.1G   127G    16K  -


 if you want to check again,got to /etc/shadow and again delete the entry in 
 encrypted shadow region(What i did was i took the encypted shadow part from a server for which i knew the root password and pasted here)
---------------------------------------------------------------------------------
10)init 6
now u can login to the server without a password if you have deleted the entry in /etc/shadow or with the password of the server from which you have taken the encrypted field /etc/shadow