Add disk Solaris

How to configure just newly added disks in Solaris 10? It’s really simple.
1. first show all attached targets

bash-3.00# cfgadm -al

Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c0::dsk/c0t0d0                 disk         connected    configured   unknown
c0::dsk/c0t1d0                 disk         connected    configured   unknown
c0::dsk/c0t6d0                 CD-ROM       connected    configured   unknown
c1                             fc-fabric    connected    configured   unknown
c1::200500a0b8169d18           disk         connected    configured   unknown
c1::5006016008065109           disk         connected    configured   unknown
c2                             fc-fabric    connected    configured   unknown
c2::200400a0b8169d18           disk         connected    configured   unknown
c2::5006016108065109           disk         connected    unconfigured unknown
c2::5006016908065109           disk         connected    configured   unknown
c2::500604843d489c84           disk         connected    configured   unknown
c3                             scsi-bus     connected    unconfigured unknown

bash-3.00#

2.  now I attached SCSI JBOD to c3 – let’s configure them

bash-3.00# cfgadm -c configure c3
bash-3.00# cfgadm -al

Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c0::dsk/c0t0d0                 disk         connected    configured   unknown
c0::dsk/c0t1d0                 disk         connected    configured   unknown
c0::dsk/c0t6d0                 CD-ROM       connected    configured   unknown
c1                             fc-fabric    connected    configured   unknown
c1::200500a0b8169d18           disk         connected    configured   unknown
c1::5006016008065109           disk         connected    configured   unknown
c2                             fc-fabric    connected    configured   unknown
c2::200400a0b8169d18           disk         connected    configured   unknown
c2::5006016108065109           disk         connected    unconfigured unknown
c2::5006016908065109           disk         connected    configured   unknown
c2::500604843d489c84           disk         connected    configured   unknown
c3                             scsi-bus     connected    configured   unknown
c3::dsk/c3t8d0                 disk         connected    configured   unknown
c3::dsk/c3t9d0                 disk         connected    configured   unknown
c3::dsk/c3t10d0                disk         connected    configured   unknown
c3::dsk/c3t11d0                disk         connected    configured   unknown
c3::dsk/c3t12d0                disk         connected    configured   unknown
c3::dsk/c3t13d0                disk         connected    configured   unknown
c3::dsk/c3t14d0                disk         connected    configured   unknown

3. Now we have to create a partition using format utility and then create a new filesystem for it.

format>

AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 4092 alt 2 hd 128 sec 32>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
1. c0d1 <DEFAULT cyl 4092 alt 2 hd 128 sec 32>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
2. c1d1 <DEFAULT cyl 2556 alt 2 hd 128 sec 32>
/pci@0,0/pci-ide@7,1/ide@1/cmdk@1,0
3. c2t0d0 <DEFAULT cyl 4092 alt 2 hd 128 sec 32>
/pci@0,0/pci15ad,1976@10/sd@0,0
4. c2t1d0 <DEFAULT cyl 3914 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@1,0
Specify disk (enter its number): 4

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>partition         //alternately you can quit format, select disk number again and enter ‘p’ twice
format>print

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 – 3912       29.98GB    (3913/0/0) 62862345
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]: 29.98gb
`29.98gb’ is out of range
Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 29.00gb
partition> p
Current partition table (unnamed):
Total disk cylinders available: 3913 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
0 unassigned    wm       0 – 3785       29.00GB    (3786/0/0) 60822090
1 unassigned    wm       0               0         (0/0/0)           0
2     backup    wu       0 – 3912       29.98GB    (3913/0/0) 62862345
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> label
Ready to label disk, continue? yes

format>quit

$ newfs /dev/rdsk/c2t1d0s0
bash-3.00# newfs /dev/rdsk/c2t1d0s0
newfs: construct a new file system /dev/rdsk/c2t1d0s0: (y/n)? y
Warning: 3510 sector(s) in last cylinder unallocated
/dev/rdsk/c2t1d0s0:     60822090 sectors in 9900 cylinders of 48 tracks, 128 sectors

$ fsck /dev/rdsk/c2t1d0s0
** /dev/rdsk/c2t1d0s0
** Last Mounted on
** Phase 1 – Check Blocks and Sizes
** Phase 2 – Check Pathnames
** Phase 3a – Check Connectivity
** Phase 3b – Verify Shadows/ACLs
** Phase 4 – Check Reference Counts
** Phase 5 – Check Cylinder Groups
2 files, 9 used, 29950474 free (18 frags, 3743807 blocks, 0.0% fragmentation)

4. Now the final step is mounting the filesystem we created.

And then mount the partition. In this case, I’m making a /rman partition:
bash-3.00# mkdir /rman
bash-3.00# mount /dev/dsk/c2t1d0s0 /rman
bash-3.00# df -h

Next, add the proper line to vfstab, else it will unmount when you reboot the server.

$ vi /etc/vfstab

/dev/dsk/c2t1d0s0 /dev/rdsk/c2t1d0s0     /rman ufs     2       yes     –

That’s it, Simple and easy!

Advertisements

One thought on “Add disk Solaris

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s