This
short tutorial will guide you how to add iSCSI storage under Oracle Solaris
11 and how to create partition of iSCSI disk.
Check iSCSI discovery status
root@psrserver:~# iscsiadm
list discovery
Discovery:
        Static: disabled
        Send Targets: disabled
        iSNS: disabled
Enable iSCSI Static discovery
root@psrserver:~# iscsiadm
modify discovery -s enable
root@psrserver:~# iscsiadm
list discovery
Discovery:
        Static: enabled
        Send Targets: disabled
        iSNS: disabled
Add iSCSI targets
root@psrserver:~# iscsiadm
add static-config \ iqn.2006-01.com.openfiler:tsn.9b2243435347,172.22.2.15
root@psrserver:~# devfsadm -C
-i iscsi
Partitioning the iSCSI Disk
root@psrserver:~# format
Searching for disks...done
c9t2d0: configured with
capacity of 9.52GB
AVAILABLE DISK SELECTIONS:
       0. c8t0d0 
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c9t2d0 
         
/iscsi/disk@0000iqn.2006-01.com.openfiler%3Atsn.9b22434353470001,0
Specify disk (enter its
number): 1
selecting c9t2d0
[disk formatted]
No Solaris fdisk partition
found.
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
        fdisk      - run the fdisk program
        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 disk ID
        volname    - set 8-character volume name
        !     - execute , then return  
        quit
format> fdisk
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
format> par
PARTITION MENU:
        0     
- change `0' partition
        1     
- change `1' partition
        2     
- change `2' partition
        3     
- change `3' partition
        4     
- change `4' partition
        5     
- change `5' partition
        6  
   - change `6' partition
        7     
- change `7' partition
        select - select a predefined table
        modify - modify a predefined partition
table
        name  
- name the current table
        print 
- display the current table
        label 
- write partition map and label to the disk
        ! - execute ,
then return  
        quit
partition> pr
Current partition table
(original):
Total disk cylinders
available: 1241 + 2 (reserved cylinders)
Part      Tag   
Flag     Cylinders        Size            Blocks
  0 unassigned    wm      
0               0         (0/0/0)           0
  1 unassigned    wm      
0               0         (0/0/0)           0
  2    
backup    wu       0 - 1240        9.51GB    (1241/0/0) 19936665
  3 unassigned    wm      
0               0         (0/0/0)           0
  4 unassigned    wm      
0               0         (0/0/0)           0
  5 unassigned    wm      
0               0         (0/0/0)           0
  6 unassigned    wm      
0               0        
(0/0/0)           0
  7 unassigned    wm      
0               0         (0/0/0)           0
  8      
boot    wu       0 -   
0        7.84MB    (1/0/0)       16065
  9 unassigned    wm      
0               0         (0/0/0)           0
partition> 0
Part      Tag   
Flag     Cylinders        Size            Blocks
  0 unassigned    wm      
0               0         (0/0/0)           0
Enter partition id
tag[unassigned]:
Enter partition permission
flags[wm]:
Enter new starting cyl[0]:
Enter partition size[0b, 0c,
0e, 0.00mb, 0.00gb]: $
partition> label
Ready to label disk,
continue? y
partition> pr
Current partition table
(unnamed):
Total disk cylinders
available: 1241 + 2 (reserved cylinders)
Part      Tag   
Flag     Cylinders        Size            Blocks
  0 unassigned    wm      
0 - 1240        9.51GB    (1241/0/0) 19936665
  1 unassigned    wm      
0               0         (0/0/0)           0
  2    
backup    wu       0 - 1240        9.51GB    (1241/0/0) 19936665
  3 unassigned    wm      
0               0         (0/0/0)           0
  4 unassigned    wm      
0               0         (0/0/0)           0
  5 unassigned    wm      
0               0         (0/0/0)           0
  6 unassigned    wm      
0               0        
(0/0/0)           0
  7 unassigned    wm      
0               0         (0/0/0)           0
  8      
boot    wu       0 -   
0        7.84MB    (1/0/0)       16065
  9 unassigned    wm      
0               0         (0/0/0)           0
partition>q
Apply filesystem and mount newly created partition
root@psrserver:~# newfs
/dev/rdsk/c9t2d0s0
newfs: construct a new file
system /dev/rdsk/c9t2d0s0: (y/n)? y
Warning: 616 sector(s) in
last cylinder unallocated
/dev/rdsk/c9t2d0s0:     19936664 sectors in 3245 cylinders of 48
tracks, 128 sectors
       
9734.7MB in 203 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck
-F ufs -o b=#) at:
 32, 98464, 196896, 295328, 393760, 492192,
590624, 689056, 787488, 885920,
 18972832, 19071264, 19169696, 19268128,
19366560, 19464992, 19563424,
 19661856, 19760288, 19858720
root@psrserver:~# mkdir
/iscsidsk
root@psrserver:~# mount
/dev/dsk/c9t2d0s0 /iscsidsk
root@psrserver:~# df –h
/dev/dsk/c7t0d0s2      585M  
585M         0K   100%   
/media/Oracle_Solaris-11_1-Text-X86
/export/home/labuser    25G   
34K        25G     1%   
/home/labuser
/dev/dsk/c9t2d0s0      9.4G  
9.5M       9.3G     1%   
/iscsidsk
That's it. 
