Accidentally deleted the partition table of rpool. The system is still running no errors yet. How do I recover?

erer2001

Member
May 25, 2021
10
5
8
23
So I made a mistake and using fdisk I deleted the entire partition table and created a MBR.
Here's the current output from fdisk.

Code:
Disk /dev/nvme1n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WDS500G1B0C-00S6U0                 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x17eb196b

Tried scrubbing rpool and no errors have been found
Code:
root@proxmox:/# zpool status rpool
  pool: rpool
 state: ONLINE
  scan: scrub repaired 0B in 00:05:47 with 0 errors on Fri Jan 12 22:34:50 2024
config:

        NAME                                               STATE     READ WRITE CKSUM
        rpool                                              ONLINE       0     0     0
          nvme-eui.1911494560130001001b444a44853f00-part3  ONLINE       0     0     0

errors: No known data errors

The system uses ZFS, it's stil running and everything still works. I'm sure if I reboot it's bust.

So how do I recover??
 
I guess you already backed everything important up while it is still running? I would have said clone the partition table from the other disks of the pool, but with a single disk this of cause won't work. I guess you got no old backup of your partition table?
 
Last edited:
I guess you already backed everything important up while it is still running? I would have said clone the partition table from the other disks of the pool, but with a single disk this of cause won't work. I guess you also got no old backup of your partition table?
I have the automatic backup set to yes everything is safe. Just a pain in the butt if I have to take the server out, connect a monitor and keyboard and reinstall and restore everything.

The partition table should be still loaded into RAM, but I don't know how to retrive it and restore it.
 
I did a quick search but only found tutorials restoring the partition table by booting into data recovery software (like testdisk) and you probably don't want to do this while everything is still working.

Edit: This looks promising: https://unix.stackexchange.com/a/43929
 
Last edited:
I too found a lot online but they all were for restoring after the partition table in the ram was lost. That looks promising but it's 11 years old. I've got only one shot so in the meantime I will wait and test all my backup and prepare for the worst.

Considering that the server is connected to the UPS I can simply not reboot for at least a few month. I will wait hoping for someone who got into my exact situation and generous enough to provide a updated instruction on how to restore the table,
 

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!