Tuesday, March 4, 2008

How to add new Iscsi disk

Use the following steps to create a new iscsi disk on sun solaris (10)

  1. Define the disk in the storage gui
  2. Login as root to the system
  3. Enable Iscsi:
    iscsiadm modify discovery -s enable
    iscsiadm list discovery-address -v
  4. Define Iscsi:
    1. svcs -a | grep -i iscsi
      you should get : disabled Jan_22 svc:/network/
      iscsi_initiator:default
    2. iscsiadm list initiator-node
      you should get : Initiator node name: iqn.1986-03.com.sun:01:0003ba321f11.4523d4a8

  5. Rescan iscsi to find new disks
    1. devfsadm -C -i iscsi
      this command scan for new disks. please note -C is to cleanup old disks definitions , -i is for iscsi only
  6. Use format to define new partitions
    1. format
      you should get a list of disks like that -
      AVAILABLE DISK SELECTIONS:

      0. c0t0d0
      /pci@1c,600000/scsi@2/sd@0,0
      1. c0t1d0
      /pci@1c,600000/scsi@2/sd@1,0
      2. c2t1d0
      /iscsi/disk@0000iqn.2005-10.com.xivstorage%3A0101230000,0
      3. c2t2d0
      /iscsi/disk@0000iqn.2005-10.com.xivstorage%3A0101230000,1
      4. c2t4d0
      /iscsi/disk@0000iqn.2005-10.com.xivstorage%3A0101230000,2
      5. c2t5d0
      /iscsi/disk@0000iqn.2005-10.com.xivstorage%3A0101230000,3
      Specify disk (enter its number):
    2. 3
      choose one of the disks if you get Disk not labeled. Label it now? - put yes
    3. 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
      repair - repair a defective sector
      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
      inquiry - show vendor, product and revision
      volname - set 8-character volume name
      ! - execute , then return
      quit
      partition (or p as shortcut)
      print (or p as shortcut)
      quit
      quit (to exit format)
  7. Create a new file system
    1. newfs /dev/rdsk/c2t2d0s6
      you should get newfs: construct a new file system /dev/rdsk/c2t2d0s6: (y/n)?
      press - y
    2. mount /dev/dsk/c2t2d0s6 /oracle
      make sure that /oracle directory is exists.

No comments: