• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

cvs

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

Cleanup CVS Snapshot Volumes

August 30, 2022

How to unmount CVS snapshot volumes all at once using a Bash script. I ran into a scenario where I had to unmount 115 volumes. Instead of manually running umount on each one, I use the script below to unmount all 115 volumes. The script performs a grep for ‘.snapshot’ and then writes the results to a file. I then read the file line by line and perform unmount on each one.

#!/bin/bash
file='/tmp/snapshots.txt'
df -h | grep .snapshot | awk '{print $6}' > $file
while IFS= read -r line; do
  echo 'unmounting '$line
  umount $line
done < $file

#!/bin/bash file='/tmp/snapshots.txt' df -h | grep .snapshot | awk '{print $6}' > $file while IFS= read -r line; do echo 'unmounting '$line umount $line done < $file

Filed Under: Linux Tagged With: bash, cvs, snapshots, umount

GCP CVS Mount Instructions

January 28, 2022

Here are the mount instructions for NFS and SMB drives for GCP Netapp CVS.

NFS

sudo yum install -y nfs-utils
sudo apt-get install nfs-common
sudo mkdir /condescending-sharp-hugle
sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=3,tcp 10.49.253.6:/condescending-sharp-hugle /condescending-sharp-hugle

sudo yum install -y nfs-utils sudo apt-get install nfs-common sudo mkdir /condescending-sharp-hugle sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=3,tcp 10.49.253.6:/condescending-sharp-hugle /condescending-sharp-hugle

SMB

Mapping your network drive
1. Click the Start button and then click on Computer.
2. Click Map Network Drive.
3. In the Drive list, click any available drive letter.
4. In the folder box, type \\shared.mydomain.com\myshare.
To connect every time you log on to your computer, select the Reconnect at sign-in check box.
\\shared.mydomain.com\myshare
5. Click Finish.

Mapping your network drive 1. Click the Start button and then click on Computer. 2. Click Map Network Drive. 3. In the Drive list, click any available drive letter. 4. In the folder box, type \\shared.mydomain.com\myshare. To connect every time you log on to your computer, select the Reconnect at sign-in check box. \\shared.mydomain.com\myshare 5. Click Finish.

Filed Under: Cloud, Linux Tagged With: cvs, gcp, instructions, mount, netapp, nfs, smb

  • Home
  • About
  • Archives

Copyright © 2023