[Libguestfs] Specify partition when using virt-customize --copy-in, copy file to boot partition

Richard W.M. Jones rjones at redhat.com
Mon Apr 24 11:59:27 UTC 2023


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


More information about the Libguestfs mailing list