* mount loop devices not works in schroot
@ 2024-01-18 7:16 Srinuvasan Arjunan
2024-01-18 7:56 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Srinuvasan Arjunan @ 2024-01-18 7:16 UTC (permalink / raw)
To: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 903 bytes --]
Hi All,
Presently we migrated the chroot to sbuildchroot and one of my
image creation part i try to mount some temporary file system as a loop
device and do create volumes and other stuffs.
Here i could see am not able to mount the file system as a loop device
specifically in chroot.
reproduce steps:
1. chroot into the created session
2. dd if=/dev/zero of=ext4.img bs=4k count=2048
3.mkfs.ext4 ext4.img
4. mnt=$(mktemp -d)
5. mount -o loop 'ext4.img' "${mnt}"
when i mount this ext4.img as a loop devices it throws the below error:
Error: "mount: /tmp/tmp.7oJoEpL0vt: mount failed: Operation not permitted."
But the above steps are working fine in my host machine.
I hope we need to install the loop module in chroot or any other suggestion
that would be helpful to mount loop devices in schroot sessions.
Note: losetup also not works in schroot.
Many thanks,
Srinu
[-- Attachment #1.2: Type: text/html, Size: 1249 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mount loop devices not works in schroot
2024-01-18 7:16 mount loop devices not works in schroot Srinuvasan Arjunan
@ 2024-01-18 7:56 ` Jan Kiszka
2024-01-18 8:16 ` Srinuvasan Arjunan
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2024-01-18 7:56 UTC (permalink / raw)
To: Srinuvasan Arjunan, isar-users
On 18.01.24 08:16, Srinuvasan Arjunan wrote:
> Hi All,
>
> Presently we migrated the chroot to sbuildchroot and one of
> my image creation part i try to mount some temporary file system as a
> loop device and do create volumes and other stuffs.
>
> Here i could see am not able to mount the file system as a loop device
> specifically in chroot.
>
> reproduce steps:
>
> 1. chroot into the created session
> 2. dd if=/dev/zero of=ext4.img bs=4k count=2048
> 3.mkfs.ext4 ext4.img
> 4. mnt=$(mktemp -d)
> 5. mount -o loop 'ext4.img' "${mnt}"
>
> when i mount this ext4.img as a loop devices it throws the below error:
> Error: "mount: /tmp/tmp.7oJoEpL0vt: mount failed: Operation not permitted."
>
> But the above steps are working fine in my host machine.
>
> I hope we need to install the loop module in chroot or any other
> suggestion that would be helpful to mount loop devices in schroot sessions.
>
> Note: losetup also not works in schroot.
>
I don't think you can run such stuff in the schroot, and you will surely
not be able to once we fully de-privilege the build. That's why I
suggested to you already to get rid of this loop-mount requirement.
Jan
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mount loop devices not works in schroot
2024-01-18 7:56 ` Jan Kiszka
@ 2024-01-18 8:16 ` Srinuvasan Arjunan
2024-01-18 9:23 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Srinuvasan Arjunan @ 2024-01-18 8:16 UTC (permalink / raw)
To: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 1685 bytes --]
On Thursday, January 18, 2024 at 1:26:32 PM UTC+5:30 Jan Kiszka wrote:
On 18.01.24 08:16, Srinuvasan Arjunan wrote:
> Hi All,
>
> Presently we migrated the chroot to sbuildchroot and one of
> my image creation part i try to mount some temporary file system as a
> loop device and do create volumes and other stuffs.
>
> Here i could see am not able to mount the file system as a loop device
> specifically in chroot.
>
> reproduce steps:
>
> 1. chroot into the created session
> 2. dd if=/dev/zero of=ext4.img bs=4k count=2048
> 3.mkfs.ext4 ext4.img
> 4. mnt=$(mktemp -d)
> 5. mount -o loop 'ext4.img' "${mnt}"
>
> when i mount this ext4.img as a loop devices it throws the below error:
> Error: "mount: /tmp/tmp.7oJoEpL0vt: mount failed: Operation not
permitted."
>
> But the above steps are working fine in my host machine.
>
> I hope we need to install the loop module in chroot or any other
> suggestion that would be helpful to mount loop devices in schroot
sessions.
>
> Note: losetup also not works in schroot.
>
I don't think you can run such stuff in the schroot, and you will surely
not be able to once we fully de-privilege the build. That's why I
suggested to you already to get rid of this loop-mount requirement.
Jan
--
Siemens AG, Technology
Linux Expert Center
Thanks jan for your quick reply, but still i didn't get this line "and you
will surely
not be able to once we fully de-privilege the build"
Can you please provide more information on the above line
but i could see this was working fine in existing BUILDCHROOT.
Many thanks,
Srinu
[-- Attachment #1.2: Type: text/html, Size: 2263 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mount loop devices not works in schroot
2024-01-18 8:16 ` Srinuvasan Arjunan
@ 2024-01-18 9:23 ` Jan Kiszka
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2024-01-18 9:23 UTC (permalink / raw)
To: Srinuvasan Arjunan, isar-users
On 18.01.24 09:16, Srinuvasan Arjunan wrote:
>
>
> On Thursday, January 18, 2024 at 1:26:32 PM UTC+5:30 Jan Kiszka wrote:
>
> On 18.01.24 08:16, Srinuvasan Arjunan wrote:
> > Hi All,
> >
> > Presently we migrated the chroot to sbuildchroot and
> one of
> > my image creation part i try to mount some temporary file system as a
> > loop device and do create volumes and other stuffs.
> >
> > Here i could see am not able to mount the file system as a loop
> device
> > specifically in chroot.
> >
> > reproduce steps:
> >
> > 1. chroot into the created session
> > 2. dd if=/dev/zero of=ext4.img bs=4k count=2048
> > 3.mkfs.ext4 ext4.img
> > 4. mnt=$(mktemp -d)
> > 5. mount -o loop 'ext4.img' "${mnt}"
> >
> > when i mount this ext4.img as a loop devices it throws the below
> error:
> > Error: "mount: /tmp/tmp.7oJoEpL0vt: mount failed: Operation not
> permitted."
> >
> > But the above steps are working fine in my host machine.
> >
> > I hope we need to install the loop module in chroot or any other
> > suggestion that would be helpful to mount loop devices in schroot
> sessions.
> >
> > Note: losetup also not works in schroot.
> >
>
> I don't think you can run such stuff in the schroot, and you will
> surely
> not be able to once we fully de-privilege the build. That's why I
> suggested to you already to get rid of this loop-mount requirement.
>
> Jan
>
> --
> Siemens AG, Technology
> Linux Expert Center
>
>
>
> Thanks jan for your quick reply, but still i didn't get this line "and
> you will surely
> not be able to once we fully de-privilege the build"
>
> Can you please provide more information on the above line
Unprivileged building implies that you do not allow the building user to
use a kernel filesystem driver to mount filesystem images controlled by
that user. Filesystem drivers are not designed for that use case, and
there is no change in this regard in sight.
Jan
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-18 9:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 7:16 mount loop devices not works in schroot Srinuvasan Arjunan
2024-01-18 7:56 ` Jan Kiszka
2024-01-18 8:16 ` Srinuvasan Arjunan
2024-01-18 9:23 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox