Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    143

    Unanswered: to check available space

    Hi,
    I am doing an oracle export of a schema from a database. The .dmp file that will be generated is going to be about 10mb in size. I am doing this from a folder called /home/biolink(which is where the .dmp export file will be created)
    My question is before I do this, how can I make sure if /home/biolink has the necessary space so that the export is going to be successful. I needed to know what I can do to check how much is used, how much more space is there. I just didn't want to run out of space. My OS is AIX 5.1.
    thank you

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: to check available space

    Originally posted by saccskiz
    Hi,
    I am doing an oracle export of a schema from a database. The .dmp file that will be generated is going to be about 10mb in size. I am doing this from a folder called /home/biolink(which is where the .dmp export file will be created)
    My question is before I do this, how can I make sure if /home/biolink has the necessary space so that the export is going to be successful. I needed to know what I can do to check how much is used, how much more space is there. I just didn't want to run out of space. My OS is AIX 5.1.
    thank you

    df -k

  3. #3
    Join Date
    Feb 2004
    Posts
    143

    Re: to check available space

    Hi,
    I tried df -k
    I got the following values --
    For column
    Filesystem -- > /dev/dephome_rn
    1024 - blocks --> 2555904
    Free --> 152040
    %Used --> 95%
    Iused --> 13707
    %Iused --> 3%
    Mounted on --> /home/biolink

    Does this mean that the freespace available is 152.040 mb ? Also what does Iused and %Iused mean?

    Thanks

  4. #4
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    320
    In your example the free space is 152040 Kb = 148.47 Mb (1Mb = 1024 Kb)

    Iused and %Iused are number and % of Inodes used.

    You can use this script to verify space :
    Code:
    #
    # Usage: $0 required_space [filesystem]
    # required_space = nnn[unit]  unit=Bytes, Kilo, Mega, Giga
    # filesystem, default ='.'
    
    : ${1:?'You must specify required free space'}
    
    df -k ${2:-.} | tail -1 | \
    awk -v Required=$1 '
    BEGIN {
       Required = toupper(Required);
       if (Required !~ /^[0-9]+(\.[0-9]*)?[BKMG]?$/) {
          print "Invalid value for required free space: " Required;
          exit 1;
       }
       if (Required ~ /[BKMG]$/) {
          len = length(Required);
          unit = substr(Required,len,1);
          Required = substr(Required,1,len-1);
       } else {
          unit = "B";
       }
       if      (unit == "G")
            Required = Required * 1024 * 1024;
       }
       if      (unit == "G")
            Required = Required * 1024 * 1024;
       else if (unit == "M")
            Required = Required * 1024;
       else if (unit == "B")
            Required = (Required + 1023) / 1024;
       Required = int(Required + .999);
    
       print "Required free space : " Required " K";
    }
    {
       Free = $4;
       print "Free space : " Free "K";
       if (Free > Required) {
          print "\nRequired free space available";
          exit;
       } else {
          print "\nNot enought free space available" ;
          exit 1;
       }
    }
    '
    Jean-Pierre.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •