XFS Filesystem has duplicate UUID

Here’s how to fix a duplicate UUID on a XFS file system.

mount -o rw,nouuid /dev/sda1  /data

Mounting with nouuid will work, but not after a reboot.

To avoid a duplicate ID, run this command to generate a new UUID.

xfs_admin -U generate /dev/sda3
Clearing log and setting UUID
writing all SBs
new UUID = xxxxx-xxxx-xxxx-xxxxxxxxx

Yum RPMDB failed

If you are getting a similar error from yum similar to the one below, it looks like yum is broken in your system.

error: rpmdb: BDB0113 Thread/process 2196/139984719730496 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
 
Error: rpmdb open failed

Here’s the fix.

mv /var/lib/rpm/__db* /tmp
yum clean all

Run your yum commands. The errors should be gone.

GCP StackDriver Firewall Log

Here’s one way how to look at traffic hitting a GCP firewall. To view the traffic activity, go to Stackdriver Logging > Viewer. Enter the following search string. Just replace the network name and firewall name.

logName:(projects/project-name/logs/compute.googleapis.com%2Ffirewall) AND jsonPayload.rule_details.reference:("network:network-name/firewall:firewall-name")

GCP Increase Download Speed for gsutil

If you’re downloading large files, you can speed up download speeds by modifying gsutil. Decrease the number of threads and increase the number of components.

gsutil \
-o "GSUtil:parallel_thread_count=1" \
-o "GSUtil:parallel_process_count=8" \
cp gs://bucket/source.dat /download/dest/file.dat