LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't get df to work (https://www.linuxquestions.org/questions/linux-newbie-8/cant-get-df-to-work-697672/)

plebetan 01-16-2009 02:09 AM

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.

chakka.lokesh 01-16-2009 02:20 AM

why it seems to be bad output?

Didier Spaier 01-16-2009 03:19 AM

/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.

nflenz 01-16-2009 08:31 AM

Code:

$ df -h | grep '/$'

plebetan 01-16-2009 04:14 PM

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.

Didier Spaier 01-16-2009 04:55 PM

Would you mind posting whole "df -h" output ?

plebetan 01-16-2009 10:13 PM

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


Didier Spaier 01-17-2009 03:52 AM

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 ;)

plebetan 01-17-2009 05:54 PM

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.

servat78 01-18-2009 06:39 PM

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


All times are GMT -5. The time now is 10:17 PM.