========================================

I run a little script that prints the available space for file system:

Code:
#!/usr/bin/perl5 sub CheckDiskSpace { use Filesys::DiskFree; my $handle = new Filesys::DiskFree; $handle->df(); $loc1 = '/dev'; $loc2 = '/var/run'; $loc3 = '/boot'; print "... $loc1, $loc2, $loc3, '/' \n"; foreach my $file ($loc1,$loc2,$loc3,'/' ) { my $bytesavailable=$handle->avail($file); print "at $file, available bits = $bytesavailable \n"; } } CheckDiskSpace();
========================================

The result is:

... /dev,/var/run,/boot,'/'

at /dev, available bits = 1028820992

at /var/run, available bits = 1028730880

at /boot, available bits =

at /, available bits =

========================================

I then type command "df -a" and get:

Code:
Filesystem 1K-blocks Used Available Use% Mounted on proc 0 0 0 - /proc /sys 0 0 0 - /sys varrun 1004736 116 1004620 1% /var/run varlock 1004736 0 1004736 0% /var/lock udev 1004736 28 1004708 1% /dev devshm 1004736 12 1004724 1% /dev/shm devpts 0 0 0 - /dev/pts tmpfs 1004736 12 1004724 1% /dev/shm securityfs 0 0 0 - /sys/kernel/se +curity gvfs-fuse-daemon 620395268 10647256 609748012 2% /root/.gvfs /dev/sda1 497829 139305 332822 30% /media/_boot
========================================

I then run "gparted" and tt shows /dev/sda3 is mounted to '/' and '/dev/.static/dev'. It's a graphic tool and I do not know how to post pictures here.

========================================

The thing I do not understand is: Why cannot perl script tell the available size of "/"? Why doesnot df command show "/" as a mount point while gparted correctly shows that? I tried to mount /dev/sda3 to '/' but it says it already exists. My system is ubuntu server. Can someone help me? Thanks.


In reply to Help on mount of / by comingme

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.