Made an iso image

$ sudo dd if=/dev/mmcblk0 of=/home/alexandr/img.iso 

Further

 $ sudo mkdir /media/iso $ sudo modprobe loop $ sudo mount img.iso /media/iso -t iso9660 -o loop mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. $ file /home/alexandr/img.iso /home/alexandr/img.iso: DOS/MBR boot sector; partition 1 : ID=0x6, start-CHS (0x0,2,8), end-CHS (0x3bf,31,31), startsector 133, 3868539 sectors, extended partition table (last) $ sudo cat /var/log/syslog | grep 15: Feb 25 15:15:01 alexandr-aspire CRON[12842]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) Feb 25 15:15:35 alexandr-aspire smartd[2583]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 120 to 111 
  • @DmitriChubarov modprobe corrected. Feb 24 18:59:21 alexandr-aspire kernel: [24281.476760] ISOFS: Unable to identify CD $ - shaman888
  • mmcblk0 who is this? - andreymal
  • 2
    $ file /home/alexandr/img.iso to the question - aleksandr barakin
  • 2
    @andreymal, most likely an SD card. - don Rumata
  • one
    @DmitriChubarov, the author most likely does not understand the difference between the file system and the disk image. - 0andriy

2 answers 2

$ file /home/alexandr/img.iso
/home/alexandr/img.iso: DOS / MBR boot sector; partition 1: ID = 0x6, start-CHS (0x0,2,8), end-CHS (0x3bf, 31.31), startsector 133, 3868539 sectors, extended partition table (last)

the file program showed that the contents of the file begin with the “dos-ovsky” mbr containing (including) the partition table, the description of which is also given: one section is mentioned there.

this is the typical content of a block device. and to “get” to the mentioned section (in which, most likely, the file system is created), you can use, for example, the program kpartx :

 $ sudo kpartx -av /путь/к/файлу add map loop0p1 (254:2): 0 202752 linear /dev/loop0 2048 

an example of the program output is also shown, from which it is clear that the loop device /dev/loop0 involved, and the name of the only found section is associated with the name loop0p1 (which can be decoded as “loop0, partititon 1”).

the default is a symbolic link created in the /dev/mapper . and it can be used to mount (or create) a file system located in this section:

 $ sudo mount /dev/mapper/loop0p1 /куда-нибудь 

by the way:

  1. Copying files is much easier with the cp program:

     $ sudo cp /dev/mmcblk0 /путь/к/файлу 

    The dd program in this case will be like a “nailing microscope.”

  2. iso9660 is a file system. it is no more related to block devices (and their copies - “images”) than any other file system, i.e. no
  • I needed dd to safely work with the disk (file recovery) I copied the disk and I can work with it separately from the image - shaman888
  • cp is bad too, tar better, guess why. And for images for a long time there is bmap-tools . - 0andriy
  • Although you are right, by the way, a special case may be when the disk image and the image of the “partition” with FS are the same. - 0andriy
 sudo losetup -fv img.iso sudo kpartx -av /dev/loop0 

a source