Results 1 to 3 of 3

Thread: Why df -h needs root for particular devices?

  1. #1
    lynette is offline Senior Member
    Join Date
    Mar 2009
    Posts
    116
    Rep Power
    4

    Default Why df -h needs root for particular devices?

    This command:

    $ df
    Filesystem 1K-blocks Used accessible Use% Mounted on
    /dev/sda2 14610964 6682044 7186720 49% /
    (...)

    Works very well, shows space usage for all devices. But this one doesn't work:
    $ df /dev/sda2
    df: `/dev/sda2': Permission denied
    df: no file systems processed
    But, it works when implemented by root:
    $ sudo df /dev/sda2

    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/sda2 14610964 6682044 7186720 49% /

    Why is it so? If I can make out space left on ALL devices, why cannot I make out it on a particular one? It's not logical, df -h without added parameters gives me additional information after all.

  2. #2
    valencia is offline Senior Member
    Join Date
    Mar 2009
    Posts
    104
    Rep Power
    4

    Default

    Look like no logic in it +1.

  3. #3
    jasenta is offline Member
    Join Date
    Mar 2009
    Posts
    97
    Rep Power
    4

    Default

    From "man df":

    If an case is the complete file given name of a disk device node with a build up file system, df illustrates the space open on that file system rather than on the file system with the device node (which is always the root file system).

    And to acquire information on the device node it wants at least read access to it.

Similar Threads

  1. How to create directory in /root/usr/
    By Gavin Broght in forum Linux/Free BSD
    Replies: 1
    Last Post: 12-09-2009, 12:07 PM
  2. Enable root
    By bunnut78 in forum Everything Else
    Replies: 0
    Last Post: 04-08-2009, 05:40 AM
  3. Forgotten My Root Password
    By clodey65 in forum General Internet Terms
    Replies: 1
    Last Post: 12-18-2008, 07:03 AM
  4. Forgot your root password
    By Macavi6987 in forum Applications
    Replies: 0
    Last Post: 11-22-2008, 01:05 PM
  5. Root Mean Square
    By techno23 in forum Speaker
    Replies: 0
    Last Post: 03-24-2008, 12:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48