Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between reading from /dev/block/mmcblk0 and /dev/block/mmcblk0p1

Reading from /dev/block/mmcblk0 returned old data while reading from /dev/block/mmcblk0p1 gave latest data. My question is does linux maintain a back up if data is written to /dev/block/mmcblk0? This is because i was able to read old contents of the SD card by reading through that node.

like image 457
spitfire88 Avatar asked Sep 11 '12 09:09

spitfire88


1 Answers

The mmc sub-system in the Linux kernel registers device nodes of the format mmcblkXpY.

  • Each mmc device registered within the Linux kernel receives it own mmc device number X.
  • Each partition on a particular device receives it own number Y

Normal file I/O can be performed after mounting a device node pointing to a partition.

Also note that unless a valid partition table is present on the /dev/mmcblkX device, there will be no subsequent /dev/mmcblkXpY nodes on the system.

like image 165
TheCodeArtist Avatar answered Oct 01 '22 19:10

TheCodeArtist