I've had a bunch of Ubuntu VMs running for a couple of years without any big issues until yesterday. One of my VM's running Plex Media Server started acting strange. The plexmediaserver service went down and I wasn't able to do apt update/upgrade with the following error:
I tried a simple reboot and the VM would not recognise the boot disk anymore. "Boot failed, not a bootable disk". I checked the boot order which was still correct. I launched an ubuntu server live cd and found that the GPT is damaged. At this point a took a backup of the VM. Unfortunately the only backup that exist other than this one is a very old ZFS snapshot and an even older VM Backup.
I tried a recovery of the gpt using these instructions https://lihashgnis.blogspot.com/2016/07/recovering-from-corrupted-gpt-partition_30.html and the gpt seemed OK after that. I booted into gparted live and found that the two partitions were now visible, the second one being ext4, the first unrecognised but with a boot_grub flag. I did a "check" of the ext4 fs and is was successfully repaired. I then mounted it but found no data what so ever except "lost+found". This wasn't a fun discovery but seems very weird to me.
Using the ubuntu server live cd I manages to reinstall grub2 and got to the grub-recovery prompt. Unfortunately I can't get any further from there as the ext4 partition seems to be completely wiped. This is where I'm at right now. Any advice?
Some info on the setup and the VM:
There's only one disk on this VM and it is located on an nvme zfs pool.
Host: pve-manager/6.4-13/9f411e79 (running kernel: 5.4.140-1-pve)
VM OS: Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-86-generic x86_64)
Code:
dpkg: unrecoverable fatal error, aborting:
files list file for package 'linux-generic' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
I tried a simple reboot and the VM would not recognise the boot disk anymore. "Boot failed, not a bootable disk". I checked the boot order which was still correct. I launched an ubuntu server live cd and found that the GPT is damaged. At this point a took a backup of the VM. Unfortunately the only backup that exist other than this one is a very old ZFS snapshot and an even older VM Backup.
I tried a recovery of the gpt using these instructions https://lihashgnis.blogspot.com/2016/07/recovering-from-corrupted-gpt-partition_30.html and the gpt seemed OK after that. I booted into gparted live and found that the two partitions were now visible, the second one being ext4, the first unrecognised but with a boot_grub flag. I did a "check" of the ext4 fs and is was successfully repaired. I then mounted it but found no data what so ever except "lost+found". This wasn't a fun discovery but seems very weird to me.
Using the ubuntu server live cd I manages to reinstall grub2 and got to the grub-recovery prompt. Unfortunately I can't get any further from there as the ext4 partition seems to be completely wiped. This is where I'm at right now. Any advice?
Some info on the setup and the VM:
There's only one disk on this VM and it is located on an nvme zfs pool.
Host: pve-manager/6.4-13/9f411e79 (running kernel: 5.4.140-1-pve)
VM OS: Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-86-generic x86_64)
Code:
cat /etc/pve/qemu-server/101.conf
agent: 1
boot: cdn
bootdisk: scsi0
cores: 8
hostpci0: 03:00,pcie=1
ide2: local:iso/ubuntu-20.04.3-live-server-amd64.iso,media=cdrom,size=1231808K
machine: q35
memory: 20480
name: PlexPass
net0: virtio=7A:56:98:0A:35:4D,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: l26
scsi0: nvmepool:vm-101-disk-0,size=384G
scsihw: virtio-scsi-pci
smbios1: uuid=7ea60e16-eefb-4d3f-ab3f-d1aa3d816667
sockets: 1
startup: order=2
vmgenid: 6c45f813-1265-4a6b-96dd-d3ce040791a1