Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Explaining odd entries in 'df' output UNIX
The other day I was using df -h to check disk space usage, and was surprised to see some odd entries in the output:
$ cd /Volumes
$ df -h
...
/dev/disk2s3    75Gi   51Gi   24Gi    69%    /Volumes/datafiles
map -hosts       0Bi    0Bi    0Bi   100%    /net
map auto_home    0Bi    0Bi    0Bi   100%    /home
...
I had no idea what the map entries were there for; they don't show if you simply do ls /Volumes. After inquiring around, a friend managed to find the answer for me: they're related to the autofs feature in 10.5 and 10.6. You can read all about it, if you care, in this Apple PDF. I was more curious than alarmed, as I hadn't remembered seeing those entries before (I don't use df -h folder all that often).
    •    
  • Currently 2.78 / 5
  You rated: 1 / 5 (18 votes cast)
 
[10,545 views]  

Explaining odd entries in 'df' output | 12 comments | Create New Account
Click here to return to the 'Explaining odd entries in 'df' output' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Explaining odd entries in 'df' output in Volumes folder
Authored by: kiezpro on Jan 29, '10 07:44:57AM

/bin/df is independent from the working directory, as it shows the usage of all mounted entities, including non-disk mount points like /dev, etc.
/usr/bin/du on the other hand shows the amount of space used by the files and subdirectories in the current directory, if called without a file or directory argument.



[ Reply to This | # ]
Explaining odd entries in 'df' output in Volumes folder
Authored by: robg on Jan 29, '10 08:11:31AM

Doh! My bad; way too little sleep last night, I guess. Hint text has now been corrected.

thanks;
-rob.



[ Reply to This | # ]
Explaining odd entries in 'df' output in Volumes folder
Authored by: jralls on Jan 29, '10 09:26:25AM
More corrections: Since df is reporting all mounts and isn't rooted in pwd (Note that the first entry is for /Volumes/datafiles), looking for /net and /home in /Volumes is of course unsuccessful. Try instead ls / and you'll find both mount points.

[ Reply to This | # ]
Explaining odd entries in 'df' output in Volumes folder
Authored by: everkleer80 on Jan 29, '10 09:18:12AM
Wow, I never knew about du. As far as I'm conserned, that command is a hint in itself! I've looked for something exactly like du -s before.

[ Reply to This | # ]
Explaining odd entries in 'df' output in Volumes folder
Authored by: Hal Itosis on Jan 29, '10 09:20:59AM
@kiezpro:
/bin/df is independent from the working directory, as it shows the usage of all mounted entities, including non-disk mount points like /dev, etc. /usr/bin/du on the other hand shows the amount of space used by the files and subdirectories in the current directory, if called without a file or directory argument.
While it's true that df without any folder arg lists all mounted filesystems, we can feed it an argument to have its output report on just the filesystem associated with that folder...

localhost:~ halito$ df -h .
Filesystem      Size   Used  Avail Capacity  Mounted on
/dev/disk0s10   16Gi   12Gi  3.4Gi    79%    /

localhost:~ halito$ cd /Volumes/Utility
localhost:Utility halito$ df -h .
Filesystem                                Size   Used  Avail Capacity  Mounted on
afp_004Ifb1LRRx6001Eic06SdO0-2.2d000005   15Gi  9.6Gi  5.4Gi    65%    /Volumes/Utility

localhost:Utility halito$ df -h /Volumes/*Music*
Filesystem                                Size   Used  Avail Capacity  Mounted on
/dev/disk0s12                             40Gi   39Gi  776Mi    99%    /Volumes/al_Music
afp_004Ifb1LRRx6001Eic06SdO0-3.2d000006   64Gi   41Gi   22Gi    65%    /Volumes/MusicStorage
-HI-

[ Reply to This | # ]
Explaining odd entries in 'df' output
Authored by: astack on Jan 29, '10 08:47:04AM

Thanks for the hint. I had indeed wondered what these were. I've also noticed that some weird links to place like /home show up using some things like fink. I guess those are to better emulate a linux file system.

I wish that the finder "connect to server" plugin supported sshfs fuse system though. I love being able to only need to configure one port open and only having to setup one protocol for both my remote logon and file moving needs.



[ Reply to This | # ]
Explaining odd entries in 'df' output
Authored by: Anonymous on Feb 02, '10 03:58:44PM

Not "Linux filesystem". Just standard practice.



[ Reply to This | # ]
/home and /net
Authored by: Hal Itosis on Jan 29, '10 09:32:19AM
FWIW, a few articles (from 2007, after Leopard was released) about those /home and /net items exist online, but googling for "/home" and "/net" is a rather hopeless task. Here is a link to part one: Autofs goodness in Apple’s Leopard

[ Reply to This | # ]
Explaining odd entries in 'df' output
Authored by: kentmartin on Jan 29, '10 09:42:57AM
My entire household lives by this functionality. ie, my laptop:

kent@epona ~ $ df -h

Filesystem                 Size   Used  Avail Capacity  Mounted on
/dev/disk0s2              143Gi  134Gi  8.7Gi    94%    /
devfs                     110Ki  110Ki    0Bi   100%    /dev
map -hosts                  0Bi    0Bi    0Bi   100%    /net
map auto_home               0Bi    0Bi    0Bi   100%    /home
trigger                     0Bi    0Bi    0Bi   100%    /net/venus/Volumes
trigger                     0Bi    0Bi    0Bi   100%    /net/venus/Volumes/Luxmi
trigger                     0Bi    0Bi    0Bi   100%    /net/venus/Volumes/Hermes
trigger                     0Bi    0Bi    0Bi   100%    /net/venus/Volumes/Dionisus
trigger                     0Bi    0Bi    0Bi   100%    /net/venus/Volumes/Mnemosyne
trigger                     0Bi    0Bi    0Bi   100%    /net/venus/Volumes/Ganimides
venus:/Volumes/Ganimides  698Gi  530Gi  168Gi    76%    /net/venus/Volumes/Ganimides
venus:/Volumes/Mnemosyne  1.4Ti  1.3Ti   62Gi    96%    /net/venus/Volumes/Mnemosyne
venus:/Volumes/Dionisus   1.4Ti  1.4Ti  9.0Gi   100%    /net/venus/Volumes/Dionisus
venus:/Volumes/Luxmi      1.4Ti  1.4Ti   14Gi   100%    /net/venus/Volumes/Luxmi
venus:/Volumes/Hermes     1.8Ti   43Gi  1.8Ti     3%    /net/venus/Volumes/Hermes
Venus is our server containing media. Each other machine then has a set of symlinks containing something like:

kent@epona ~ $ ls -l /Movies
lrwxr-xr-x  1 kent  admin  35 28 Dec 12:25 /Movies -> /net/venus/Volumes/Mnemosyne/Movies
The NFS server on venus is then set up as follows:

venus:~ kent$ cat /etc/exports 
/Volumes/Dionisus -ro
/Volumes/Ganimides -ro
/Volumes/Luxmi -ro
/Volumes/Mnemosyne -ro
/Volumes/Hermes -ro
That way, any machine that has a 5 second setup done on it has instant on demand access to all the media on the server. If they're not on our network, the symlinks will just fail to resolve. Venus happens to be an OSX machine, but, it could just as easily be a Linux box or Solaris - or just about any other *nix for that matter. The clients wouldn't notice the difference. Similarly, linux clients are set up exactly the same way (install autofs on ubuntu for example). NFS, simple, old and works just fine :)

[ Reply to This | # ]
The real purpose of /net and /home
Authored by: leamanc on Jan 29, '10 11:57:25AM

As has been noted above several times, these two filesystems--/net and /home--are related to the new auto-mount daemon introduced in 10.5. I haven't seen anyone mention what their primary purpose is, and that is to provide mountpoints for clients managed by OS X Server. If your home folder lives on the server (and syncs to your local machine), it will be placed under /home, which is traditionally where Unix-like systems store home folders (instead of OS X's usual /Users). And your auto-mounted sharepoints will live under /net, instead of the usual place in OS X--/Volumes.

If you start up your non-managed Mac OS X 10.5 or 10.6 machines in verbose mode (cmd-V at startup), you will notice on shutdown the following two entries on the console screen:


Unmounting of /home failed
Unmounting of /net failed
This is nothing to be alarmed about; the unmounting failed because you never mounted anything there in the first place, because you are not a managed client. Some folks I've seen on the 'Net have wrongfully assumed these entries were due to a bug in Apple's code.



[ Reply to This | # ]
Explaining odd entries in 'df' output
Authored by: Zeitkind on Jan 30, '10 04:27:34PM

Well, I always use "df -ahl" or "df -agl". This shows only local file systems and kind of "hidden" mounts (MNT_IGNORE flag). In business enviroments a "df -h" might show dozens of servers and autofs-mounts.



[ Reply to This | # ]
Explaining odd entries in 'df' output
Authored by: wjv on Feb 02, '10 05:04:11AM
Wow, thanks for the link to that PDF. I've always just assumed that Apple had left their version of AutoFS essentially undocumented, and I've been using it based on scraps of information found on the net, and the documentation of similar subsystems on other Unices.

I have, BTW, had an AutoFS-related hint published here myself before.

[ Reply to This | # ]