LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-16-2009, 03:09 AM   #1
plebetan
Member
 
Registered: Jan 2009
Posts: 31

Rep: Reputation: 15
can't get df to work


hi. i'm trying to find out my disk usage for my root drive, which is /dev/hda6. when i run
Code:
df -h /dev/hda6
i get:
Code:
Filesystem            Size  Used Avail Use% Mounted on
-                     245M   44K  245M   1% /dev
which seems to be bad output.
 
Old 01-16-2009, 03:20 AM   #2
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 32
why it seems to be bad output?
 
Old 01-16-2009, 04:19 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2beta2 on Lenovo Thinkpad W520
Posts: 6,778

Rep: Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115
/dev/hda6 is *not* your root file system. It is your swap partition, this why it shows a hyphen under "Filesystem" and "/dev" under "Mounted on".

You can check that looking at /etc/fstab.

So type "df -h" instead.

Last edited by Didier Spaier; 01-16-2009 at 04:23 AM. Reason: Precision added
 
Old 01-16-2009, 09:31 AM   #4
nflenz
Member
 
Registered: Feb 2006
Distribution: CRUX 2.4
Posts: 96

Rep: Reputation: 18
Code:
$ df -h | grep '/$'
 
Old 01-16-2009, 05:14 PM   #5
plebetan
Member
 
Registered: Jan 2009
Posts: 31

Original Poster
Rep: Reputation: 15
here is my fstab:
Code:
/dev/hda5        swap             swap        defaults         0   0
/dev/hda6        /                ext3        defaults         1   1
/dev/hda1        /mnt/windows     ntfs-3g     umask=077        1   0
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
doing "df -h" shows a root partition mounted as /dev/root. it seems that there is a symlink(/dev/root) out in /dev that points to hda6.

i still don't see why "df /dev/hda6" isn't working.
 
Old 01-16-2009, 05:55 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2beta2 on Lenovo Thinkpad W520
Posts: 6,778

Rep: Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115
Would you mind posting whole "df -h" output ?
 
Old 01-16-2009, 11:13 PM   #7
plebetan
Member
 
Registered: Jan 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/root              17G  3.5G   13G  22% /
/dev/hda1              38G  6.0G   32G  17% /mnt/windows
tmpfs                 245M     0  245M   0% /dev/shm
 
Old 01-17-2009, 04:52 AM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2beta2 on Lenovo Thinkpad W520
Posts: 6,778

Rep: Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115Reputation: 2115
This is what I have:
Code:
bash-3.1$ cat /etc/fstab
/dev/hda3        swap             swap        defaults         0   0
/dev/hda1        /                reiserfs    defaults         1   1
/dev/hda2        /home            reiserfs    defaults         1   2
#/dev/hda4        /12.1            reiserfs    defaults         1   2
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
bash-3.1$ df -h
Sys. de fich.         Tail. Occ. Disp. %Occ. Monté sur
/dev/hda1              16G  5,1G   11G  33% /
/dev/hda2              49G   31G   19G  63% /home
tmpfs                 506M     0  506M   0% /dev/shm
/dev/hda4             8,3G  5,6G  2,8G  67% /12.1
bash-3.1$ ls -l /dev/root 
lrwxrwxrwx 1 root root 4 2009-01-17 10:56 /dev/root -> hda1
bash-3.1$
So I don't really see where your problem come from. May be you could tell us what is your distribution and version and how /dev is populated (do you use udev) ?

Anyway if /dev/root points to hda6 you know you have 33G available on it

Last edited by Didier Spaier; 01-17-2009 at 05:01 AM.
 
Old 01-17-2009, 06:54 PM   #9
plebetan
Member
 
Registered: Jan 2009
Posts: 31

Original Poster
Rep: Reputation: 15
i'm using slackware, and /dev/root does point to /dev/hda6. i just think its weird that i can only get my disk usage info by doing "df /dev/root", when i want to call it /dev/hda6. i think the problem is that it's mounted as /dev/root, so df must look at whats mounted and not understand that /dev/root and /dev/hda6 are the same thing.
 
Old 01-18-2009, 07:39 PM   #10
servat78
Member
 
Registered: Jan 2009
Posts: 100

Rep: Reputation: 17
If you want to find out the disk usage for your root drive, why not using
$ df -h /

Your root device is located on /dev/hda6, but even so it is mounted as /
I really see no point of running df with some device, as it can deal only with mounted devices and even that only via the mountpoints.

/dev/root is special case on a UNIX system and obviously related to the root mountpoint, and certainly not meant to used by df.

Debian

Last edited by servat78; 02-19-2009 at 12:07 PM.
 
  


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
can't make ethernet on laptop work, wireless and usb work fine ubuntu 8.10 rz1988 Linux - Newbie 10 01-13-2009 03:21 PM
Getting a touch screen to work, must get PCI serial device to work first sternocera Linux - Hardware 2 10-03-2008 07:23 AM
I have AD authentication work, how do i make SSH PAM work in RHEL4? epmd Red Hat 0 09-19-2007 07:04 PM
NFS doesn't work work well with mounted NTFS volumes? StevenO Linux - Networking 6 02-13-2006 11:54 AM
FALCONS EYE (nethack) FAILS ON STARTUP, use to work, wont work even after reinstall roorings Linux - Software 0 10-08-2003 11:39 PM


All times are GMT -5. The time now is 10:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration