tags:

views:

454

answers:

4

IF i do a df command. I can only see in the solaris server how much diskspace is being used up. But i want to know how much diskspace a particular solaris zone is occupying

+2  A: 

try the du command

John T
du of what path ? I have posted an answer where I show what path ot consider.
VonC
you're doing it right
John T
Ok. It is a bit scary though that I have to execute my du as root (sudo root, but root nonetheless)
VonC
A: 

According to Solaris Operating System Managing ZFS in Solaris 10 Containers the following command would give you the information you require.

zfs list
Pierre-Luc Simard
That gives me "no datasets available",, which is not exactly helpful.
VonC
Turns out I misread the question. My solution will absolutly not help you.
Pierre-Luc Simard
+1  A: 

Since I tried both John's solution and Pierre-Luc solution, what works for me is:

  • list all the zone (from the global zone)

:

tcsh>zoneadm list -civ
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   1 myZone1          running    /export/zones/myZone1          native   shared
   2 myZone2          running    /export/zones/myZone2          native   shared
  • du -sk as root
    (since local zones are not readable from global zone, I had to du -sk them as root)

:

 tcsh>s du -sk /export/zones/myZone1  
 9930978 /export/zones/myZone1
VonC
A: 

If you install the zone on a zfs volume then you can use the zfs tools ("zfs list") to quickly see how much space has been used.

Otherwise you'll have to use "du" as you already discovered (which will be much slower).

Chris Miles