Flashing Debian Image on SD card Partition

15 views
Skip to first unread message

Sharvin Shah

unread,
Feb 22, 2019, 7:38:05 AM2/22/19
to BeagleBoard

I have an sd card with 2 Partitions. mmcblk0 is the disk and mmcblk0p1mmcblk0p2 are the 2 partitions I have created.

I am trying to flash the Debian OS on the Partition using the dd command.

dd if=os.img bs=10M of=/dev/mmcblk0p1

I am getting the following output

3565158400 bytes (3.6 GB, 3.3 GiB) copied, 297 s, 12.0 MB/s 106+1 records in 106+1 records out 3565158400 bytes (3.6 GB, 3.3 GiB) copied, 296.587 s, 12.0 MB/s

Now when I try to mount the partition using mount -t auto /dev/mmcblk0p1 mydir

I am getting the following error:

mount: wrong fs type, bad option, bad superblock on /dev/mmcblk0p1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.

My dmesg | tail Output:

[ 856.292964] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0) [ 856.292983] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 1th superblock [ 856.305466] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0) [ 856.305483] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 2th superblock [ 856.315244] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0) [ 856.315256] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 1th superblock [ 856.324437] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)Units: sectors of 1 * 512 = 512 bytes

Even I am not able to boot from the partition.

But if I try the dd command on mmcblk0 disk it is working perfectly. I am able to mount and boot.

According to my understanding, Linux OS is designed to be installed on a disk, not on a partition and dd is to be used for the flashing on the disk.

I want to write a Debian image on a Partition mmcblk0p1 using a command line tool. How can I achieve this?

I tried dd, pv, cat, cp, ddsd, Dcfldd But ended up with the same result.

Tarmo Kuuse

unread,
Feb 22, 2019, 9:24:07 AM2/22/19
to BeagleBoard
Hi Sharvin,
You haven't specified which Debian image you're using. It likely is built with an included partition table and therefore needs to be written to the disk raw.

If the partition scheme on the pre-built image doesn't suit your needs, I'd try to find a way to re-build the image according to your partitioning requirements. I haven't done this myself, but perhaps this is a good place to start: https://elinux.org/BeagleBoneBlack_Rebuild_Debian_Image_Using_image-builder

--
Kind regards,
Tarmo
Reply all
Reply to author
Forward
0 new messages