making one disk image from two
Polytropon
freebsd at edvax.de
Fri Jan 8 03:21:24 UTC 2021
On Thu, 7 Jan 2021 13:07:21 -0700, @lbutlr wrote:
> On 07 Jan 2021, at 07:03, tech-lists <tech-lists at zyxst.net> wrote:
> > If one were to make say a 16GB image, format it to msdos, then
> > make a 64GB image, format it to freebsd, then concatenate[1] the
> > images to make one image, would it be seen as one image with two
> > partitions?
>
> You would have to make a partitioned image first, then write your
> 16GB to one partition¹ and your 64GB to the other partition.
>
> > [1] # cat freebsd.img >> msdos.img
>
> If you were very lucky, that would still be a msdos bootable image.
> Otherwise, it would be garbage.
>
> ¹ Or perhaps volumes or containers, depending on the disk format.
It has not been a requirement that the image is bootable. If it is
just a disk image, which _can_ contain a partitioning scheme, and
within that, define one or more partitions, then the situation would
probably be equivalent to doing this to a real disk instead of to an
image file: The partition table indicates one partition type FAT,
which follows, and then, there is some other data in unallocated
disk space, i. e., the FreeBSD part will probably be ignored as
the partition table (at the beginning of the FAT image part) does
not state its existence.
So the idea of preparing a partitioned image file and then bringing
the partions' contents into those allocated partitions probably is
the best way to go. If the requirement of being bootable is added,
this will result in further steps affecting the "MBR part" of the
disk image (or GPT, or UEFI, depending scope).
Note that dedicated disk images only contain filesystems, but no
partitioning information at all. However, concatenating those also
is not easily possible.
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions
mailing list