You can also just use the syntax "df -k <file/dir-name>"
It will report the diskspace used on the filesystem which the file or directory you specified exists on. I you look at the output, you can tell the slicenumber from the sX part of the first column (exaple below is for the / filesystem on slice 0 (controller 0, target 0 and slice 0):
bash-2.05$ df -k /etc/hosts
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 10080200 4510975 5468423 46% /
bash-2.05$
Main Topics
Browse All Topics





by: jedblackPosted on 2005-10-23 at 22:37:21ID: 15144324
what is the "root" file system location that the file is in?
---------- ---------- ---------- ---------- ---------- ---------- ------- pfile - - swap - no - ---------- ---------- ---------- ---------- ---------- ---------- --------
i.e. /opt/dir/dir/dir/somefile
your root dir would be /opt
then look in "vfstab" file(cat /etc/vfstab) and determine what slice /opt is under
here is a cut from my prompt
--------------------------
# cat /etc/vfstab |more
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /jumpstart/install ufs 2 yes -
/jumpstart/install/testswa
/paul/swapfile - - swap - no -
swap - /tmp tmpfs - yes -
#
--------------------------
you can see that i have 3 filesystems on 3 different slices "/" and "/usr" and "/jumpstart"
if the file in question was under "/" then its contained in s0, or if its under "/usr" then the slice is s2 (c1d0s2)