LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-14-2010, 05:03 AM   #1
comingme
LQ Newbie
 
Registered: Jan 2010
Posts: 2

Rep: Reputation: 0
help : mount of root /


========================================
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/security
gvfs-fuse-daemon     620395268  10647256 609748012   2% /root/.gvfs
/dev/sda1               497829    139305    332822  30% /media/_boot
========================================

I then run "gparted" and get the picture as attached. It shows /dev/sda3 is mounted to '/'.

========================================
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.
Attached Thumbnails
Click image for larger version

Name:	Screenshot--dev-sda - GParted.png
Views:	11
Size:	36.2 KB
ID:	2488  

Last edited by comingme; 01-14-2010 at 05:07 AM.
 
Old 01-14-2010, 05:50 PM   #2
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Rep: Reputation: 46
I'm just taking a guess, but do you have to escape the / ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to give not-root user ability to mount devices to any mount point??? jdupre Linux - General 8 02-04-2012 11:03 AM
fs errors root mount RO, how to mount RW without rebooting? DaveQB Linux - General 6 05-11-2008 04:36 PM
help please: mount -t smbfs -a fails as normal user, as root, doesn't mount anything thevic Linux - Networking 11 04-09-2007 04:09 AM
patched mount source. works but i must be root to mount !!!??? qwijibow Linux - Software 2 01-29-2004 07:59 AM
vfat mount - all files are 'root' owned, but even root can't -WX d33pdream Linux - General 5 02-28-2003 03:38 AM


All times are GMT -5. The time now is 08:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration