Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Hello," he lied. -- Don Carpenter, quoting a Hollywood agent


aus+uk / uk.comp.os.linux / Re: How do I get two loop devices at the same time?

SubjectAuthor
* How do I get two loop devices at the same time?Chris Green
`* Re: How do I get two loop devices at the same time?Andrzej Adam Filip
 +- Re: How do I get two loop devices at the same time?Andy Burns
 `* Re: How do I get two loop devices at the same time?Chris Green
  `* Re: How do I get two loop devices at the same time?Chris Green
   `- Re: How do I get two loop devices at the same time?Andy Burns

1
How do I get two loop devices at the same time?

<0b9nth-j9d4.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/aus+uk/article-flat.php?id=312&group=uk.comp.os.linux#312

  copy link   Newsgroups: uk.comp.os.linux
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: uk.comp.os.linux
Subject: How do I get two loop devices at the same time?
Date: Tue, 3 Aug 2021 08:54:40 +0100
Lines: 12
Message-ID: <0b9nth-j9d4.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net Ibvw2spVQ1V5e4gl37OrJQO3I0cqULTQnpUOlyJ4ADosf4OZ0=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:0uX7G5vUVReDFOcgqrkehDkhkxw=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-25-generic (x86_64))
 by: Chris Green - Tue, 3 Aug 2021 07:54 UTC

I want to mount both partitions of a .img disk image file at the same
time, by default 'mount -o ....' uses the same loop device so on
trying to mount the second partition one sees:-

mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.

How do I crete a second loop device and get mount to use it?

--
Chris Green
·

Re: How do I get two loop devices at the same time?

<anfi+ylk4qok0sf-l832@wp.eu>

  copy mid

https://www.novabbs.com/aus+uk/article-flat.php?id=313&group=uk.comp.os.linux#313

  copy link   Newsgroups: uk.comp.os.linux
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: anf...@onet.eu (Andrzej Adam Filip)
Newsgroups: uk.comp.os.linux
Subject: Re: How do I get two loop devices at the same time?
Date: Tue, 03 Aug 2021 09:18:56 +0100 (BST)
Organization: It is for me to know and for you to find out.
Lines: 16
Message-ID: <anfi+ylk4qok0sf-l832@wp.eu>
References: <0b9nth-j9d4.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="e6dbebebda85316ff79f93a57cc95b34";
logging-data="31372"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vnnjvurbHK5Ja4wnFKZMK"
Cancel-Lock: sha1:iXkhgszGpQ6LvPCWkonOD/UB7bI=
sha1:7JKOgfnyDZua0borwA5jFytby14=
 by: Andrzej Adam Filip - Tue, 3 Aug 2021 08:18 UTC

Chris Green <cl@isbd.net> wrote:
> I want to mount both partitions of a .img disk image file at the same
> time, by default 'mount -o ....' uses the same loop device so on
> trying to mount the second partition one sees:-
>
> mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.
>
> How do I crete a second loop device and get mount to use it?

According to "man mount" (on my comp)
'mount -o loop' (no explicit loop device) should try to find/use
unused loop device. Alternatively you may use
'mount -o loop=…' to explicitly name loop device.

--
[Andrew] Andrzej A. Filip

Re: How do I get two loop devices at the same time?

<imsd34F7d1cU2@mid.individual.net>

  copy mid

https://www.novabbs.com/aus+uk/article-flat.php?id=314&group=uk.comp.os.linux#314

  copy link   Newsgroups: uk.comp.os.linux
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: use...@andyburns.uk (Andy Burns)
Newsgroups: uk.comp.os.linux
Subject: Re: How do I get two loop devices at the same time?
Date: Tue, 3 Aug 2021 09:29:23 +0100
Lines: 20
Message-ID: <imsd34F7d1cU2@mid.individual.net>
References: <0b9nth-j9d4.ln1@esprimo.zbmc.eu> <anfi+ylk4qok0sf-l832@wp.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net bueeGN1NlY9upftrFoSJkw4hHOYMGM0LOD+VhTwbePFU6CG4WF
Cancel-Lock: sha1:VYKH996/MKrQ88x4iTIzJN7JZPQ=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
In-Reply-To: <anfi+ylk4qok0sf-l832@wp.eu>
Content-Language: en-GB
 by: Andy Burns - Tue, 3 Aug 2021 08:29 UTC

Andrzej Adam Filip wrote:

> Chris Green <cl@isbd.net> wrote:
>
>> I want to mount both partitions of a .img disk image file at the same
>> time, by default 'mount -o ....' uses the same loop device so on
>> trying to mount the second partition one sees:-
>>
>> mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.
>>
>> How do I crete a second loop device and get mount to use it?
>
> According to "man mount" (on my comp)
> 'mount -o loop' (no explicit loop device) should try to find/use
> unused loop device. Alternatively you may use
> 'mount -o loop=…' to explicitly name loop device.

or try losetup, long time since I needed it.

Re: How do I get two loop devices at the same time?

<kednth-ggk4.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/aus+uk/article-flat.php?id=315&group=uk.comp.os.linux#315

  copy link   Newsgroups: uk.comp.os.linux
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: uk.comp.os.linux
Subject: Re: How do I get two loop devices at the same time?
Date: Tue, 3 Aug 2021 10:04:52 +0100
Lines: 44
Message-ID: <kednth-ggk4.ln1@esprimo.zbmc.eu>
References: <0b9nth-j9d4.ln1@esprimo.zbmc.eu> <anfi+ylk4qok0sf-l832@wp.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 9RRaP1XgVEA04mh2qefAKgx+nNZmN0XE+dRfFRA44CYPRiB98=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:mRfBi1yTBf1X2qdUQ2Cl3axvJuM=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-25-generic (x86_64))
 by: Chris Green - Tue, 3 Aug 2021 09:04 UTC

Andrzej Adam Filip <anfi@onet.eu> wrote:
> Chris Green <cl@isbd.net> wrote:
> > I want to mount both partitions of a .img disk image file at the same
> > time, by default 'mount -o ....' uses the same loop device so on
> > trying to mount the second partition one sees:-
> >
> > mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.
>
>
> >
> > How do I crete a second loop device and get mount to use it?
>
> According to "man mount" (on my comp)
> 'mount -o loop' (no explicit loop device) should try to find/use
> unused loop device. Alternatively you may use
> 'mount -o loop=…' to explicitly name loop device.
>
That doesn't seem to work though:-

root@t470# fdisk -l 2021-05-07-raspios-buster-armhf-lite.img
Disk 2021-05-07-raspios-buster-armhf-lite.img: 1.75 GiB, 1874853888 bytes, 3661824 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: 0x9730496b

Device Boot Start End Sectors Size Id Type
2021-05-07-raspios-buster-armhf-lite.img1 8192 532479 524288 256M c W95 FAT32 (LBA)
2021-05-07-raspios-buster-armhf-lite.img2 532480 3661823 3129344 1.5G 83 Linux
root@t470# mkdir -p /tmp/boot
root@t470# mkdir -p /tmp/rootfs
root@t470# mount -o loop,offset=$((8192 * 512)) 2021-05-07-raspios-buster-armhf-lite.img /tmp/boot
root@t470# mount -o loop,offset=$((532480 * 512)) 2021-05-07-raspios-buster-armhf-lite.img /tmp/rootfs
mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/pi/2021-05-07-raspios-buster-armhf-lite.img.
root@t470#

--
Chris Green
·

Re: How do I get two loop devices at the same time?

<jphnth-ir7.ln1@esprimo.zbmc.eu>

  copy mid

https://www.novabbs.com/aus+uk/article-flat.php?id=316&group=uk.comp.os.linux#316

  copy link   Newsgroups: uk.comp.os.linux
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl...@isbd.net (Chris Green)
Newsgroups: uk.comp.os.linux
Subject: Re: How do I get two loop devices at the same time?
Date: Tue, 3 Aug 2021 11:18:59 +0100
Lines: 63
Message-ID: <jphnth-ir7.ln1@esprimo.zbmc.eu>
References: <0b9nth-j9d4.ln1@esprimo.zbmc.eu> <anfi+ylk4qok0sf-l832@wp.eu> <kednth-ggk4.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net v3xpHiYFcWpSTIyQ4sQmgA4+rTtO8rpO72TlO87tPW5SlX09Q=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:PXyP2C+PFCjukngfjL0sGIH5j44=
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.11.0-25-generic (x86_64))
 by: Chris Green - Tue, 3 Aug 2021 10:18 UTC

Chris Green <cl@isbd.net> wrote:
> Andrzej Adam Filip <anfi@onet.eu> wrote:
> > Chris Green <cl@isbd.net> wrote:
> > > I want to mount both partitions of a .img disk image file at the same
> > > time, by default 'mount -o ....' uses the same loop device so on
> > > trying to mount the second partition one sees:-
> > >
> > > mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.
>
> > ^M
> >
> > >
> > > How do I crete a second loop device and get mount to use it?
> >
> > According to "man mount" (on my comp)
> > 'mount -o loop' (no explicit loop device) should try to find/use
> > unused loop device. Alternatively you may use
> > 'mount -o loop=…' to explicitly name loop device.
> >
> That doesn't seem to work though:-
>
> root@t470# fdisk -l 2021-05-07-raspios-buster-armhf-lite.img
> Disk 2021-05-07-raspios-buster-armhf-lite.img: 1.75 GiB, 1874853888 bytes, 3661824 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: 0x9730496b
>
> Device Boot Start End Sectors Size Id Type
> 2021-05-07-raspios-buster-armhf-lite.img1 8192 532479 524288 256M c W95 FAT32 (LBA)
> 2021-05-07-raspios-buster-armhf-lite.img2 532480 3661823 3129344 1.5G 83 Linux
> root@t470# mkdir -p /tmp/boot
> root@t470# mkdir -p /tmp/rootfs
> root@t470# mount -o loop,offset=$((8192 * 512)) 2021-05-07-raspios-buster-armhf-lite.img
> /tmp/boot
> root@t470# mount -o loop,offset=$((532480 * 512)) 2021-05-07-raspios-buster-armhf-lite.img
> /tmp/rootfs
> mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/pi/2021-05-07-raspios-buster-armhf-lite.img.
>
> root@t470#
>
I found the answer (well, an answer), you need to limit the size of
the first mount so (as the error message tells you) it doesn't overlap
the second mount.

The fdisk output shows the size, so the first mount needs to be:-

mount -o loop,offset=$((532480 * 512)),sizelimit=256M 2021-05-07-raspios-buster-armhf-lite.img

then the second one works OK with no error.

Alternatively you can install kpartx and run:-

kpartx -av 2021-05-07-raspios-buster-armhf-lite.img

which does (almost) everything in one go, the partitions then get
automounted.

--
Chris Green
·

Re: How do I get two loop devices at the same time?

<imsof2F9j1qU2@mid.individual.net>

  copy mid

https://www.novabbs.com/aus+uk/article-flat.php?id=327&group=uk.comp.os.linux#327

  copy link   Newsgroups: uk.comp.os.linux
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: use...@andyburns.uk (Andy Burns)
Newsgroups: uk.comp.os.linux
Subject: Re: How do I get two loop devices at the same time?
Date: Tue, 3 Aug 2021 12:43:28 +0100
Lines: 5
Message-ID: <imsof2F9j1qU2@mid.individual.net>
References: <0b9nth-j9d4.ln1@esprimo.zbmc.eu> <anfi+ylk4qok0sf-l832@wp.eu>
<kednth-ggk4.ln1@esprimo.zbmc.eu> <jphnth-ir7.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 5TsPV93s4kLxNq4qUMoJ6A2DCPxEXCd3yZt+bBjCphpawi33BX
Cancel-Lock: sha1:OL8L1uTjwZ1zCesVS64gg3ACYAY=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
In-Reply-To: <jphnth-ir7.ln1@esprimo.zbmc.eu>
Content-Language: en-GB
 by: Andy Burns - Tue, 3 Aug 2021 11:43 UTC

Chris Green wrote:

> Alternatively you can install kpartx

Yes, I used to find that handy when using Xen VMs with LVM for storage.


aus+uk / uk.comp.os.linux / Re: How do I get two loop devices at the same time?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor