From: Peter Hickman Date: 2012-09-02T17:31:19+09:00 Subject: Re: Ruby module to get df -h output Depends on your need Here is the out put from 'df -h' on my system' Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 465Gi 385Gi 80Gi 83% / devfs 191Ki 191Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk2s2 1.4Ti 489Gi 908Gi 36% /Volumes/Backup /dev/disk1s6 466Gi 317Gi 148Gi 69% /Volumes/Spare Now insert a new drive and do it again Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 465Gi 385Gi 80Gi 83% / devfs 195Ki 195Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk2s2 1.4Ti 489Gi 908Gi 36% /Volumes/Backup /dev/disk1s6 466Gi 317Gi 148Gi 69% /Volumes/Spare /dev/disk3s1 56Mi 37Mi 19Mi 66% /Volumes/Untitled Note the new filesystem => /dev/disk3s1 ruby-1.8.7-p302 > File.exists?("/dev/disk3s1") => true ruby-1.8.7-p302 > Now I remove the disk and we go back to how it was Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 465Gi 385Gi 80Gi 83% / devfs 193Ki 193Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home /dev/disk2s2 1.4Ti 489Gi 908Gi 36% /Volumes/Backup /dev/disk1s6 466Gi 317Gi 148Gi 69% /Volumes/Spare See that /dev/disk3s1 is no longer there ruby-1.8.7-p302 > File.exists?("/dev/disk3s1") => false ruby-1.8.7-p302 > So as far as my system is concerned /dev/disk3s1 only exists when it is mounted. This may be sufficient for the task that the OP had. Now I will concede that it might not work how you might expect for other devices. File.exists?("/dev/disk0s1") which is not in the df -h list does return true as it is part of /dev/disk0s2. But the the OP didn't want to know if "/var/www/html" was mounted (or that the mount point existed) just that "/dev/cciss/c0d1p1" was mounted, the example that the OP gives would be true if "/dev/cciss/c0d1p1" was mounted to *any* mount point not just "/var/www/html". As I've said File.exists?() might be a sufficient solution for the OP.