Standalone backup agents for Linux, Mac, AIX & Solaris workloads on-premises or in the public cloud
Post Reply
AlexLeadingEdge
Veteran
Posts: 456
Liked: 58 times
Joined: Dec 14, 2015 9:42 pm
Contact:

USB Backup Drive Copied to Root

Post by AlexLeadingEdge » 1 person likes this post

Hi guys,

Our CentOS-based website went down this morning. Looking at the server it said low disk space. For some reason there were two mount points for the same USB backup drive under \Mount\. Unplugging the USB drive left one folder on the drive, with a size of 35GB. Root only has 50GB, but itself only uses about 10GB in total so it perfectly fine for normal use.

Was this some sort of shadow copy? I just don't know. Veeam said that the "mount point for repository changed".

I deleted the folder under \Mount\ and it freed up the 35GB. The website database wouldn't reconnect but after a reboot everything was fine again. I suspect a power outage created this situation but I would like to find a way to make sure this doesn't happen again.

Any ideas?
AlexLeadingEdge
Veteran
Posts: 456
Liked: 58 times
Joined: Dec 14, 2015 9:42 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by AlexLeadingEdge »

I should point out we had an issue with Veeam last week, not sure if related:

https://forums.veeam.com/veeam-agent-fo ... 52942.html
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by PTide » 1 person likes this post

Hi,

Most likely the USB drive used as a target for backups has been detached at some point so all backups went straight under /Mount/ directory on the local hard drive. You might want to utilize a pre-job script that would check if the USB device is mounted to avoid such situations.

Thanks
AlexLeadingEdge
Veteran
Posts: 456
Liked: 58 times
Joined: Dec 14, 2015 9:42 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by AlexLeadingEdge »

Ah! That explains it! Thanks for the quick reply :)
AlexLeadingEdge
Veteran
Posts: 456
Liked: 58 times
Joined: Dec 14, 2015 9:42 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by AlexLeadingEdge »

Same problem has returned again last night. Luckily I caught it before more than one backup was made so drive hadn't filled up completely. It seems to happen after a power cut, the first time was when an electrician killed the power to it, the second time when there was a power cut.
PTide wrote:You might want to utilize a pre-job script that would check if the USB device is mounted to avoid such situations.
I need to do this but my coding experience in Linux probably isn't up to the task. I've come from a Microsoft-based coding background so the commands are unfamiliar.

When the issue occurs the /media/ folder ends up with a KWUSBBACKUP folder and a KWUSBBACKUP_1 folder. One is the mount point of the USB drive, the other are the files incorrectly written to the hard drive.

My current process is to disconnect the USB backup drive manually which then leaves only one folder, then I run the command:

sudo rm -R /media/KWUSBBACKUP

or

sudo rm -R /media/KWUSBBACKUP_1

I'm guessing I could probably use a wildcard command to "remove all folders inside /media/"

Reattaching the drive returned the USB drive as /media/KWUSBBACKUP and I then manually run a Configure in Veeam Agent for Linux (I'm not actually sure if the Configure is needed).

I haven't actually figured out how to un-mount and re-mount a USB drive using the CLI yet. I don't know how I would re-identify a USB drive when it is un-mounted.

I should probably mention we are using CentOS 6.
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by PTide »

sudo rm -R /media/KWUSBBACKU
I'm guessing I could probably use a wildcard command to "remove all folders inside /media/"
Although I don't have a suitable script at hand right now (but I'll try to provide it later), I feel an irresistible urge to warn you - be extremely careful with that thing, especially with a wildcard. If you need to remove only one directory (which is empty in your case), then you should use rmdir. Please also check this manual page for mount command. That's right - some basic commands look very similar in Windows and Linux :)

Thanks
AlexLeadingEdge
Veteran
Posts: 456
Liked: 58 times
Joined: Dec 14, 2015 9:42 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by AlexLeadingEdge »

PTide wrote:Although I don't have a suitable script at hand right now (but I'll try to provide it later), I feel an irresistible urge to warn you - be extremely careful with that thing, especially with a wildcard. If you need to remove only one directory (which is empty in your case), then you should use rmdir. Please also check this manual page for mount command. That's right - some basic commands look very similar in Windows and Linux :)
Thanks PTide, I agree that wildcards are dangerous. I look forward to your script to solve this issue :)

//Edit: On a related note, I see that if a user opens Veeam for Linux and mounts a backup and then closes Veeam for Linux the mount remains in /mnt/backup . Reopening Veeam for Linux then doesn't show the option to unmount. If I type umount /mnt/backup it gives the error:

umount: /mnt/backup is not mounted (according to mtab)
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by PTide »

//Edit: On a related note, I see that if a user opens Veeam for Linux and mounts a backup and then closes Veeam for Linux the mount remains in /mnt/backup . Reopening Veeam for Linux then doesn't show the option to unmount. If I type umount /mnt/backup it gives the error:

umount: /mnt/backup is not mounted (according to mtab)
That is a known bug and it has been fixed long time ago. Are you running the latest 2.0.1.665?

Thanks
AlexLeadingEdge
Veteran
Posts: 456
Liked: 58 times
Joined: Dec 14, 2015 9:42 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by AlexLeadingEdge »

PTide wrote: Sep 14, 2018 12:10 pmThat is a known bug and it has been fixed long time ago. Are you running the latest 2.0.1.665?
Yes, veeamconfig -v says v2.0.1.665
AlexLeadingEdge
Veteran
Posts: 456
Liked: 58 times
Joined: Dec 14, 2015 9:42 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by AlexLeadingEdge »

Client has replaced the battery in the UPS, and in the process the web server was powered off again. Had to run through the work-around previously mentioned.
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by PTide » 1 person likes this post

Here is a pre-job script that should stop the session if there is no storage with a specific filesystem present and mounted:

Code: Select all

#!/bin/bash

## This part gets current session id

currentsessionid=$(veeamconfig session list | grep Running | awk '{print $4}')

## Checking if a filsystem with 50523B186AFADCC6 UUID is connected and mounted to /backup
## '50523B186AFADCC6' is UUID of my thumbdrive obtained via 'lsblk -f'

if ! lsblk -f | grep --quiet 50523B186AFADCC6; then
        #echo "Filesystem 50523B186AFADCC6 is not attached."
        veeamconfig session stop --id $currentsessionid
elif ! lsblk -f | grep --quiet backup
then
                #echo "Filesystem 50523B186AFADCC6 is not mounted."
                veeamconfig session stop --id $currentsessionid
#else
#               echo "Filesystem 50523B186AFADCC6 is attached and mounted."
fi
exit 0
Please let me know how it works

Thanks!
AlexLeadingEdge
Veteran
Posts: 456
Liked: 58 times
Joined: Dec 14, 2015 9:42 pm
Contact:

Re: USB Backup Drive Copied to Root

Post by AlexLeadingEdge »

Ok, I'll modify for my system and get back to you on results :)
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests