[SOLVED] stupid people win stupid prizes .

peter247

Member
Dec 31, 2021
66
6
13
63
Hi , Today I was going to backup my ZFS array almost 8TB of data , easy mount my backup drive and mount it , what was on it was full of junk data , so I did a rm -r , but messed up by doing a rm -r /*
Very lucky don't think I've deleted any data off the ZFS array or I would be really crying .
I've installed a new copy of proxmox on a spare USB drive which it said something like : I found a copy of proxmox do you want to renames it pvc_old , yes .
My ZFS array which contains all my backup and daily backups looks to be o.k ..
Is there a way to get access to my old lvm root data , inside proxmox or use a live linux cd etc ?

lsblk

nvme0n1 259:0 0 1.8T 0 disk
├─nvme0n1p1 259:1 0 1007K 0 part
├─nvme0n1p2 259:2 0 1G 0 part
└─nvme0n1p3 259:3 0 1.8T 0 part
├─pve--OLD--2021E763-swap 252:0 0 8G 0 lvm
└─pve--OLD--2021E763-root 252:1 0 1.8T 0 lvm

mount /dev/mapper/pve--OLD--2021E763-root /mnt/nvme

I think it's deleted the files I was after my frigate setup file etc
 
Last edited:
With ZFS you should have snapshots enabled, so hopefully that would be ok regardless

Please, STOP using rm at the console. Install Midnight Commander and use that, it's much safer and will ask you Y/N if you want to delete directories recursively. Plus it has a lot of other nice features.

If you're using standard LVM+ext4 rootfs, in the future start using Veeam agent for linux to do full bare-metal backup. Test restore into a VM.

https://www.youtube.com/watch?v=g9J-mmoCLTs

https://github.com/kneutron/ansitest/tree/master/proxmox
^ See also bkpcrit script, set it up to backup to non-root media or NAS, put it nightly in cron

As far as recovering your old lvm, /me subscribes for updates...

EDIT: Also, for the cautious sysadmin:

https://github.com/kneutron/ansitest/blob/master/saferm.sh
 
Last edited:
  • Like
Reactions: justinclift
With ZFS you should have snapshots enabled, so hopefully that would be ok regardless

Please, STOP using rm at the console. Install Midnight Commander and use that, it's much safer and will ask you Y/N if you want to delete directories recursively. Plus it has a lot of other nice features.

If you're using standard LVM+ext4 rootfs, in the future start using Veeam agent for linux to do full bare-metal backup. Test restore into a VM.

https://www.youtube.com/watch?v=g9J-mmoCLTs

https://github.com/kneutron/ansitest/tree/master/proxmox
^ See also bkpcrit script, set it up to backup to non-root media or NAS, put it nightly in cron

As far as recovering your old lvm, /me subscribes for updates...

EDIT: Also, for the cautious sysadmin:

https://github.com/kneutron/ansitest/blob/master/saferm.sh
Hi , not heard of Veeam before , does it backup the main proxmox disk or does it backup the lot , zpools and all ?
That is the first and last I'll do that ( hopefully ) , so MC looks like the way to go , I was lucky that I think it crashed the system before it got to my zpools.
Now it's time to slowly putting it back together , so no home automation or frigate until I get it all back together , no rush .
 
Watch the video. Veeam will backup LVM structure (but not lvm-thin!) and standard ext4 / XFS rootfs. It's bare-metal backup/restore for the OS, you still need to backup your VMs and CTRs. (And definitely do a test restore so you're familiar with the process.)
 
Among other things, I always enable confirmation on bash:

Code:
sed -i 's/# alias /alias /g' ~/.bashrc

Which uncomments this in root's .bashrc:

Code:
#Some more alias to avoid making mistakes:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

Beware: this does not help with chown/chmod disasters ;)
 

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!