lxc export is not working for me and because it’s production I don’t want to make any changes or restart until I have a backup. I decided to do a zfs send and receive to another machine, but can’t do a import there because the destination storage pool has a different name.
I tried to edit the backup.yaml but it’s read-only. If I used yq it says the file doesn’t exist (see below). How can I make this file readable? I never used nsenter before, and I noticed yq is not a recognised command when I am inside nsenter. How do I make yq visible inside the namespace?
Last attempt I did something like this:
nsenter -t $(cat /var/snap/lxd/common/lxd.pid) -m mkdir /var/snap/lxd/common/lxd/storage-pools/local/containers/my-container mount -t zfs my-pool/my-dataset/my-container /var/snap/lxd/common/lxd/storage-pools/local/containers/my-container
I tried without nsenter, but import simply says it doesn’t exist. When I use nsenter to mount the dataset zfs received at least import says the storage name is different (local <> default) so I kept using nsenter.
I also tried to mount inside and outside that nsenter because the folder is empty when I leave. Or mount in a different path when I was outside nsenter. Nothing allowed me to change backup.yaml.
I don’t understand ns well.
cat /var/snap/lxd/common/lxd/storage-pools/local/containers/my-container/backup.yaml | yq e '.pool.config.source' -
This say file (that has just been read) does not exist:
yq e '.pool.config.source = "my-pool/my-dataset"' /var/snap/lxd/common/lxd/storage-pools/local/containers/my-container/backup.yaml
Can someone help please? Thanks!
Both servers have the latest version (4.20) snap keeps it updated).