[SOLVED] Backups filling local drive when USB drive /mnt/backups disconnects

cammarata.m

New Member
Jun 15, 2023
13
1
3
Hello,
Proxmox is installed on a 512 gb NVME. I have a physical USB 250gb drive /mnt/backups connected to my proxmox computer running scheduled backups of my LXCs.

Every once in a while it the backup drive will mysteriously disconnect itself. When that happens, I see some kind of 100 gb local partition is automatically mounted to /mnt/backups and the backups continued there. The problem is, I don't notice that it happened until I see that it's 100gb and not the 250gb in /mnt/backups.

Questions:
  1. Now that I've remounted USB to /mnt/backups how can I find where these local backups were actually saved so I can remove them?
  2. How can I be notified if the USB backup drive disconnects again?
Thank you in advance!
 
you should set the "is_mountpoint" option on your directory storage used for backups.
 
  • Like
Reactions: cammarata.m
Hello,
Proxmox is installed on a 512 gb NVME. I have a physical USB 250gb drive /mnt/backups connected to my proxmox computer running scheduled backups of my LXCs.

Every once in a while it the backup drive will mysteriously disconnect itself. When that happens, I see some kind of 100 gb local partition is automatically mounted to /mnt/backups and the backups continued there. The problem is, I don't notice that it happened until I see that it's 100gb and not the 250gb in /mnt/backups.

Questions:
  1. Now that I've remounted USB to /mnt/backups how can I find where these local backups were actually saved so I can remove them?
  2. How can I be notified if the USB backup drive disconnects again?
Thank you in advance!
how to made usb physical mounted to promox for backup, i try it and fails
 
you should set the "is_mountpoint" option on your directory storage used for backups.
Thank you,
I added the is_mountpoint 1 to backups in /etc/pve/storage.cfg

Code:
dir: backups
    path /mnt/backups
    content backup,images
    prune-backups keep-all=1
    shared 0
    is_mountpoint 1

AFAIK, that will make it so Proxmox considers the storage offline if it isn't connected in the future. Thank you!

When the 100gb 'local' drive was mounted as a temporary replacement, where did those backups save to? local is showing 62/100gb used in the webUI but if I select 'backups' there's nothing there (and no images, templates, etc.).
 
Last edited:
how to made usb physical mounted to promox for backup, i try it and fails
Here's the steps I used. I added the solution above as the last step. I'm new to Proxmox so this may not be the best way to do it, I took these from various guides I found online and tried to write it as plainly as I could.


Mounting a USB drive for regular backups​

Format and mount the backup drive​

Step 1​

Plug the USB drive into your system. In Proxmox, go to disks and note the name of the disk, alternatively you can use fdisk -l in the proxmox shell. Mine is /dev/sdb

Step 2​

Set the file system before mounting it, this will erase the drive

mkfs.ext4 /dev/sdb

Step 3​

Create a backups directory to mount to

mkdir /mnt/backups

Step 4​

Mount the backup drive to the directory

mount /dev/sdb /mnt/backups

Step 5​

Now add the USB drive mount point in the Proxmox web UI to use for backups. This is done in Datacenter / Storage. Select *Directory* from the *Add* pulldown, then enter the mount point you created and configure it with a content type of VZDump backup file.

Create an fstab entry, so the drive is automatically mounted at system reboots​

Step 1​

Determine the UUID of the drive. You can use...

  • ls -l /dev/disk/by-uuid or lsblk -f
  • The UUID will look like...063c75bc-bcc6-4fa5-8417-a7987a26dccb

Step 2​

Add an entry in /etc/fstab using the UUID to mount the drive when the system boots. The following format is used for /etc/fstab...

[Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]

Using UUID, the entry will look something like...

UUID=063c75bc-bcc6-4fa5-8417-a7987a26dccb /mnt/backups ext4 defaults,noatime,nofail 0 2

The USB now will be mounted when the system boots up, and can be mounted manually with the mount command if for some reason it disconnects.

Make sure Proxmox knows the backups directory is an externally managed mount point and consider the storage offline if it isn't mounted​

Edit storage.cfg found in /etc/pve/

add

is_mountpoint 1 to the directory, for example:

Code:
dir: backups
path /mnt/backups
content backup,images
prune-backups keep-all=1
shared 0
is_mountpoint 1
 
Last edited:
When the 100gb 'local' drive was mounted as a temporary replacement, where did those backups save to?
When "local" as storage was used then at "/var/lib/vz/dump".
In case the backup should have been written to your usb disk but couldn't because the usb disk wasn't mounted, then the backups might stikl be in /mnt/backups and consume space of your root filesystem. But you can only see them there when your usb disk isn't mounted.
 
  • Like
Reactions: cammarata.m
When "local" as storage was used then at "/var/lib/vz/dump".
In case the backup should have been written to your usb disk but couldn't because the usb disk wasn't mounted, then the backups might stikl be in /mnt/backups and consume space of your root filesystem. But you can only see them there when your usb disk isn't mounted.
Thanks so much, that makes sense that they'd be in there, but taking space of the root filesystem. I think I can cross-reference the dates/names and delete the 'extra' ones from there. Appreciate the response and thanks again!
 
thank you, very helpfully and works
Here's the steps I used. I added the solution above as the last step. I'm new to Proxmox so this may not be the best way to do it, I took these from various guides I found online and tried to write it as plainly as I could.


Mounting a USB drive for regular backups​

Format and mount the backup drive​

Step 1​

Plug the USB drive into your system. In Proxmox, go to disks and note the name of the disk, alternatively you can use fdisk -l in the proxmox shell. Mine is /dev/sdb

Step 2​

Set the file system before mounting it, this will erase the drive

mkfs.ext4 /dev/sdb

Step 3​

Create a backups directory to mount to

mkdir /mnt/backups

Step 4​

Mount the backup drive to the directory

mount /dev/sdb /mnt/backups

Step 5​

Now add the USB drive mount point in the Proxmox web UI to use for backups. This is done in Datacenter / Storage. Select *Directory* from the *Add* pulldown, then enter the mount point you created and configure it with a content type of VZDump backup file.

Create an fstab entry, so the drive is automatically mounted at system reboots​

Step 1​

Determine the UUID of the drive. You can use...

  • ls -l /dev/disk/by-uuid or lsblk -f
  • The UUID will look like...063c75bc-bcc6-4fa5-8417-a7987a26dccb

Step 2​

Add an entry in /etc/fstab using the UUID to mount the drive when the system boots. The following format is used for /etc/fstab...

[Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]

Using UUID, the entry will look something like...

UUID=063c75bc-bcc6-4fa5-8417-a7987a26dccb /mnt/backups ext4 defaults,noatime,nofail 0 2

The USB now will be mounted when the system boots up, and can be mounted manually with the mount command if for some reason it disconnects.

Make sure Proxmox knows the backups directory is an externally managed mount point and consider the storage offline if it isn't mounted​

Edit storage.cfg found in /etc/pve/

add

is_mountpoint 1 to the directory, for example:

Code:
dir: backups
path /mnt/backups
content backup,images
prune-backups keep-all=1
shared 0
is_mountpoint 1
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!