Debian 10 https://keopx.net/ es Exploring .img Files on Linux and create your custom one https://keopx.net/blog/exploring-img-files-linux-and-create-your-custom-one <span>Exploring .img Files on Linux and create your custom one</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>Discover the hidden secrets of a monolithic <code>.img</code> file</li> <li>Mount the partitions in an <code>.img</code> file using <code>losetup</code>, <code>kpartx</code> and <code>mount</code></li> <li>Create your own <code>.img</code> files and use them as virtual disks</li> <li>Write out your virtual disk image to a thumb drive (or any drive for that matter) for use later</li> </ul><h2>Install packages</h2> <p><code>$ sudo aptitude install kpartx xz-utils</code></p> <h2>Decompress image</h2> <p>Once its downloaded you will want to uncompress it with <code>xz --decompress</code>:</p> <p><code>$ xz --decompress Retrobro128KillerHomeConsole.img.img.xz</code></p> <h2>Mount image</h2> <p>We’re going to attach the image file to what is known as a <a href="https://web.archive.org/web/20210118104618/https://en.wikipedia.org/wiki/Loop_device">loopback device</a>.</p> <p><code>$ sudo losetup /dev/loop0 Retrobro128KillerHomeConsole.img</code></p> <p>Note: We used <code>/dev/loop0</code> in this example. If <code>/dev/loop0</code> wasn’t available to us (that is, it was already in use), we could have chosen <code>/dev/loop1</code>, etc.</p> <p><code>$ sudo losetup -a /dev/loop0: [65026]:28970069 (/home/keopx/Retrobro128KillerHomeConsole.img)</code></p> <p>Now <code>/dev/loop0</code> is attached. How about look at the partition table with <code>fdisk</code>?</p> <p><code>$ sudo fdisk -l /dev/loop0 Disco /dev/loop0: 119,8 GiB, 128579534848 bytes, 251131904 sectores Unidades: sectores de 1 * 512 = 512 bytes Tamaño de sector (lógico/físico): 512 bytes / 512 bytes Tamaño de E/S (mínimo/óptimo): 512 bytes / 512 bytes Tipo de etiqueta de disco: dos Identificador del disco: 0xf2d3cb4f Disposit. Inicio Comienzo Final Sectores Tamaño Id Tipo /dev/loop0p1 * 8192 124927 116736 57M e W95 FAT16 (LBA) /dev/loop0p2 124928 251131903 251006976 119,7G 83 Linux </code></p> <p>To see what <code>kpartx</code> <em>would</em> map, run it with the <code>-l</code> option:</p> <p><code>$ sudo kpartx -l /dev/loop0 loop0p1 : 0 116736 /dev/loop0 8192 loop0p2 : 0 251006976 /dev/loop0 124928</code></p> <p>Let’s go ahead and run it and add the maps:</p> <p><code>$ sudo kpartx -a /dev/loop0 </code></p> <p>Now you can see new devices on <strong>dolphin</strong>.</p> <p>Running a shell:</p> <p>Now that the partitions are mapped, let’s examine the filesystems on each partition with <code>file</code> and the <code>--special-files</code> and <code>--dereference</code> options.</p> <p><code>$ sudo file -sL /dev/mapper/loop0p1 /dev/mapper/loop0p1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, reserved sectors 4, root entries 512, Media descriptor 0xf8, sectors/FAT 116, sectors/track 32, heads 64, sectors 116736 (volumes &gt; 32 MB), serial number 0xb13de1e5, label: "boot ", FAT (16 bit)</code></p> <p><code>$ sudo file -sL /dev/mapper/loop0p2 /dev/mapper/loop0p2: Linux rev 1.0 ext4 filesystem data, UUID=c50e928e-5669-44d0-8e3c-a59d21ad3da2, volume name "retropie" (extents) (64bit) (large files) </code></p> <p>Now that we have our partitions mapped, we can mount them. Create two directories to serve as mountpoints:</p> <p><code>$ mkdir boot # We will mount the FAT partition here $ mkdir retropie # We will mount the ext4 partition here</code></p> <p>Once they are created, <code>mount</code> the filesystems (only system in my case).</p> <p><code>$ sudo mount /dev/mapper/loop0p2 retropie</code></p> <h2>Umount image</h2> <p>Once you are done and want to “let go” of the <code>.img</code> file, reverse the process with:</p> <p><code>$ sudo umount retropie $ sudo kpartx -d /dev/loop0 $ sudo losetup -d /dev/loop0</code></p> <p>Reference:</p> <ul><li><a href="https://web.archive.org/web/20210118104618/https://dev.iachieved.it/iachievedit/exploring-img-files-on-linux/">https://dev.iachieved.it/iachievedit/exploring-img-files-on-linux/</a></li> </ul></div> <span><span>keopx</span></span> <span><time datetime="2019-12-26T11:50:37+01:00" title="Jueves, Diciembre 26, 2019 - 11:50">Jue, 26/12/2019 - 11:50</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian-10" hreflang="es">Debian 10</a></div> <div class="field__item"><a href="/categoria/raspberry-pi" hreflang="es">Raspberry pi</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/bash" hreflang="es">bash</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=308&amp;2=field_comments&amp;3=comment" token="O6DJWUhWDSOQytsmVQ9idBx3ufl7Pw7sSFZCnZvlKQU"></drupal-render-placeholder> </div> </div> </section> Thu, 26 Dec 2019 10:50:37 +0000 keopx 308 at https://keopx.net Debian 10 Buster Killer 1535 wireless https://keopx.net/blog/debian-10-buster-killer-1535-wireless-0 <span>Debian 10 Buster Killer 1535 wireless</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Source list</h2> <p><code>vim /etc/apt/sources.list</code></p> <p><code>deb http://deb.debian.org/debian buster main contrib non-free deb-src http://deb.debian.org/debian buster main contrib non-free deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free deb http://deb.debian.org/debian buster-updates main contrib non-free deb-src http://deb.debian.org/debian buster-updates main contrib non-free deb http://deb.debian.org/debian buster-backports main contrib non-free deb-src http://deb.debian.org/debian buster-backports main contrib non-free</code></p> <h2>Install Killer 1535 wireless</h2> <p><code>apt-get update apt-get install firmware-atheros modprobe -r ath10k_pci &amp;&amp; modprobe ath10k_pci</code></p></div> <span><span>keopx</span></span> <span><time datetime="2019-07-31T11:49:36+02:00" title="Miércoles, Julio 31, 2019 - 11:49">Mié, 31/07/2019 - 11:49</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/wireless" hreflang="es">Wireless</a></div> <div class="field__item"><a href="/categoria/debian-10" hreflang="es">Debian 10</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/wireless" hreflang="es">Wireless</a></div> <div class="field__item"><a href="/tag/debian-10" hreflang="es">Debian 10</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=307&amp;2=field_comments&amp;3=comment" token="wOKF7PGJM0rAsVthP3CB6CJbW2yMj35ZM7lgtAhHerI"></drupal-render-placeholder> </div> </div> </section> Wed, 31 Jul 2019 09:49:36 +0000 keopx 307 at https://keopx.net Debian 10 Buster Killer 1535 wireless https://keopx.net/blog/debian-10-buster-killer-1535-wireless <span>Debian 10 Buster Killer 1535 wireless</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Source list</h2> <p><code>vim /etc/apt/sources.list</code></p> <p><code>deb http://deb.debian.org/debian buster main contrib non-free deb-src http://deb.debian.org/debian buster main contrib non-free deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free deb http://deb.debian.org/debian buster-updates main contrib non-free deb-src http://deb.debian.org/debian buster-updates main contrib non-free deb http://deb.debian.org/debian buster-backports main contrib non-free deb-src http://deb.debian.org/debian buster-backports main contrib non-free</code></p> <h2>Install Killer 1535 wireless</h2> <p><code>apt-get update apt-get install firmware-atheros modprobe -r ath10k_pci &amp;&amp; modprobe ath10k_pci</code></p></div> <span><span>keopx</span></span> <span><time datetime="2019-07-31T11:49:16+02:00" title="Miércoles, Julio 31, 2019 - 11:49">Mié, 31/07/2019 - 11:49</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/wireless" hreflang="es">Wireless</a></div> <div class="field__item"><a href="/categoria/debian-10" hreflang="es">Debian 10</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/wireless" hreflang="es">Wireless</a></div> <div class="field__item"><a href="/tag/debian-10" hreflang="es">Debian 10</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=306&amp;2=field_comments&amp;3=comment" token="42QT9JrWrEc_UDqgLKgc1xP-G36JGoUf5Zi2SjEYL1M"></drupal-render-placeholder> </div> </div> </section> Wed, 31 Jul 2019 09:49:16 +0000 keopx 306 at https://keopx.net Debian 10 Buster Intel 9260 wireless https://keopx.net/blog/debian-10-buster-intel-9260-wireless <span>Debian 10 Buster Intel 9260 wireless</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Source list</h2> <p><code>vim /etc/apt/sources.list</code></p> <p><code>deb http://deb.debian.org/debian buster main contrib non-free deb-src http://deb.debian.org/debian buster main contrib non-free deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free deb http://deb.debian.org/debian buster-updates main contrib non-free deb-src http://deb.debian.org/debian buster-updates main contrib non-free deb http://deb.debian.org/debian buster-backports main contrib non-free deb-src http://deb.debian.org/debian buster-backports main contrib non-free</code></p> <h2>Install Intel 9260 wireless</h2> <p><code>apt-get update apt-get install firmware-iwlwifi modprobe -r iwlwifi ; modprobe iwlwifi</code></p></div> <span><span>keopx</span></span> <span><time datetime="2019-07-31T11:47:48+02:00" title="Miércoles, Julio 31, 2019 - 11:47">Mié, 31/07/2019 - 11:47</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/wireless" hreflang="es">Wireless</a></div> <div class="field__item"><a href="/categoria/debian-10" hreflang="es">Debian 10</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/wireless" hreflang="es">Wireless</a></div> <div class="field__item"><a href="/tag/debian-10" hreflang="es">Debian 10</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=305&amp;2=field_comments&amp;3=comment" token="JwdtiyS9D-o5czOPW2dvf1jnhqc4L7a2E0F7-hlOCzA"></drupal-render-placeholder> </div> </div> </section> Wed, 31 Jul 2019 09:47:48 +0000 keopx 305 at https://keopx.net