error: invalid arch-independent elf magic

aaazzx

New Member
Aug 14, 2021
5
0
1
36
Hello,

At first I wanted to update the capacity configuration to reduce the local space and increase the local-lvm space.

I use the command

Code:
lvreduce -L -10G /dev/mapper/pve-root

After rebooting, proxmox went wrong.

wrong1.jpg

I found a similar situation from this post.

I use ubuntu live cd to operate and use commands to restore space.

I only use the command

Code:
lvextend -L +10G /dev/mapper/pve-root

A new problem occurred after restarting the machine.

wrong2.jpg

Show error: invalid arch-independent elf magic


I can't find a solutionI,

How can i get it back to normal?

Or how to back up the data and reinstall proxmoox?

There is only one computer hard disk with a capacity of 256g.
 
Last edited:
Show error: invalid arch-independent elf magic
Did you shrink the filesystem on root (/) before shrinking the LV? If not, you most certainly corrupted your data. You can try data rescue applications to see if something is left, but by the look of things your data is gone.
 
Did you shrink the filesystem on root (/) before shrinking the LV? If not, you most certainly corrupted your data. You can try data rescue applications to see if something is left, but by the look of things your data is gone.

Only shrink path /dev/mapper/pve-root.
From 59.25g to 29.25g, Now restored to 59.25g.

Using the lvs command, I can see the vm disk.

Code:
ubuntu@ubuntu:~$ sudo pvs
  PV         VG  Fmt  Attr PSize   PFree
  /dev/sda3  pve lvm2 a--  237.97g 15.99g


ubuntu@ubuntu:~$ sudo lvs
  LV                               VG  Attr       LSize    Pool Origin                    Data%  Meta%  Move Log Cpy%Sync Convert
  data                             pve twi-aotz-- <151.63g                                90.23  5.43                           
  root                             pve -wi-a-----   59.25g                                                                       
  snap_vm-102-disk-0_Inital        pve Vri---tz-k   32.00g data                                                                 
  snap_vm-102-disk-1_Inital        pve Vri---tz-k   32.00g data                                                                 
  snap_vm-103-disk-0_InstallDotnet pve Vri---tz-k   60.00g data vm-103-disk-0                                                   
  snap_vm-103-disk-0_NewSys        pve Vri---tz-k   60.00g data vm-103-disk-0                                                   
  swap                             pve -wi-a-----    8.00g                                                                       
  vm-101-disk-0                    pve Vwi-a-tz--   60.00g data                           36.64                                 
  vm-101-disk-1                    pve Vwi-a-tz--   30.00g data                           10.88                                 
  vm-102-disk-0                    pve Vwi-a-tz--   32.00g data snap_vm-102-disk-0_Inital 51.03                                 
  vm-102-disk-1                    pve Vwi-a-tz--   32.00g data snap_vm-102-disk-1_Inital 0.22                                   
  vm-103-disk-0                    pve Vwi-a-tz--   60.00g data                           33.28                                 
  vm-103-state-NewSys              pve Vwi-a-tz--   <4.49g data                           33.28                                 
  vm-110-disk-0                    pve Vwi-a-tz--   32.00g data                           75.72                                 
  vm-111-disk-0                    pve Vwi-a-tz--   32.00g data                           70.04                                 
  vm-120-disk-0                    pve Vwi-a-tz--   32.00g data                           53.13

My virtual machines are still there, right?

I used another hard drive to install Proxmox, but I don’t know how to move the virtual machine to the new proxmox.

filesystem is ext4.

How can I restore it now?

Can you teach me how to do it? Thank you
 
Only shrink path /dev/mapper/pve-root.
From 59.25g to 29.25g, Now restored to 59.25g.
Yes, you would have also needed to resize the ext4 (or xfs) filesystem residing on top of the LV. *Before* resizing that one.

I used another hard drive to install Proxmox, but I don’t know how to move the virtual machine to the new proxmox.

filesystem is ext4.

How can I restore it now?

Can you teach me how to do it? Thank you
First, rename the old VG from 'pve' to something else, let's say 'old'. Then, install a fresh PVE on your other disk. Create all VMs you had previously, make sure to exactly match the settings (especially related to disks - i.e. create disks with the same size on the new LVM, they will be empty at first).

Then, copy over the data from the old VMs into the new ones. Do this for every VM and every disk, for example:
Code:
dd if=/dev/mapper/old-vm--101--disk-0 of=/dev/mapper/pve-vm--101--disk-0 status=progress bs=4M
dd if=/dev/mapper/old-vm--101--disk-1 of=/dev/mapper/pve-vm--101--disk-1 status=progress bs=4M
 
Yes, you would have also needed to resize the ext4 (or xfs) filesystem residing on top of the LV. *Before* resizing that one.


First, rename the old VG from 'pve' to something else, let's say 'old'. Then, install a fresh PVE on your other disk. Create all VMs you had previously, make sure to exactly match the settings (especially related to disks - i.e. create disks with the same size on the new LVM, they will be empty at first).

Then, copy over the data from the old VMs into the new ones. Do this for every VM and every disk, for example:
Code:
dd if=/dev/mapper/old-vm--101--disk-0 of=/dev/mapper/pve-vm--101--disk-0 status=progress bs=4M
dd if=/dev/mapper/old-vm--101--disk-1 of=/dev/mapper/pve-vm--101--disk-1 status=progress bs=4M

Sorry, I want to confirm the meaning of the exact match setting. The hard disk must be the same size, and should the cpu memory be exactly the same?

I'm not sure about the exact information of cpu and memory old.
 
Sorry, I want to confirm the meaning of the exact match setting. The hard disk must be the same size, and should the cpu memory be exactly the same?

I'm not sure about the exact information of cpu and memory old.
CPU and memory should be fine to mismatch, but disk size, count and layout must match exactly.
 
When you use dd it doesn't use thin-provisioning, so even unused space in the volumes takes up space on the physical disk. You can try specifying conv=sparse at the end of the 'dd' command to skip copying unallocated areas. You'd need to remove the already copied data beforehand though, to free up space again.
 
OK,Thank you very much.

I also found that there is not enough space, delete a vm, dd again, the data can be restored to normal, is being restored.
 

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!