Monday, April 22, 2013

Prepare Used Disk for ZPool

Is the disk is already used, you may get can't attach EFI disk to root pool.

If it happens, use format to remove all partition and make sure S2 (in sparc) P0 (in X86) is owning whole disk to assign the disk to pool completely.


partition> p
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -    25      129.19MB    (26/0/0)       264576
  1       swap    wu      26 -    51      129.19MB    (26/0/0)       264576
  2     backup    wu       0 - 14086       68.35GB    (14087/0/0) 143349312
  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        usr    wm      52 - 14086       68.10GB    (14035/0/0) 142820160
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 0
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -    25      129.19MB    (26/0/0)       264576

Enter partition id tag[root]: unassigned
Enter partition permission flags[wm]:
Enter new starting cyl[0]:
Enter partition size[264576b, 26c, 25e, 129.19mb, 0.13gb]: 0
partition> 1
Part      Tag    Flag     Cylinders         Size            Blocks
  1       swap    wu      26 -    51      129.19MB    (26/0/0)       264576

Enter partition id tag[swap]: unassigned
Enter partition permission flags[wu]:wm
Enter new starting cyl[26]: 0
Enter partition size[264576b, 26c, 25e, 129.19mb, 0.13gb]: 0


partition> 2
Part      Tag    Flag     Cylinders         Size            Blocks
  2     backup    wu       0 - 14086       68.35GB    (14087/0/0) 143349312

Enter partition id tag[backup]: unassigned
Enter partition permission flags[wu]: wm
Enter new starting cyl[0]:
Enter partition size[143349312b, 14087c, 14086e, 69994.78mb, 68.35gb]: 68.35gb


partition> l
Ready to label disk, continue? y

Solaris Fiber Channel Check

fcinfo hba-port

Check local side
fcinfo hba-port -l

Check remote side
fcinfo remote-port -slp

Port status
luxadm -e port

Link errors
luxadm -e rdls /dev/cfg/c2
luxadm -e rdls /dev/cfg/c3

Test path
luxadm disp /dev/rdsk/c2t0d0s2

Inquiry Path
luxadm inq /dev/rdsk/c2t0d0s2

SCSI information
cfgadm -al

FC ports
mpathadm list initiator-port

MPath support
mpathadm list mpath-support

Show logical units
mpathadm show lu /dev/rdsk/c2t0d0s2

Find & Mount CDROM

Find CDROM dev name

ls -al /dev/sr* |awk '{print "/dev/" $11}'

Mount as HSFS readonly


mkdir -p /cdrom/unnamed_cdrom
mount -F hsfs -o ro /dev/dsk/c0t6d0s2 /cdrom/unnamed_cdrom



Configure NTP


Enable Solaris ntp to sync time to external servers

vi /etc/inet/ntp.conf


server RemoteHostAddre1
server RemoteHostAddre2
slewalways yes
enable pll
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable

svcadm disable ntp
svcadm enable ntp




Saturday, April 20, 2013

Find Process Locking File

ps -ef | grep -v PID | awk '{print "pfiles "$2}' | sh | awk '/^[0-9]/ {pid=$1} /xxxxxxxx/ {print pid}'


 xxxxxxx is inode of the file.