[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help masking Stale file handle errors when using df
From: |
Pádraig Brady |
Subject: |
Re: Help masking Stale file handle errors when using df |
Date: |
Thu, 7 Sep 2017 21:40:00 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 07/09/17 16:07, Kaushal Modi wrote:
> Hello,
>
> I use RHEL 6.6 at work. The sysadmin maintains a cron that backs up my
> $HOME in $HOME/.snapshot/.
>
> When I use the default df on RHEL 6.6 (coreutils 8.4!), I do not see any
> "Stale file handle" errors.
>
> But when I use the latest df (coreutils 8.28), I get many lines like these:
>
> df: /home/kmodi/.snapshot/daily.2017-05-10_2000: Stale file handle
> df: /home/kmodi/.snapshot/daily.2017-06-06_2000: Stale file handle
> df: /home/kmodi/.snapshot/daily.2017-06-14_2000: Stale file handle
> df: /home/kmodi/.snapshot/hourly.2017-06-19_1305: Stale file handle
> df: /home/kmodi/.snapshot/hourly.2017-06-19_1105: Stale file handle
> df: /home/kmodi/.snapshot/daily.2017-06-13_2000: Stale file handle
> df: /home/kmodi/.snapshot/daily.2017-06-09_2000: Stale file handle
> df: /home/kmodi/.snapshot/daily.2017-06-10_2000: Stale file handle
> df: /home/kmodi/.snapshot/daily.2017-06-16_2000: Stale file handle
> df: /home/kmodi/.snapshot/daily.2017-06-17_2000: Stale file handle
> df: /home/kmodi/.snapshot/daily.2017-06-18_2000: Stale file handle
>
> These directories do not exist anymore as routinely older backups are
> removed from the ~/.snapshot directory.
>
> I installed coreutils locally in my $HOME very recently starting last week.
> So I never saw those Stale file handle errors earlier (which used df --
> coreutils 8.4). But looks like some newer version after that started doing
> this.
>
> I use tcsh at work. I don't think you can redirect *just* std errors (to
> /dev/null) on tcsh; the only redirection operator allowed is ">&" which
> redirects both stderr and stdiyout. Would there be some other way to mast
> these errors?
>
> Thanks.
>
The older df was looking at a static list of mounts from /etc/mtab,
while the newer df uses the more dynamic /proc/self/mountinfo.
This latter file has entries to the problematic mount points.
I suspect ~/.snapshot/ may point to NFS and that is giving ESTALE
errors for various mount points.
Solutions would be to clean up the mounts at the system level,
use the df -l option to only consider local file systems,
or use df 2>/dev/null to discard errors (and assume that's the only error).
cheers,
Pádraig