Ingo Weinmann
2023-Apr-24 06:56 UTC
[Libguestfs] Specify partition when using virt-customize --copy-in, copy file to boot partition
Using virt-customize of libguestfs, I can copy a file from the host to the root partition of an image like this: virt-customize -a 2023-02-21-raspios-bullseye-arm64-lite.img --copy-in cmdline.txt:/boot/ But the image also has a boot partition (FAT) and I want to copy that file to that partition instead. Is that possible using virt-customize? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20230424/49463ab8/attachment.htm>
Richard W.M. Jones
2023-Apr-24 11:59 UTC
[Libguestfs] Specify partition when using virt-customize --copy-in, copy file to boot partition
On Mon, Apr 24, 2023 at 08:56:45AM +0200, Ingo Weinmann wrote:> Using virt-customize of libguestfs, I can copy a file from the host to the root > partition of an image like this: > > virt-customize -a 2023-02-21-raspios-bullseye-arm64-lite.img --copy-in > cmdline.txt:/boot/ > > But the image also has a boot partition (FAT) and I want to copy that file to > that partition instead. Is that possible using virt-customize?It should be, depends where or if the FAT filesystem is mounted by virt-customize, which depends on the guest /etc/fstab. Anyway this is certainly possible using guestfish directly, eg if the FAT filesystem was the first partition on the first disk then: guestfish -a foo.img -m /dev/sda1 upload cmdline.txt /cmdline.txt See also: https://libguestfs.org/guestfs.3.html#uploading https://libguestfs.org/guestfish.1.html https://libguestfs.org/virt-copy-in.1.html Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html