USB drive very slow after reconnection

hobsoni

Member
Jul 22, 2022
20
1
8
Hi all,
I have two problems, and I think they are related.
I am running proxmox ve version 7.3 on a 32GB machine. This is configured to have a USB drive attached for backup. Upon booting, the USB device appears showing my backups, and the backups are taken at 250 to 300MB per second. The backup drive is a 3/5inch spinning disk, in a SSD to USB3 enclosure, plugged into a USB3 port.
SO on a fresh boot, everything is working just fine.
However I don't really want my backup drive permanently attached, so I demount it and remount it later.
Upon powering it up, it appears as a new disk, with my backups on it, it also adds a new entry to /etc/pve/storage.cfg. It does NOT mount as USB. And it is now slow as a druggd up snail: backups usually peak at 2.5MB/Sec - about 1% of the previous speed.
A reboot will fix the problem, and editing /etc/pve/storage.cfg will remove the invalid device entry.

How can I get things to "just work".

This is my /etc/fstab file - the commented out lines at the bottom are the things I have tried. None changed the behaviour.
# <file system> <mount point> <type> <options> <dump> <pass> /dev/pve/root / ext4 errors=remount-ro 0 1 UUID=0E21-1B07 /boot/efi vfat defaults 0 1 /dev/pve/swap none swap sw 0 0 proc /proc proc defaults 0 0 # and the usb drive # /dev/sdb1 /mnt/usb_storage ext4 defaults 0 0 #UUID="bbf02a13-b340-4575-9dfd-e748bbf77342" /mnt/usb_storage ext4 defaults 0 0 PARTUUID="a53b1de4-4a73-4925-97b3-e792a2798b23" /mnt/usb_storage ext4 defaults 0 0
The relevant entry in /etc/pve/storage.cfg is
dir: USB path /mnt/usb_storage content images,backup,rootdir nodes cyllene prune-backups keep-all=1 shared 0
 
Nut sure about the speed but I see 2 problems:
1.) When mounting that disk using fstab you won't be able to boot your PVE without that external disks attached. Would be better to use other automounting methods like autofs.
2.) You did't set the mountpoint of your directory storage. So when automounting fails or you manually unmount it, PVE won't block that storage and will still allow you to create new backups. These backups are then be writtem to the unmounted mountpoint and will be stored on your internal system disk. At some time your system disk might be completely full and your PVE host will stop working.
And 300MB/s sounds too fast for a USB HDD. I would guess you are already writing your backups to the root filesystem and not to the external HDD.
Try to run pvesm set USB --is_mountpoint yes to prevent that, so the storage will lock up when not mounted.
 
Last edited:
Thanks for the pvesm command. I have run it.

I have found autofs and usbmount, but they appear to be abandoned and not in the debian repos. If they are OK to use with proxmox, I will need instructions on how to remove proxmox's control of the drive at boot time.

On a slightly different note, when a USB drive in attached, then the software that recognises the change, should (in my view) look into fstab to see if that file tells it how to mount it, and only do something else if fstab is no help. This clearly does not happen. Is this a bug? If so, a debian bug or a pxoxmoc big? If not, what is supposed to happen?

The backups are on the right disk. When it has been umount-ed, there are no files.
 
Last edited:

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!