systemd / casync

Content-Addressable Data Synchronization Tool
1.51k stars 117 forks source link

CASync Image Sync in initramfs #137

Open michaelbaecker opened 6 years ago

michaelbaecker commented 6 years ago

Hello, this is a more complicated Issue. Let me explain, what we want to do:

Now we want to include the binary casync to the initrd, but this doesn't seem to work. We copied the binary casync, the needed libraries (as stated from ldd casync) to the initrd. Also we copied the directory /usr/lib/casync/protocols

When executing casync we get an error:

casync -v  extract http://webserver/ubuntu/index.caidx /tmp/
Failed to run synchronizer: No such file or directory

"wget"ing the file works.

Can you help us? Thanks in advance.

Michael

aetchevarne commented 6 years ago

I think that you should create a '/var/tmp' directory, preferably on a disk. The error could be more clear, though

garyvdm commented 4 years ago

I'm doing this from a dracut initrd, and it's working fine:

casync extract http://192.168.76.2:8765/boot_fs/dev/boot_fs.caibx /dev/disk/by-partlabel/boot

Like aetchevarne said, the error might be saying that the directory you are trying to extract to, /tmp/, might not exist.

On most systems, /tmp/ is only mounted by the real init, and not in the initrd. If you want to extract to /tmp/, you will need to mount a tmpfs to there your self in the initrd, but I would guess that is not what you really want to do as that will use up your ram. I'm guessing you want to write it to a disk instead.