0

When we have a .img file or similar with different partitions and we write this image to flash memory such as an SD card which has only one partition, how is the partitioning of the flash memory done? I use Win32DiscImager on Windows or the dd utility on Linux.

My understanding is that we must first create partitions using gparted or something similar before copying the file systems.

So how is that when we simply write this .img image to flash that it automatically creates the different partitions for us on the SD card?

My guess is that the flash memory controller on the SD card first looks at the image and sees how many partitions must be created and then modifies the partition table. Is this correct?

Engineer999
  • 3,683
  • 6
  • 33
  • 71

1 Answers1

1

Partitions are not magic. They're just a number of contiguous blocks on disk, as indicated by the partition table at the start of the disk. If your disk image contains a partition table, each partition in that table can contain its own filesystem.

MSalters
  • 173,980
  • 10
  • 155
  • 350