• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

stale

Cleanup Stale CVS Snapshots

August 30, 2022

Here’s the script that looks mounts with stale file handles and removes them.

#!/bin/bash
file='/tmp/stale.txt'
df -h | grep Stale > $file
sed -i -e 's/df: ‘/'""'/g' $file
sed -i -e 's/’: Stale file handle/'""'/g' $file
while IFS= read -r line; do
  echo 'unmounting '$line
  umount $line
done < $file

#!/bin/bash file='/tmp/stale.txt' df -h | grep Stale > $file sed -i -e 's/df: ‘/'""'/g' $file sed -i -e 's/’: Stale file handle/'""'/g' $file while IFS= read -r line; do echo 'unmounting '$line umount $line done < $file

Filed Under: Linux Tagged With: bash, cvs, file, handles, snapshots, stale

Exportfs

August 20, 2019

What’s a stale file handle? A file handle becomes stale when the file or directory referenced by the handle is removed by another host/server, while our client still holds an active reference to the object file/directory. A typical example occurs when the current directory of a process, running on our client, is removed on the server (either by a process running on the server or on another client).

If your NFS file handles are stale, run this command.

/usr/bin/exportfs -a

/usr/bin/exportfs -a

Filed Under: Linux Tagged With: exportfs, nfs, stale

  • Home
  • About
  • Archives

Copyright © 2023