LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 04: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:	17
Size:	36.2 KB
ID:	2488  

Last edited by comingme; 01-14-2010 at 04:07 AM.
 
Old 01-14-2010, 04:50 PM   #2
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

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


Reply



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 10:03 AM
fs errors root mount RO, how to mount RW without rebooting? DaveQB Linux - General 6 05-11-2008 03: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 03:09 AM
patched mount source. works but i must be root to mount !!!??? qwijibow Linux - Software 2 01-29-2004 06:59 AM
vfat mount - all files are 'root' owned, but even root can't -WX d33pdream Linux - General 5 02-28-2003 02:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:27 AM.

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
Open Source Consulting | Domain Registration