installer_centos4.5_32bit_online - Disk space

Help
2007-11-28
2013-05-01
  • Clint Davis

    Clint Davis - 2007-11-28

    [root@gmaucom01 ~]# ./Dimdim_installer_centos4.5_32bit_online.run
    Creating directory dimdiminstalltemp
    Verifying archive integrity... All good.
    Uncompressing All scripts.....
    Starting the main script
    Checking for perl version
    Calling Pre-install process for dimdim installation

    =================================
    Pre install checks for CentOS 4.5
    =================================

                    Checking OS Version...
    Root access check successful
    Checking the memory for the machine
    Memory check successful. Required total memory is available
    Checking the disk space for /usr
    Disk space check failed. Required space is not available for /usr
    [root@gmaucom01 ~]# df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sdb2            114508488   8660088 100031668   8% /
    /dev/sdb1               101086     11286     84581  12% /boot
    none                   1037464         0   1037464   0% /dev/shm

     
    • nwcon

      nwcon - 2007-12-02

      Same problem here...

      Clean install of CentOS 4.5 as VMware guest; minimal install + Gnome Desktop.  Tried both online and offline DimDim installers and both resulted in this same error: checking disk space for /usr...Disk space check failed.

      Have a workaround until fix is released and am providing a potential patch to fix the problem.

      Workaround:
      ----------
      After installation fails, go into dimdiminstalltemp/scripts and copy dimdiminstall_online.pl to dimdiminstall_online-m.pl.  Then edit [using vi] the dimdim installer run file, Dimdim_installer_centos4.5_32bit_online.run, by changing

      line 9 from
      script="./scripts/dimdiminstall_online.pl"
      to
      script="./scripts/dimdiminstall_online-m.pl"

      Next edit dimdiminstalltemp/scripts/dimdiminstall_online-m.pl by fixing the checkspace() function to read as follows (lines 220-225):

      sub checkspace()
      {
              print LOG "\tInside the disk space check \n";
              my $diskfree=`df /usr | tail -n1 | awk '{print \$4}'`;
              if ($diskfree > 524288)
              {
                      return 'true';
              }
                      else
              {
                      return 'false';
              }
      }

      And the patch for dimdiminstalltemp/scripts/dimdiminstall_online.pl:

      --- dimdiminstall_online.pl     2007-11-28 23:50:55.000000000 -0700
      +++ dimdiminstall_online.pl.updated     2007-12-01 20:58:33.000000000 -0700
      @@ -220,9 +220,8 @@
              sub checkspace()
              {
                      print LOG "\tInside the disk space check \n";
      -               my $diskfree=`df /usr`;
      -               my @disk = split(/ /,$diskfree);
      -               if ($disk[50] > 524288 | $disk[51] > 524288 | $disk[52] > 524288 | $disk[48] > 524288 | $disk[49] > 524288)
      +               my $diskfree=`df /usr | tail -n1 | awk '{print \$4}'`;
      +               if ($diskfree > 524288)
                      {
                              return 'true';
                      }

      Of course, this is only one way to more reliably determine disk space for the partition holding /usr.  I tested it under Ubuntu Dapper and CentOS 4.5...both work fine; also tested when /usr is its own partition and when /usr is part of the / partition.

      Parsing the df output using a space as a separator fails miserably.  In fact, using a space as a separator for splitting most strings fails miserably!  Awk works much better since the df output is tabular.

      Regards,

      Michael Kimmick, RHCE
      Nichewares & Consulting, LLC

       
    • nwcon

      nwcon - 2007-12-02

      Oops, forgot to mention in my last post that after updating Dimdim_installer_centos4.5_32bit_online.run and dimdiminstall_online-m.pl, just rerun the installer and it should pass the disk check, albeit, it will then want to install an aweful lot of packages to update php that essentially changes the system to something _other_ than RHEL4 or CentOS4.  I would prefer a more detailed list of requirements that _I_ could manually install if desired.

      Regards,

      nwcon

       
    • Rajesh Dharmalingam

      Hi Michael,

      Thanks for your suggestion. But when i use "df /usr | tail -n1 | awk '{print $4}'", i get the output as remaining space in %.

      Basically the output which I get are as follows:

      [root@localhost scripts]# df /usr
      Filesystem           1K-blocks      Used Available Use% Mounted on
      /dev/mapper/VolGroup00-LogVol00
                             7579576    752584   6441968  11% /

      [root@localhost scripts]# df /usr | tail -n1
                             7579576    752584   6441968  11% /

      Could you please post the output of df /usr and df /usr | tail -n1?

      Regards,
      -Rajesh

       
    • Rajesh Dharmalingam

      Hi,

      If the file system is big like "/dev/mapper/VolGroup00-LogVol00", tail -n1 will give only 7579576 752584 6441968 11% /  that is the case in my system.

      Regards,
      -Rajesh

       
    • nwcon

      nwcon - 2007-12-04

      Ah, I forgot about LVM.  When using LVM, the output of df seems to be slightly different.  In fact, this might happen even without LVM as the output of df /usr gets wrapped when the Filesystem device name is very long.

      Seems there will need to be an additional 'check' to determine if LVM is being used.

      When I run df /usr on a machine (centos5) using LVM, I get

      Filesystem           1K-blocks      Used Available Use% Mounted on
      /dev/mapper/VolGroup00-LogVol02
                            10157368   3429664   6203416  36% /usr

      When I run df /usr on a machine (centos4.5, ubuntu dapper) not using LVM and having /boot, /, swap, /usr, /var, /tmp, and /home partitions, I get

      Filesystem           1K-blocks      Used Available Use% Mounted on
      /dev/sda2              4617188   2059152   2323488  47% /usr

      As you can see, the line gets wrapped when the device name is long as in the case when LVM is used.

      So, with the following code in checkspace, both LVM and non-LVM partitions can be handled.  Can you think of any other variations of the df output that might need to be considered?  Or maybe a better way (proc interface) to determine available space?

      sub checkspace()
      {
              print LOG "\tInside the disk space check \n";

              my $lvmdisk = `df /usr | grep '/dev/mapper'`;
              if ($lvmdisk) {
                      $diskfree = `df /usr | tail -n1 | awk '{ print \$3 }'`;
              }
              else {
                      $diskfree = `df /usr | tail -n1 | awk '{ print \$4 }'`;
              }

              if ($diskfree > 524288)
              {
                      return 'true';
              }
                      else
              {
                      return 'false';
              }
      }

      Regards,

      Michael Kimmick
      Nichewares & Consulting, LLC

       
    • nwcon

      nwcon - 2007-12-04

      Just checked software RAID partitions, and they seem to be okay.

      Actually, how about just checking df output for 2 or 3 lines like this?  Should work for nearly all cases.

      sub checkspace()
      {
              print LOG "\tInside the disk space check \n";

              my $dfwrap=`df /usr | wc -l`;
              if ($dfwrap == 3) {
                      $diskfree = `df /usr | tail -n1 | awk '{ print \$3 }'`;
              }
              else {
                      $diskfree = `df /usr | tail -n1 | awk '{ print \$4 }'`;
              }

              if ($diskfree > 524288)
              {
                      return 'true';
              }
                      else
              {
                      return 'false';
              }
      }

      Regards,

      nwcon

       
    • nwcon

      nwcon - 2007-12-04

      Even better yet....

      df -P /usr

      then the output is always on two lines and consistently parsable by awk.

      Regards,

      nwcon

       
    • Rajesh Dharmalingam

      Hi Michael,

      Thanks for the inputs. Yes, by using df -P /usr | tail -n1 | awk '{print $3}', we are able to get the remaining disk space. We will make this change and release a new pack for installer.

      Regards,
      -Rajesh

       
    • nwcon

      nwcon - 2007-12-06

      Just for clarification, it should be

      df -P /usr | tail -n1 | awk '{ print \$4 }'

      and the checkspace() function would then be

      sub checkspace()
      {
              print LOG "\tInside the disk space check \n";

              $diskfree = `df -P /usr | tail -n1 | awk '{ print \$4 }'`;

              if ($diskfree > 524288)
              {
                      return 'true';
              }
                      else
              {
                      return 'false';
              }
      }

      Regards,

      Michael Kimmick
      Nichewares & Consulting, LLC

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks