Getting the Solaris format utility to work with an expanded LUN

A while back I wrote an article titled dynamically growing a Clariion LUN with Solaris. In the article I described how to update the VTOC on a UN that was resized on the storage array. One of my colleagues came to me a few weeks back and told me the procedure was not working, and he couldn’t assign a new size (200GB in this case) to the device in format.

This made me curious, so I started poking around. To see what Solaris thought the actual size of the LUN was, I ran luxadm with the “display” option:

$ luxadm display /dev/rdsk/c5t600601602B9318008CD071B0FF7BDB11d0s2

DEVICE PROPERTIES for disk: /dev/rdsk/c5t600601602B9318008CD071B0FF7BDB11d0s2
  Vendor:               DGC     
  Product ID:           RAID 5          
  Revision:             0322
  Serial Num:           APM000612076
  Unformatted capacity: 204800.000 MBytes
  Read Cache:           Enabled
    Minimum prefetch:   0x0
    Maximum prefetch:   0x0
  Device Type:          Disk device
  Path(s):

  /dev/rdsk/c5t600601602B9318008CD071B0FF7BDB11d0s2
  /devices/scsi_vhci/disk@g600601602b9318008cd071b0ff7bdb11:c,raw
   Controller           /dev/cfg/c3
    Device Address              5006016039a00e91,1
    Host controller port WWN    10000000c9563354
    Class                       secondary
    State                       STANDBY
   Controller           /dev/cfg/c3
    Device Address              5006016939a00e91,1
    Host controller port WWN    10000000c9563354
    Class                       primary
    State                       ONLINE
   Controller           /dev/cfg/c4
    Device Address              5006016139a00e91,1
    Host controller port WWN    10000000c9563355
    Class                       secondary
    State                       STANDBY
   Controller           /dev/cfg/c4
    Device Address              5006016839a00e91,1
    Host controller port WWN    10000000c9563355
    Class                       primary
    State                       ONLINE

On the host we were having issues with, Solaris was able to see all 200GB, but for some reason the format “Auto Configure” option still thought the LUN was 50GB. When I chose the format type “DEFAULT,” the LUN showed up with a capacity of 200GB:

$ format -e

format> type
AVAILABLE DRIVE TYPES:
        0. Auto configure
        1. DEFAULT
        2. DEFAULT
        3. DEFAULT
        4. other
Specify disk type (enter its number)[2]: 1
selecting c5t600601602B9318008CD071B0FF7BDB11d0
[disk formatted]

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

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       1 - 26104      199.97GB    (26104/0/0) 419360760
  1 unassigned    wm       0                0         (0/0/0)             0
  2     backup    wu       0 - 26104      199.97GB    (26105/0/0) 419376825
  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

After chatting with some qualified Sun folks, this madness started to make sense. When you select “Auto Configure,” format will choose an entry from the format.dat file instead of determing the drive’s capacity from the SCSI READ CAPACITY command. The DEFAULT option causes this command to be sent, and therefore the new capacity is available. For future reference, running format with the “-e” option and choosing “DEFAULT” seems to work.

5 thoughts on “Getting the Solaris format utility to work with an expanded LUN”

  1. Hello,

    [root@minex:/]# format -e
    Searching for disks…done

    AVAILABLE DISK SELECTIONS:
    0. c0t50060E801042ACF1d0
    /pci@8,700000/emlx@3/fp@0,0/ssd@w50060e801042acf1,0
    ……………….
    22. c2t50060E801042ACF0d3
    /pci@8,600000/emlx@1/fp@0,0/ssd@w50060e801042acf0,3

    Specify disk (enter its number): 11
    selecting c0t50060E801042ACF3d15
    [disk formatted]

    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
    scsi – independent SCSI mode selects
    cache – enable, disable or query SCSI disk cache
    volname – set 8-character volume name
    ! – execute , then return
    quit
    format> type

    AVAILABLE DRIVE TYPES:
    0. Auto configure
    1. Quantum ProDrive 80S
    2. Quantum ProDrive 105S
    3. CDC Wren IV 94171-344
    4. SUN0104
    5. SUN0207
    6. SUN0327
    7. SUN0340
    8. SUN0424
    9. SUN0535
    10. SUN0669
    11. SUN1.0G
    12. SUN1.05
    13. SUN1.3G
    14. SUN2.1G
    15. SUN2.9G
    16. Zip 100
    17. Zip 250
    18. Peerless 10GB
    19. HITACHI-DF600F-0000
    20. HITACHI-DF600F-0000
    21. HITACHI-DF600F-CM-0000
    22. HITACHI-DF600F-0000
    23. HITACHI-DF600F-0000
    24. HITACHI-DF600F-0000
    25. SEAGATE-ST336605FSUN36G-0638
    26. SUN36G
    27. other
    Specify disk type (enter its number)[19]: 0
    Auto configuration via format.dat[no]?
    Auto configuration via generic SCSI-2[no]?
    c0t50060E801042ACF3d15: configured with capacity of 975.00MB

    selecting c0t50060E801042ACF3d15
    [disk formatted]
    format>

    So, there is no DEFAULT selection, but format asks for using format.dat

    [root@minex:tmp]# cat /etc/release
    Solaris 10 8/07 s10s_u4wos_12b SPARC
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 16 August 2007
    [root@minex:tmp]# uname -a
    SunOS minex.service.jet.msk.su 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-280R
    [root@minex:tmp]#

    But anyway, thank you for focusing on that functionality :)

  2. I remember I had a similar issue with a boot disk on a v20z that I had accidentally converted from an SMI to an EFI label. When I tried to switch it back to an SMI label it complained that it had lost all of the geometry info. I tried using autoconfigure but this never seemed to reestablish the geometry. Only by choosing DEFAULT did the disk become properly formatted. Your explanation of the fact that DEFAULT issues a SCSI READ CAPACITY command now explains why this worked. I wish this non-intuitive behavior had been written up by Sun in an InfoDoc – it would have saved me hours of frustration.

  3. hello,
    with Solaris 9 i did this procedure while the filesystems where mounted.
    With Solaris 10 (i’m using U4) Sun has introduced more checks and i got errors:

    here is an sample:
    i have grown an 5 GB LUN to an 10 GB LUN while the LUN was mounted.

    format
    Searching for disks…done

    AVAILABLE DISK SELECTIONS:
    0. c0t0d0
    /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0
    1. c0t1d0
    /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0
    2. c3t60A98000486E5535636F464851345967d0
    /scsi_vhci/ssd@g60a98000486e5535636f464851345967
    Specify disk (enter its number): 2
    selecting c3t60A98000486E5535636F464851345967d0
    [disk formatted]
    Warning: Current Disk has mounted partitions.
    /dev/dsk/c3t60A98000486E5535636F464851345967d0s0 is currently mounted on /mnt. Please see umount(1M).

    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
    format> ty

    AVAILABLE DRIVE TYPES:
    0. Auto configure
    1. Quantum ProDrive 80S
    2. Quantum ProDrive 105S
    3. CDC Wren IV 94171-344
    4. SUN0104
    5. SUN0207
    6. SUN0327
    7. SUN0340
    8. SUN0424
    9. SUN0535
    10. SUN0669
    11. SUN1.0G
    12. SUN1.05
    13. SUN1.3G
    14. SUN2.1G
    15. SUN2.9G
    16. Zip 100
    17. Zip 250
    18. Peerless 10GB
    19. SUN72G
    20. NETAPP-LUN-0.2
    21. NETAPP-LUN-0.2
    22. other
    Specify disk type (enter its number)[20]: 0
    c3t60A98000486E5535636F464851345967d0: configured with capacity of 10.00GB

    Cannot set disk type while it has mounted partitions.

    has anyone an idea how i could do this without onmounting?

  4. I used to use LUXADM alot and still do (have to on my remaining Solaris 9 devices) But I have found that to get detailed info on your fiber channel connected LUNS in Solaris 10 use the fcinfo command instead, it allows you to do a search on all hba’s and then do detailed analysis on each fiber channel WWN, detailing what is connected on each one, I have used it many times to prove to Oracle DBA’s that they have access to newly presented LUNS from Hitachi USP devices

  5. Have you been able to get this to work on Solaris x86? Works fine with Solaris 10 SPARC, but I can’t get Solaris 10 x86 to read the proper capacity using the techniques listed. luxadm display does show the proper size after the LUN expansion. I happen to be running 5/08 in this case.

    Any suggestions?

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *