How to copy vm-disk on zfs pool like a file

tedxuyuan

Active Member
Jun 24, 2018
8
1
43
40
After proxmox boot error, I learned how to access the vm-disk on zfs pool.
Thanks @mailinglists
https://forum.proxmox.com/threads/how-to-recovery-files-in-vm-disk-on-zfs-pool.52052/

But I want to know, is there a easily way to copy the vm-disk to another server? Also a block storage question.
Hope a step by step training, thanks.

By the way, if proxmox can not boot, and can sure zfs zpool status is ok. Can i just reinstall proxmox on the same harddisk with the same zfs option like before, is this will reformat the disk? or proxmox just fix the boot error and system error?
 
You're welcome. Give me a few likes, if you like. :)

If you can get the network running or if you can just attach new storage, you can use zfs send | zfs receive to copy / migrate the datasets or. zvols.
If there is not ZFS on the receiving end, you could use dd or cat (possible with nc / netcat) for ZVOLS and save them to file.raw, as they are in RAW format, that can be run via KVM elsewhere. I think you can google for step by step examples.

If you do not overwrite the data pool, you will keep the data, but if your data pool is named rpool, it will conflict with proxmox installer which might overwrite all your data if they use zpool creation with -f flag by default.
PM installer is dumb and will not allow you to recover / repair. You have to fix your non bootable system by hand. Sometimes I run the installer in debug mode, then exit it and use that environment to fix things. Or you could use Ubuntu, supposedly it has ZFS support in in.
 
As you said, proxmox installer create a rpool by default.
So I think if could rename the old rpool to another pool name, and reinstall proxmox? So the proxmox can recognize 2 zfs pool?
Is there such a command to rename zfs zool?

What is the fast and best way to recovery a proxmox server when it down without hardware error?
 
You could rename the pool by importing it with a different name (first hit on google):
https://prefetch.net/blog/2006/11/15/renaming-a-zfs-pool/

I never have had to recover the install yet, so I have not tried.
If I just needed a rollback to my previous snapshot of pve-1 dataset (in case of a botched update install), I would probably boot from Ubuntu iso (or PM installer in debug mode after quitting the installer), import a pool and do a zfs rollback, or do reinstall using the installer but, then do zfs send | zfs receive from my backup node for the pve-1 root dataset.
 
By the way, if proxmox can not boot, and can sure zfs zpool status is ok

Hi,

If your zfs pool is ok, but your server is not able to boot, could be only the fact that your disks show for the grub too late(a) or maybe could be only a grub problem(b).

In more that 6 month I see only (a) case. After I change the grub timeout to 12 sec I do not have any problems. In the (b) case you can reinstall grub.

When I start to use pmx, I have think that zfs boot could be a problem. So I decided for some nodes to use a dedicated ssd tor proxmox only(without zfs). And the zfs pool was on separate disks. So in case of ssd is broken, I can restore the data using a clonezilla image on a new ssd. Then after that I can import the zfs pool.


Good luck.
 

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!