Introducing Local File As Block Device

Here we show how to inspect images presented as files with .img extension. As ‘img’ extension does not always dictate type of file it may not always work. One good indicator that it’s usable as shown here is that if it is used to write to USB stick of MicroSD card,.

sudo losetup --partscan -f  <image>
# Example:
sudo losetup --partscan -f  Orangepi5b_1.0.2_ubuntu_focal_server_linux5.10.110.img

In my case, the device was mounted to loop55, and it’s shown in lsblk as this:

loop55        7:55   0   8,2G  0 loop 
├─loop55p1  259:4    0     1G  0 part 
└─loop55p2  259:5    0   7,1G  0 part 

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *