I need to flash a Debian image to a micro SD card to use with a Raspberry Pi.
The micro SD Card (MSDC) I will use (16GB) already has Raspberry Pi OS flashed, and when I plug the MSDC into my laptop (dedicated MSD reader port), Qubes OS reports 3 Data (block) devices available.
When I attach boot and rootfs to a StandaloneVM, the output of sudo fdisk -l shows them mounted as /dev/xvdi and /dev/xvdj (attaching () is mounted as xvdi too).
I don’t know enough about writing OS images nor how Qubes deals with block devices and MSDC to know what exactly I have to attach and/or overwrite to put a new OS image on this MSDC.
I assume that p1 and p2 in the Qubes Devices are partitions. Also, when I attach boot or rootfs to any VM, then the () device is removed. Attaching () to any VM makes boot and rootfs unavailable.
Should I work with the () device and overwrite that, since it seems to represent almost all the MSDC? I don’t want to mess up some partitioning system and make more problems for recognizing the MSDC.
I can’t seem to find the MSDC in sys-usb. Do non-usb devices like micro SD cards appear in sys-usb? Running sudo fdisk -l doesn’t show the MSDC, and there’s no /dev/xvdi or the like.
I might try overwriting the () device and see if that works.
Edit: it seems that attaching () to a VM also attaches the boot and rootfs partitions to that VM, which may be why those partitions disappear from dom0.
mmcblk0 is your disk (micro SD disk), which contains two partitions as you already understood (p1 and p2). lsblk will list all the disks (and so the attached mmcblk0) and the partitions. This command shows all the block devices, with an understandable tree.
Then you will use the standard flash commands used on all other Gnu/Linux OSes (dd ... if=my.iso of=/dev/mmcblk0 ..., cp my.iso /dev/mmcblk0, cat ..., …).