Step 4 : Mount the image ========================== .. tab-set:: .. tab-item:: Mount the image * In this program, you are going to learn .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow * How to ? .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Mount the image ` .. _barelinux_qemu_rpi4b_step4_0: .. tab-set:: .. tab-item:: Mount the image * Get the correct offset value using fdisk command .. code-block:: c test:_qemu_rpi4b_linux$ fdisk -l 2023-12-05-raspios-bullseye-arm64.img Disk 2023-12-05-raspios-bullseye-arm64.img: 4.25 GiB, 4563402752 bytes, 8912896 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xcd9d3b46 Device Boot Start End Sectors Size Id Type 2023-12-05-raspios-bullseye-arm64.img1 8192 532479 524288 256M c W95 FAT32 (LBA) 2023-12-05-raspios-bullseye-arm64.img2 532480 8912895 8380416 4G 83 Linux * Mount the image in /mnt/rpi directory. .. code-block:: c $ sudo mkdir /mnt/rpi $ sudo mount -o loop,offset=4194304 2023-12-05-raspios-bullseye-arm64.img /mnt/rpi * Create a file name ssh to enable ssh. .. code-block:: c $ cd /mnt/rpi $ sudo touch ssh * Create a userconf.txt to store the credentials. .. code-block :: c $ sudo touch userconf.txt * Create the username and password the OS using openssl command. .. code-block:: c test:~$ openssl passwd -6 Password: Verifying - Password: $6$9HzsE8vYjPJWtvGf$mLbbuPcdNjWwYeJz3avtblgJR4R/kP72J8xVIitu7AMmnfoaMuZn1KkgKFs5Bg38da50z.Euh7YpjK5Zo.0bp1 * add the credentials in the userconf.txt .. code-block:: c $ echo pi:$6$9HzsE8vYjPJWtvGf$mLbbuPcdNjWwYeJz3avtblgJR4R/kP72J8xVIitu7AMmnfoaMuZn1KkgKFs5Bg38da50z.Euh7YpjK5Zo.0bp1 | sudo tee userconf.txt * go to the directory qemu_rpi_3b and umount the image. .. code-block:: c $ cd $HOME/qemu_rpi_3b $ sudo umount /mnt/rpi