[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hide rootfs filesystem in df
From: |
Robert Milasan |
Subject: |
Re: Hide rootfs filesystem in df |
Date: |
Mon, 3 Dec 2012 09:57:27 +0100 |
On Mon, 3 Dec 2012 09:53:44 +0100
"Robert Milasan" <address@hidden> wrote:
>
> Ok, how about this:
>
> Index: coreutils-8.17/src/df.c
> ===================================================================
> --- coreutils-8.17.orig/src/df.c
> +++ coreutils-8.17/src/df.c
> @@ -474,6 +474,11 @@ get_dev (char const *disk, char const *m
> if (!selected_fstype (fstype) || excluded_fstype (fstype))
> return;
>
> + if (fstype != NULL) {
> + if (STRNCMP_LIT (fstype, "rootfs") == 0)
> + return;
> + }
> +
> /* If MOUNT_POINT is NULL, then the file system is not mounted,
> and this program reports on the file system that the special file is
> on. It would be better to report on the unmounted file system,
>
> Test this on openSUSE 12.1 with "df --total" and works properly:
>
> > ./df --total
> Filesystem 1K-blocks Used Available Use% Mounted on
> devtmpfs 3934516 8 3934508 1% /dev
> tmpfs 3942324 288 3942036 1% /dev/shm
> tmpfs 3942324 632 3941692 1% /run
> /dev/sda5 103210272 6970060 95191660 7% /
> tmpfs 3942324 0 3942324 0% /sys/fs/cgroup
> tmpfs 3942324 632 3941692 1% /var/run
> tmpfs 3942324 632 3941692 1% /var/lock
> tmpfs 3942324 0 3942324 0% /media
> buildfs 5242880 749012 4493868 15% /var/tmp
> /dev/sda6 369245224 64179592 286308976 19% /home
> total 505286836 71900856 413580772 15%
>
>
Ignore my last comment, didn't pay attention :)
--
Robert Milasan
L3 Support Engineer
SUSE Linux (http://www.suse.com)
email: address@hidden
GPG fingerprint: B6FE F4A8 0FA3 3040 3402 6FE7 2F64 167C 1909 6D1A