Determining file system size/free amount programatically

I have to write a system activity reporting program that will report how much space is assigned to each file system, and how much is in use.
I CAN'T shell a system command and parse the output. Because of security issues this program must either use defined API's, or potentially parse a kernel data structure. I realize the inherent un-portability of parsing kernel memory.
Any help would be appreciated,
Thanks

Hi,
Use statvfs (or statvfs64) against the filesystems listed in /etc/mnttab.
Regards,
Ralph
SUN DTS

Similar Messages

  • Solaris 10 - File System Size / Layout

    Hello, I�m very new to Solaris OS � UNIX world and have a question around the file system.
    I have SUN System with a single 36GB of Hard Disk, and eventually I want to install Oracle 10g on it as a development server for myself.
    My question is around the file system size and layout
    I have installed Solaris 10 and accepted the default file system, which is as below:
    Filesystem size used avail capacity Mounted on
    /dev/dsk/c1t1d0s0 5.0G 3.4G 1.6G 69% /
    /devices 0K 0K 0K 0% /devices
    ctfs 0K 0K 0K 0% /system/contract
    proc 0K 0K 0K 0% /proc
    mnttab 0K 0K 0K 0% /etc/mnttab
    swap 1.5G 1.1M 1.5G 1% /etc/svc/volatile
    objfs 0K 0K 0K 0% /system/object
    /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 5.0G 3.4G 1.6G 69% /platform/sun4u-us3/lib/libc_psr.so.1
    /platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1 5.0G 3.4G 1.6G 69% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
    fd 0K 0K 0K 0% /dev/fd
    swap 1.5G 136K 1.5G 1% /tmp
    swap 1.5G 88K 1.5G 1% /var/run
    /dev/dsk/c1t1d0s7 28G 28M 28G 1% /export/home
    What I don�t understand is when I eventually install Oracle, where will the directory go for it?
    The /home/export folder is aprrox: 28GB which is now taking up most of the space, and I understand that this is for users, therefore my question is:
    1.Should I have allocated a more space to the root file system for oracle during the OS install?
    2. If so what should I do? (its not a production system and I know it will have to go somewhere on the single drive, I�m happy to rebuild as I�m still learning the OS).
    Any suggestions?
    Rgds
    D

    Thanks, I do have this but needed info on the file system layout... but I have the info now...
    If you select the auto file system layout on Solaris 10 then it gives the remaining space to the home/export . I have since re-installed, customised the file system layout and have space for the database.
    D

  • Setting the file system size for the emulator

    Hi,
    I am trying to set the file system size of the emulator so I can test what happens when the system is full and I try to write to the file system. I am using WTK 2.5.1 and I went into preferences -> storage and set Storage size to 10KB. But when I run the emulator and check the available size of the root directories using:
    try {
             Enumeration roots = FileSystemRegistry.listRoots();
             while (roots.hasMoreElements()) {
                String dir = (String) roots.nextElement();
                FileConnection fc = (FileConnection) Connector.open( "file:///" + dir );
                System.out.println( "Available Size on " + dir + " : "+ fc.availableSize());
                fc.close();
          } catch ( IOException ex ) {
             ex.printStackTrace();
    }I get the remaining size of my pc's hard drive, not what is remaining from the 10KB I set.
    Can you tell me the correct way to do this? I don't want to fill up my pc's hard drive in order to test this!!

    Has anyone got an answer to this?

  • Expand file system size

    Dears
    Can we expand mounted file system+ size on solris 10 ???, knowing that I'm not using SVM
    Thanks

    And you're asking this question in the Solaris 9 forum?
    The answer is yes in both cases, though. 'growfs' will expand a mounted UFS filesystem.
    It doesn't help you create the space necessary to expand it, though. That can be very easy or very difficult depending on how your storage is allocated.
    Darren

  • Regarding increasing root file system size

    Hi folks,
    I need urgent help regarding increasing the rool file system size from 40gb to 72 gb by decreasing swap from 64gb to 32gb with out any loss.
    please find the current partiton config:
    Part Tag Flag Cylinders Size Blocks
    0 root wm 6595 - 10787 40.69GB (4193/0/0) 85335936
    1 swap wm 2 - 6594 64.00GB (6595/0/0) 134221440
    2 backup wm 0 - 14086 136.71GB (14087/0/0) 286698624
    3 unassigned wm 0 0 (0/0/0) 0
    4 unassigned wm 0 0 (0/0/0) 0
    5 unassigned wm 10788 - 14050 32.01GB (3298/0/0) 67120896
    6 unassigned wm 0 0 (0/0/0) 0
    7 unassigned wm 0 0 (0/0/0) 0
    i need to change this like below.
    Part Tag Flag Cylinders Size Blocks
    0 root wm 3299 - 10787 72.69GB (4193/0/0) 152446656
    1 swap wm 2 - 3298 32.00GB (3298/0/0) 67110720
    2 backup wm 0 - 14086 136.71GB (14087/0/0) 286698624
    3 unassigned wm 0 0 (0/0/0) 0
    4 unassigned wm 0 0 (0/0/0) 0
    5 unassigned wm 10788 - 14086 32.01GB (3298/0/0) 67120896
    6 unassigned wm 0 0 (0/0/0) 0
    7 unassigned wm 0 0 (0/0/0) 0
    kin dlyhelp me on this....
    Thanks in advance,
    Prathap

    Sorry, can't be done.
    If it was any other filesystem than root, you could do by using SVM.
    But root filesystems can't be stripes or concats. Only simple mirrors.
    So SVM isnt going to work.
    If the spare space was after the partiton. You might have been able to do it by the "dirty" method of manually expanding the partition and using
    growfs to expand it. You would have had to do it by netbooting or cd booting since growfs can't be used on the current root.
    But in any case, you can't do that either since the space if before the partition not after it.
    So, reinstalling is your only option..
    Well, If you have a spare disk, you might be able to copy the filesystem over to a larger partition on the other disk, growfs it and boot off that instead.
    You'd want to try it on a test systen first...

  • Required "/" (root) file system size on UNIX for Solution Manager.

    Hello SAP Gurus,
       I am setting up SAP Solution Manager 3.2 on HP-UX. It is asking me about 350MB free sapce on "/" file system for Central Instance installation and about 120MB free sapce on "/" file system for Database Instance installation.
       I am installaing everything on to shared disk which mounted under /usr/sap. Why it needs free sapce in "/" file system. Is there any workaround to get rid of this requirement, as I have very less free sapce on "/" file system and I don't want to take the risks involved in increasing this size.
       Are there any SAP recommended sizes for "/" file system?
       I stuck in the middle of setting up SAP landscape on HP-UX (11.23). I searched through the Installation documents but I couldn't find any thing helpful in this regard. It is urgent requirement to set up this so please let me know any solution or workaround ASAP.
       Any help is greatly appriciated.
    Thanks in advance.
    Regards,
    cvr/

    Hi Vaibhav.
    Normally "canonical path not available for (folder name)" means:
    1. Wrong username/password. Please double check you credentials.
    2. The resource cannot be linked from the portal server. Please be sure that you can connect to the next ports in windows server from the Unix Server:
    a. NetBIOS Session Service TCP 139 This port is used to connect file shares for example.
    b. TCP 445 The SMB (Server Message Block) protocol is used among other things for file sharing in Windows NT/2000/XP. In windows NT it ran on top of NetBT (NetBIOS over TCP/IP), which used the famous ports 137, 138 (UDP) and 139 (TCP). In Windows 2000/XP/2003, Microsoft added the possibility to run SMB directly over TCP/IP, without the extra layer of NetBT. For this they use TCP port 445.
    I hope these things help somebody.
    Best Regards,
    Jheison A. Urzola H.

  • Expanding root file system size

    Hi,
    I am using Solaris 10 in VMware.
    I have increased the virtual disk size in Vmware console from 10 GB to 18GB. What commands should i run to affect this changes in my / file system.
    Below is the df -h output.
    bash-3.00# df -h
    Filesystem size used avail capacity Mounted on
    /dev/dsk/c0d1s0 6.4G 3.4G 3.0G 54% /
    /devices 0K 0K 0K 0% /devices
    ctfs 0K 0K 0K 0% /system/contract
    proc 0K 0K 0K 0% /proc
    mnttab 0K 0K 0K 0% /etc/mnttab
    swap 1.1G 960K 1.1G 1% /etc/svc/volatile
    objfs 0K 0K 0K 0% /system/object
    sharefs 0K 0K 0K 0% /etc/dfs/sharetab
    fd 0K 0K 0K 0% /dev/fd
    swap 1.1G 40K 1.1G 1% /tmp
    swap 1.1G 28K 1.1G 1% /var/run
    /dev/dsk/c0d1s7 2.8G 2.9M 2.8G 1% /export/home
    bash-3.00#
    Thanks in Advance
    Raja Challagulla

    Hi Bob,
    Thanks for giving reply.
    Below is the output.
    bash-3.00# prtvtoc /dev/rdsk/c0d1s2
    * /dev/rdsk/c0d1s2 partition map
    * Dimensions:
    * 512 bytes/sector
    * 63 sectors/track
    * 255 tracks/cylinder
    * 16065 sectors/cylinder
    * 1304 cylinders
    * 1302 accessible cylinders
    * Flags:
    * 1: unmountable
    * 10: read-only
    * Unallocated space:
    * First Sector Last
    * Sector Count Sector
    * 0 1124550 1124549
    * First Sector Last
    * Partition Tag Flags Sector Count Sector Mount Directory
    0 2 00 1124550 13687380 14811929 /
    1 3 01 48195 1076355 1124549
    2 5 00 0 20916630 20916629
    7 8 00 14811930 6088635 20900564 /export/home
    8 1 01 0 16065 16064
    9 9 01 16065 32130 48194
    bash-3.00#
    Please let me know if you need any details.
    Thanks
    Raja Challagulla

  • Determining file system case-sensitivity

    Is there any way that isn't a hack to determine whether the specific platform that the JVM is running on uses case-sensitive file names or not?
    Thanks,
    Jason

    > Beware that the use of case-sensitive file names is not platform dependant but rather file system dependent.
    I didn't know that. That's good to know. So, would you just recommend creating a temporary file in the path in question, then checking to see if it exists using the same name with different case, then deleting the temporary file?
    That's what I was trying to not do... I was looking for a more solid way. But since it isn't platform dependent, is it the only way? Or is there still a better method?
    Thanks,
    Jason

  • Increase file system size

    Hello,
    I have solaris9 system where on disk c0t0d0, I have 7 partitions. The first partition shows file system mounted=yes with 10GB space. This file system is near full ( 95% used). I need to increase the size. How can I do that?
    I have another partition that shows 30GB and file system mounted=no. Can I create a file system to use this 30 GB? Does it disturb existing file system?
    Appreciate your help.

    I agree with the guest poster a few posts up. This could be a unique opportunity to think about Bike Trials something that she would really love to do.
    Instead of just looking at what's available, think first about what you really want - what would be Bike Trial Seller fulfilling and enjoyable. Is there anything creative she has always wanted to do?
    If she loves being a nurse, look at other opportunities within this field that would not involve physical work.
    If nursing is just a job, and Bike Store she doesn't enjoy it that much, then look at this as a pointer towards doing something different.
    Start making Bike Shop brainstorming lists about all the jobs she would love to and could do - you will come up with something that she can feel excited about.
    Edited by: cocosan on May 12, 2009 1:39 AM

  • Clean up file system size

    Hi,
    I found   /dev/shm file system utilization is more in DB server as below. Please help me to reduce the space.
    $ df -kh
    Filesystem Size  Used Avail Use% Mounted on
    /dev/mapper/root_vg-rootvol
    38G  3.0G   33G   9% /
    tmpfs 7.8G  7.1G  792M  91% /dev/shm
    Files under  /dev/shm
    I don’t know what these files are.
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:04 ora_SAPLAT02_1245213_2
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:18 ora_SAPLAT02_1245213_3
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:38 ora_SAPLAT02_1245213_4
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:34 ora_SAPLAT02_1245213_5
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:15 ora_SAPLAT02_1245213_6
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:34 ora_SAPLAT02_1245213_7
    Files under /dev/shm with sizes
    oracle@server01 /dev/shm
    $ du -sh * | grep G
    4.0M    ora_COGNOS_917525_0
    4.0M    ora_COGNOS_917525_1
    1.6M    ora_COGNOS_917525_2
    0       ora_COGNOS_950294_0
    0       ora_COGNOS_950294_1
    0       ora_COGNOS_950294_10
    4.0M    ora_COGNOS_950294_100
    4.0M    ora_COGNOS_950294_101
    4.0M    ora_COGNOS_950294_102
    4.0M    ora_COGNOS_950294_103
    4.0M    ora_COGNOS_950294_104
    4.0M    ora_COGNOS_950294_105
    4.0M    ora_COGNOS_950294_106
    4.0M    ora_COGNOS_950294_107
    Regards,
    Bala

    2790985 wrote:
    Hi,
    I found   /dev/shm file system utilization is more in DB server as below. Please help me to reduce the space.
    $ df -kh
    Filesystem Size  Used Avail Use% Mounted on
    /dev/mapper/root_vg-rootvol
    38G  3.0G   33G   9% /
    tmpfs 7.8G  7.1G  792M  91% /dev/shm
    Files under  /dev/shm
    I don’t know what these files are.
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:04 ora_SAPLAT02_1245213_2
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:18 ora_SAPLAT02_1245213_3
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:38 ora_SAPLAT02_1245213_4
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:34 ora_SAPLAT02_1245213_5
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:15 ora_SAPLAT02_1245213_6
    -rw-r-----. 1 oracle oinstall 16777216 Apr 18 23:34 ora_SAPLAT02_1245213_7
    Files under /dev/shm with sizes
    oracle@server01 /dev/shm
    $ du -sh * | grep G
    4.0M    ora_COGNOS_917525_0
    4.0M    ora_COGNOS_917525_1
    1.6M    ora_COGNOS_917525_2
    0       ora_COGNOS_950294_0
    0       ora_COGNOS_950294_1
    0       ora_COGNOS_950294_10
    4.0M    ora_COGNOS_950294_100
    4.0M    ora_COGNOS_950294_101
    4.0M    ora_COGNOS_950294_102
    4.0M    ora_COGNOS_950294_103
    4.0M    ora_COGNOS_950294_104
    4.0M    ora_COGNOS_950294_105
    4.0M    ora_COGNOS_950294_106
    4.0M    ora_COGNOS_950294_107
    Regards,
    Bala
    why do you think the current value is a problem?
    what will be gained by making percentage smaller?
    reduce value of PROCESSES parameter
    post results of command below
    ls -l /dev/shm
    explain what you learned from what you saw
    What do you see when Oracle DB has been shutdown?

  • Setting file system size on install

    Well im about to reinstall Solaris 10 (hate that i just complted the 100+ patches just yesterday) because apparently the file system slice / is too small by default (why?)
    and im not sure where to make the currection because I actually thought I had done this. During the installation, I selected the drive and clicked Custom install... then on first slice selected Solaris and gave the full hard disk space to that slice... or like I said, so I thought.
    null

    There are two different levels of "partitioning" on x86 (if that's what you're using).
    The installer needs a primary partition to place all of the Solaris stuff.
    Then in that partition, it assembles slices for the other Solaris filesystems. There is a point in the installer where you can press F4 to customize the sizing of the solaris slices.
    For home usage, I'll almost always build a machine with only root and swap (no /export/home, /var, or anything else). That way, no problems with space allocation.
    Darren

  • How do increase the file system size

    Hi friends,
    My newly installed solaris 10 system shows Filesysem full error.
    By mistake space allocated for Root is very less and 98% of the space in Root is consumed.
    Do i need to restructure entire filesystem or increase space in Root would be sufficient..?
    Its 160 GB Harddisk on Intel Core 2 duo. What is the best allocation for the same.
    I am very new to Solaris. Trying to learn how does Opensource OS works...
    Pls help me
    Regards
    Bijoy

    If you have more drive space you can mount more space and allocate it to a mount point--this may take care of your problem, but if you are out of space and you are not buying any more drives.... then it's time for the install disks to come back out and configure more appropriately to your use.
    I have my work machine at home on a x64 AMD with 120 GB of drive. I gave 40 GB to Solaris just to be sure I could do basic installations and grow a little.
    Once your allocation is full you have 2 options... buy more and mount it, or reinstall... you choose.
    Well, there is a 3rd... you could unmount one of the other allocations and split it, then mount some of it back to your OS and some back to what it was before, but you are going to be plagued with this your entire lifetime of that install.

  • How to determine the file system on Solaris

    Friends,
    How to determine which file system I have installed UFS or ZFS on Solaris
    Thanks

    Other methods would include looking at the /etc/vfstab if it's in there or fstyp(1M):
    System Administration Commands fstyp(1M)
    NAME
    fstyp - determine file system type
    SYNOPSIS
    fstyp [-a | -v] special [:logical-drive]

  • File system getting full and Server node getting down.

    Hi Team,
    Currently we are using IBM Power 6 AIX operating system.
    And in our environment, for development system, file system is getting full and development system is getting slow while accessing.
    Can you please let me know , what exactly the problem & which command is used to see the file system size and how to resolve the issue by deleting the core files or some ting. Please help me .
    Thanks
    Manoj K

    Hi      Orkun Gedik,
    When i executed the command df -lg and find . -name core noting is displayed, but if i execute the command df is showed me the below information. below is an original file which i have modified the sid.
    Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
    /dev/fslv10     52428800  16279744   69%   389631    15% /usr/sap/SID
    Server 0 node is giving the problem. its getting down all the times.
    And if i check it in the /usr/sap/SID/<Instance>/work for the server node "std_server0.out file , the below information is written in the file.
    framework started for 73278 ms.
    SAP J2EE Engine Version 7.00   PatchLevel 81863.450 is running! PatchLevel 81863.450 March 10, 2010 11:48 GMT
    94.539: [GC 94.539: [ParNew: 239760K->74856K(261888K), 0.2705150 secs] 239760K->74856K(2009856K), 0.2708720 secs] [Times: user=0.00 sys=0.36, real=0.27 secs]
    105.163: [GC 105.164: [ParNew: 249448K->80797K(261888K), 0.2317650 secs] 249448K->80797K(2009856K), 0.2320960 secs] [Times: user=0.00 sys=0.44, real=0.23 secs]
    113.248: [GC 113.248: [ParNew: 255389K->87296K(261888K), 0.3284190 secs] 255389K->91531K(2009856K), 0.3287400 secs] [Times: user=0.00 sys=0.58, real=0.33 secs]
    Please advise.
    thanks in advance
    Manoj K

  • File system for SAP Ecc 6.0 with db2 on AIX

    Hello Everyone
    Pleaese suggest the file system size which is to created before installation of sap ecc6.0 sr3 on Aix with DB2.
    Thanks

    find this
    PRD
    df -M
    Filesystem    Mounted on         512-blocks      Free %Used    Iused %Iused
    /dev/hd4      /                     4194304   2008384   53%     2438     2%
    /dev/hd2      /usr                 33554432  24364192   28%    48662     2%
    /dev/hd9var   /var                  8388608   7880328    7%      580     1%
    /dev/hd3      /tmp                  8388608   8342704    1%      123     1%
    /dev/fwdump   /var/adm/ras/platform     262144    261448    1%        4     1%
    /dev/hd1      /home                 2097152   1928856    9%      131     1%
    /proc         /proc                       -         -    -         -     -
    /dev/hd10opt  /opt                  4194304   2851592   33%     6285     2%
    /dev/fslv12   /instcd1             41943040   9293200   78%    15850     2%
    /dev/fslv00   /sapmnt/P11          10485760   8752544   17%     5955     1%
    /dev/fslv01   /usr/sap/P11         10485760   8244400   22%     1319     1%
    /dev/fslv02   /db2/db2p11           4194304   3100248   27%     3941     2%
    /dev/fslv03   /db2/P11/log_dir     20971520  18346264   13%       26     1%
    /dev/fslv04   /db2/P11/log_dir2    20971520  18346424   13%       26     1%
    /dev/fslv05   /db2/P11/db2dump      4194304   3422024   19%       23     1%
    /dev/fslv06   /db2/P11/sapdata1   272629760 220914312   19%      106     1%
    /dev/fslv07   /db2/P11/sapdata2   272629760 220914000   19%      106     1%
    /dev/fslv08   /db2/P11/sapdata3   272629760 220914304   19%      106     1%
    /dev/fslv09   /db2/P11/sapdata4   272629760 220914280   19%      106     1%
    /dev/fslv10   /db2/P11/saptemp1    10485760  10483352    1%       47     1%
    /dev/fslv11   /db2/P11/mirrlog     20971520  20967456    1%        7     1%
    /dev/fslv13   /db2/P11/archlog     94371840  46774984   51%      380     1%
    /dev/fslv14   /sap/auditlog        12582912  12311392    3%       51     1%
    *****rpd11:/usr/sap/trans /usr/sap/trans       33554432  11883968   65%     5738

Maybe you are looking for

  • Is there an app or way for multiple users to access contact info?

    We are a small business that maintains a contact list of leads and clients in a MS word file. We can access those word files via our iphones, but only view them. Is there an app or way to have one person in the office maintain a database of leads and

  • (Internationalization) - Unicode and Other ... Encoding Schemes

    Hello, I am developing a application that requires multiple languages (Chinese/Japanese/English, French/German) support. I plan to use utf-8 encoding, and not individual encoding for each language like SHIFT_JIS for Japanese, BIG5 for Chinese etc. Th

  • Questions about VoIP, Can anybody help me?

    Hi All, I am learning VoIP now and I have serveral questions: 1. when I use "destination-pattern" command in "dial-peer" command, how will the number forwarded? For example: If I want to forward the number 123456 to ip x.x.x.x. If I use "destination-

  • Semi-sleeping

    I apologize in advance if this is the wrong forum or a repeated question. I've had my MacBook for two years now, and, with increasing frequency, it does not fully go to sleep when I close the lid. Sometimes--rarely, these days--I close the lid, the d

  • CUP 5.3 Canceled Request still sending Email

    Hi GRC Experts I have a canceled request in CUP that is still sending email to users. Is there a way that I can stop the request from sending more emails? Will Archiving resolve this? A swift reply will be appreciated. Thanks. D