On Thu, Nov 26, 2015 at 12:10 AM,  <waltd...@waltdnes.org> wrote:
>
> I'll admit that my system setup is a bit unusual. A long time ago, in
> a place far away, hard drives were small, compared to today's standards.
> The usual unix practice of multiple seprate partitions was not feasable
> for me, but I did want to keep root on its own partition. So I
> compromised with a small / partition, with empty /home, /opt, /var,
> /usr, and /tmp directories. Their real equivalents are bind-mounted
> from a much larger partition. I just re-did my oldest machine. It has
> a primary partition 1, which covers the entire hard drive. The /
> partion on /dev/sda5 is approximately 500 megabytes (YES!). There's a
> 3.8 gigabyte swap partion /dev/sda6, and the rest of the drive is
> /dev/sda7. Here's the relevant portion of /etc/fstab...
>
> /dev/sda5               /           ext2     noatime,async      0 1
> /dev/sda7               /home       ext3     noatime,async      0 1
> /home/bindmounts/opt    /opt        auto     bind               0 0
> /home/bindmounts/var    /var        auto     bind               0 0
> /home/bindmounts/usr    /usr        auto     bind               0 0
> /home/bindmounts/tmp    /tmp        auto     bind               0 0
> /dev/sda6               none        swap     sw                 0 0
>
> ...and the output from "df"...
>
> Filesystem     1K-blocks      Used Available Use% Mounted on
> /dev/root         495944     49416    420928  11% /
> devtmpfs           10240         0     10240   0% /dev
> tmpfs             310080       356    309724   1% /run
> shm              1550384         0   1550384   0% /dev/shm
> cgroup_root        10240         0     10240   0% /sys/fs/cgroup
> /dev/sda7      476205120 292365556 159643008  65% /opt
>
> ...showing /dev/sda7 mounted on /opt !?!? mc (Midnight Commander) shows
> 152 of 454 gigabytes free on all of /home, /opt, /var, /usr, and /tmp,
> which is correct, since they're all really bindmounts from /dev/sda7.
> The / partition (/dev/sda5) has 411 of 484 megabytes free. The machine
> works OK, but the "df" output is a head-scratcher. I've re-booted a
> couple of times, with no change.

If the same filesystem's mounted two or more times, then df shows the
shortest mountpoint.

In your case, /home /opt /tmp /usr /var are mounts of /dev/sda7 so
/opt is shown, because it's the first mountpoint lexically-speaking.

If you use "-a", then /home will be displayed too.

Reply via email to