command for List of logical volumes

On my solaris box, default Sun volume manager is running.

I want to check the list of logical volumes and following details for each logical volume:

freeSpace
usedSpace
type
isClustered
auxId
permissions
currentLogicalExtent
segmentCount
allocationType
isOpen

To know state of volume I found command metastat, but when I run the same, it shows:

bash-2.05# metastat
metastat: losak065: there are no existing databases

lvdisplay command is not working for sun solaris.

Is anyone can help what CLI I should use to get this information ??

Your output shows that the system is not using SVM-Solaris Volume Manager
Can you provide df -h, echo |format ,iostat -En |grep Hard & raidctl outputs?

bash-2.05# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t0d0s0      1.9G   1.8G    37M    99%    /
/proc                    0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
fd                       0K     0K     0K     0%    /dev/fd
swap                   1.2G    40K   1.2G     1%    /var/run
swap                   1.2G   5.0M   1.2G     1%    /tmp
/dev/dsk/c0t0d0s7       14G    11K    14G     1%    /export/home

---------- Post updated at 12:45 PM ---------- Previous update was at 12:42 PM ----------

bash-2.05# echo |format
Searching for disks...done

c2t0d0: configured with capacity of 2.29GB
c2t0d1: configured with capacity of 2.29GB
c2t0d2: configured with capacity of 2.29GB
c2t0d3: configured with capacity of 6.84GB
c2t0d4: configured with capacity of 6.88GB
c2t1d0: configured with capacity of 6.88GB
c2t1d1: configured with capacity of 6.88GB
c2t1d2: configured with capacity of 33.95GB
c2t1d3: configured with capacity of 6.88GB
c2t1d4: configured with capacity of 6.88GB
ppower0e: configured with capacity of 2.29GB
ppower1a: configured with capacity of 2.29GB
ppower2g: configured with capacity of 6.88GB
ppower3h: configured with capacity of 6.88GB
ppower4e: configured with capacity of 6.88GB
ppower5a: configured with capacity of 2.29GB
ppower6h: configured with capacity of 6.84GB
ppower44a: configured with capacity of 33.95GB
ppower45h: configured with capacity of 6.88GB
ppower46g: configured with capacity of 6.88GB


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <FUJITSU-MAN3184MC-3703 cyl 12435 alt 2 hd 5 sec 574>
          /pci@17,4000/scsi@3/sd@0,0
       1. c2t0d0 <HITACHI-OPEN-3-SUN-2113 cyl 3336 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@0,0
       2. c2t0d1 <HITACHI-OPEN-3-SUN-2113 cyl 3336 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@0,1
       3. c2t0d2 <HITACHI-OPEN-3-SUN-2113 cyl 3336 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@0,2
       4. c2t0d3 <HITACHI-OPEN-8-SUN-2113 cyl 9964 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@0,3
       5. c2t0d4 <HITACHI-OPEN-9-SUN-2113 cyl 10014 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@0,4
       6. c2t1d0 <HP-OPEN-9-SUN-2114 cyl 10014 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@1,0
       7. c2t1d1 <HP-OPEN-9-SUN-2114 cyl 10014 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@1,1
       8. c2t1d2 <HP-OPEN-L-SUN-2114 cyl 49437 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@1,2
       9. c2t1d3 <HP-OPEN-9-SUN-2114 cyl 10014 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@1,3
      10. c2t1d4 <HP-OPEN-9-SUN-2114 cyl 10014 alt 2 hd 15 sec 96>
          /pci@17,4000/fibre-channel@2/sd@1,4
      11. ppower0e <HITACHI-OPEN-3-SUN-2113 cyl 3336 alt 2 hd 15 sec 96>
          /pseudo/pp@0
      12. ppower1a <HITACHI-OPEN-3-SUN-2113 cyl 3336 alt 2 hd 15 sec 96>
          /pseudo/pp@1
      13. ppower2g <HP-OPEN-9-SUN-2114 cyl 10014 alt 2 hd 15 sec 96>
          /pseudo/pp@2
      14. ppower3h <HP-OPEN-9-SUN-2114 cyl 10014 alt 2 hd 15 sec 96>
          /pseudo/pp@3
      15. ppower4e <HITACHI-OPEN-9-SUN-2113 cyl 10014 alt 2 hd 15 sec 96>
          /pseudo/pp@4
      16. ppower5a <HITACHI-OPEN-3-SUN-2113 cyl 3336 alt 2 hd 15 sec 96>
          /pseudo/pp@5
      17. ppower6h <HITACHI-OPEN-8-SUN-2113 cyl 9964 alt 2 hd 15 sec 96>
          /pseudo/pp@6
      18. ppower44a <HP-OPEN-L-SUN-2114 cyl 49437 alt 2 hd 15 sec 96>
          /pseudo/pp@44
      19. ppower45h <HP-OPEN-9-SUN-2114 cyl 10014 alt 2 hd 15 sec 96>
          /pseudo/pp@45
      20. ppower46g <HP-OPEN-9-SUN-2114 cyl 10014 alt 2 hd 15 sec 96>
          /pseudo/pp@46
bash-2.05# iostat -En |grep Hard
c0t0d0          Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
c0t4d0          Soft Errors: 2 Hard Errors: 0 Transport Errors: 0
c2t0d0          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t1d0          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t0d1          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t0d2          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t0d3          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t0d4          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t1d1          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t1d2          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t1d3          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
c2t1d4          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
bash-2.05# vold
Wed Jan 20 01:41:33 2010 fatal: vol_init: already a daemon running

what volume manager is running here ?

From your above output, I can see that there's none.

In case, there is SVM-Solaris Volume Manager running, then how to check the list of logical volumes and other details for each logical volume

if there are no metadbs, there is no volumemanager running. but if you need to check slvm volumes (on a system with slvm), all you need is "metastat". check out the manpage.

I am able to run metastat commands once i created db replica and volumes.

Now metadb is giving output.

but when I run metastat i get only few information as follows:

  -bash-3.00\# metastat   




  d1: Mirror   





      Submirror 0: d20   




        State: Okay   




      Pass: 1   




      Read option: roundrobin \(default\)   


      Write option: parallel \(default\)   



      Size: 229376 blocks \(112 MB\)   


  






  d20:   Submirror of d1   




      State: Okay   




      Size: 229376 blocks \(112 MB\)   


      Stripe 0:   




          Device     Start Block  Dbase          State Reloc Hot Spare   
          c1t0d0s0      32768     Yes           Okay   Yes   

How to get information like permissions,freeSpace, usedSpace, segmentCount, allocationType, readAheadSectors,blockDevice, isOpen etc.

Where is your 2nd sub-mirror?

I used these two commands for creating volumes, if there is any mistake ??

You should have to disk minimum if you need to mirror them. What's the point of doing this since you do not have a secondary disk? Are you working this on a Live machine?

my question here is which command I should use to get information like permissions,freeSpace, usedSpace, segmentCount, allocationType, readAheadSectors,blockDevice, isOpen etc. for volumes...i m not able to get using metastat.

I am not using real machine, its not relevant for me if its virtual or physical.

you can't get this informations with one command... why do you need this information? what are you going to do? what are you trying to achieve?

application need to show all this information to client.

---------- Post updated at 02:14 PM ---------- Previous update was at 02:13 PM ----------

using prtvtoc and metastat I am getting few information, again, if I go for /dev/md/dsk, and ls -l I come to know permissions.