• Possible to mount the Pi OS .img file using loopback?

    From Adam Funk@3:770/3 to All on Wed Oct 18 13:29:50 2023
    Hi

    I've downloaded 2023-10-10-raspios-bookworm-armhf.img.xz, used unxz to
    extract the .img file, and I'm trying to mount it so I can have a look
    at some of the files in it. I was trying to avoid having to write the
    image to an SD card.

    $ file 2023-10-10-raspios-bookworm-armhf.img 2023-10-10-raspios-bookworm-armhf.img: DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x40,0,1), end-CHS (0x3ff,3,32), startsector 8192, 1048576 sectors; partition 2 : ID=0x83, start-CHS (0x3ff,3,32), end-CHS (0x3ff,3,32), startsector 1056768,
    9297920 sectors

    $ sudo losetup -f --show 2023-10-10-raspios-bookworm-armhf.img
    /dev/loop0

    $ sudo mount -t auto /dev/loop0 /mnt/image/
    mount: /mnt/image: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.

    I thought these image files were supposed to contain mountable
    filesystems, and I'm (almost) sure I've done this before with raspbian
    and Ubuntu images --- am I doing something wrong above?


    --
    Civilization is a race between catastrophe and education.
    ---H G Wells

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Theo@3:770/3 to Adam Funk on Wed Oct 18 14:18:52 2023
    Adam Funk <a24061@ducksburg.com> wrote:
    Hi

    I've downloaded 2023-10-10-raspios-bookworm-armhf.img.xz, used unxz to extract the .img file, and I'm trying to mount it so I can have a look
    at some of the files in it. I was trying to avoid having to write the
    image to an SD card.

    $ file 2023-10-10-raspios-bookworm-armhf.img 2023-10-10-raspios-bookworm-armhf.img: DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x40,0,1), end-CHS (0x3ff,3,32), startsector 8192, 1048576 sectors; partition 2 : ID=0x83, start-CHS (0x3ff,3,32), end-CHS (0x3ff,3,32), startsector 1056768,
    9297920 sectors

    $ sudo losetup -f --show 2023-10-10-raspios-bookworm-armhf.img
    /dev/loop0

    $ sudo mount -t auto /dev/loop0 /mnt/image/
    mount: /mnt/image: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.

    I thought these image files were supposed to contain mountable
    filesystems, and I'm (almost) sure I've done this before with raspbian
    and Ubuntu images --- am I doing something wrong above?

    The image file has multiple partitions, so you need to mount the partitions within the image, not the raw image itself. You either need:

    $ sudo losetup -f -P --show 2023-10-10-raspios-bookworm-armhf.img

    and you'll get devices per partition: /dev/loop0p1, loop0p2, etc

    or, on an existing loopback device,

    $ sudo partprobe /dev/loop0

    and it'll create the partition devices.
    Then you can mount them:

    $ sudo mkdir -p /mnt/boot /mnt/root
    $ sudo mount /dev/loop0p1 /mnt/boot
    $ sudo mount /dev/loop0p2 /mnt/root

    Theo

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Adam Funk@3:770/3 to Theo on Wed Oct 18 14:48:44 2023
    On 2023-10-18, Theo wrote:

    Adam Funk <a24061@ducksburg.com> wrote:
    Hi

    I've downloaded 2023-10-10-raspios-bookworm-armhf.img.xz, used unxz to
    extract the .img file, and I'm trying to mount it so I can have a look
    at some of the files in it. I was trying to avoid having to write the
    image to an SD card.

    $ file 2023-10-10-raspios-bookworm-armhf.img
    2023-10-10-raspios-bookworm-armhf.img: DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x40,0,1), end-CHS (0x3ff,3,32), startsector 8192, 1048576 sectors; partition 2 : ID=0x83, start-CHS (0x3ff,3,32), end-CHS (0x3ff,3,32), startsector 1056768,
    9297920 sectors

    $ sudo losetup -f --show 2023-10-10-raspios-bookworm-armhf.img
    /dev/loop0

    $ sudo mount -t auto /dev/loop0 /mnt/image/
    mount: /mnt/image: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.

    I thought these image files were supposed to contain mountable
    filesystems, and I'm (almost) sure I've done this before with raspbian
    and Ubuntu images --- am I doing something wrong above?

    The image file has multiple partitions, so you need to mount the partitions within the image, not the raw image itself. You either need:

    $ sudo losetup -f -P --show 2023-10-10-raspios-bookworm-armhf.img

    and you'll get devices per partition: /dev/loop0p1, loop0p2, etc

    or, on an existing loopback device,

    $ sudo partprobe /dev/loop0

    and it'll create the partition devices.
    Then you can mount them:

    $ sudo mkdir -p /mnt/boot /mnt/root
    $ sudo mount /dev/loop0p1 /mnt/boot
    $ sudo mount /dev/loop0p2 /mnt/root

    Brilliant, thanks very much!


    --
    The internet is quite simply a glorious place. Where else can you find bootlegged music and films, questionable women, deep seated xenophobia
    and amusing cats all together in the same place? ---Tom Belshaw

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Adam Funk@3:770/3 to Charlie Gibbs on Thu Oct 19 13:39:12 2023
    On 2023-10-18, Charlie Gibbs wrote:

    On 2023-10-18, Adam Funk <a24061@ducksburg.com> wrote:

    The internet is quite simply a glorious place. Where else can you find
    bootlegged music and films, questionable women, deep seated xenophobia
    and amusing cats all together in the same place? ---Tom Belshaw

    Nice .sig. See below for my version.

    --
    /~\ Charlie Gibbs | The Internet is like a big city:
    \ / <cgibbs@kltpzyxm.invalid> | it has plenty of bright lights and
    X I'm really at ac.dekanfrus | excitement, but also dark alleys
    / \ if you read it the right way. | down which the unwary get mugged.

    Thanks. Can I add yours to my file, and should I attribute it to you?



    --
    Well, I sort of don’t trust anybody who doesn’t like
    Led Zeppelin. (Jack White)

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Charlie Gibbs@3:770/3 to Adam Funk on Thu Oct 19 17:56:30 2023
    On 2023-10-19, Adam Funk <a24061@ducksburg.com> wrote:

    On 2023-10-18, Charlie Gibbs wrote:

    On 2023-10-18, Adam Funk <a24061@ducksburg.com> wrote:

    The internet is quite simply a glorious place. Where else can you find
    bootlegged music and films, questionable women, deep seated xenophobia
    and amusing cats all together in the same place? ---Tom Belshaw

    Nice .sig. See below for my version.

    --
    /~\ Charlie Gibbs | The Internet is like a big city:
    \ / <cgibbs@kltpzyxm.invalid> | it has plenty of bright lights and
    X I'm really at ac.dekanfrus | excitement, but also dark alleys
    / \ if you read it the right way. | down which the unwary get mugged.

    Thanks. Can I add yours to my file, and should I attribute it to you?

    Sure, as long as the attribution is kept.

    --
    /~\ Charlie Gibbs | Microsoft is a dictatorship.
    \ / <cgibbs@kltpzyxm.invalid> | Apple is a cult.
    X I'm really at ac.dekanfrus | Linux is anarchy.
    / \ if you read it the right way. | Pick your poison.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Adam Funk@3:770/3 to Charlie Gibbs on Fri Oct 20 16:01:44 2023
    On 2023-10-19, Charlie Gibbs wrote:

    On 2023-10-19, Adam Funk <a24061@ducksburg.com> wrote:

    On 2023-10-18, Charlie Gibbs wrote:

    On 2023-10-18, Adam Funk <a24061@ducksburg.com> wrote:

    The internet is quite simply a glorious place. Where else can you find >>>> bootlegged music and films, questionable women, deep seated xenophobia >>>> and amusing cats all together in the same place? ---Tom Belshaw

    Nice .sig. See below for my version.

    --
    /~\ Charlie Gibbs | The Internet is like a big city:
    \ / <cgibbs@kltpzyxm.invalid> | it has plenty of bright lights and >>> X I'm really at ac.dekanfrus | excitement, but also dark alleys
    / \ if you read it the right way. | down which the unwary get mugged.

    Thanks. Can I add yours to my file, and should I attribute it to you?

    Sure, as long as the attribution is kept.

    Thanks! (I changed it to my usual sig format.)


    --
    The Internet is like a big city: it has plenty of bright lights and
    excitement, but also dark alleys down which the unwary get mugged.
    (Charlie Gibbs)

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)