Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #235130 > unrolled thread

How to reference xxxdvd1.iso in sources.list

Started byRichard Owlett <rowlett@cloud85.net>
First post2021-05-12 21:10 +0200
Last post2021-05-15 18:10 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  How to reference xxxdvd1.iso in sources.list Richard Owlett <rowlett@cloud85.net> - 2021-05-12 21:10 +0200
    Re: How to reference xxxdvd1.iso in sources.list Liam O'Toole <liam.p.otoole@gmail.com> - 2021-05-12 22:10 +0200
      Re: How to reference xxxdvd1.iso in sources.list Richard Owlett <rowlett@cloud85.net> - 2021-05-13 11:40 +0200
    RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list Richard Owlett <rowlett@cloud85.net> - 2021-05-15 12:10 +0200
      Re: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list "Thomas Schmitt" <scdbackup@gmx.net> - 2021-05-15 14:20 +0200
        Re: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list Richard Owlett <rowlett@cloud85.net> - 2021-05-15 17:10 +0200
          Re: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list "Thomas Schmitt" <scdbackup@gmx.net> - 2021-05-15 18:10 +0200

#235130 — How to reference xxxdvd1.iso in sources.list

FromRichard Owlett <rowlett@cloud85.net>
Date2021-05-12 21:10 +0200
SubjectHow to reference xxxdvd1.iso in sources.list
Message-ID<Ce2p3-12m-1@gated-at.bofh.it>
I've seen a reference to using the ISO file of DVDnn in a sources.list .
I remember that it gets identified as being ISO9660 and labeled as 
trusted, But I can't find a detailed example. All I find are references 
to unpacking the iso to a directory which is then loop mounted. That's 
not what I'm looking for.
Pointers please.
TIA

[toc] | [next] | [standalone]


#235131

FromLiam O'Toole <liam.p.otoole@gmail.com>
Date2021-05-12 22:10 +0200
Message-ID<Ce3l7-1AE-3@gated-at.bofh.it>
In reply to#235130
On Wed, 12 May, 2021 at 14:05:59 -0500, Richard Owlett wrote:
> I've seen a reference to using the ISO file of DVDnn in a sources.list .
> I remember that it gets identified as being ISO9660 and labeled as trusted,
> But I can't find a detailed example. All I find are references to unpacking
> the iso to a directory which is then loop mounted. That's not what I'm
> looking for.
> Pointers please.
> TIA
> 
> 
On a new install, the ISO is added automatically to sources.list, but commented out. Like this:

# deb cdrom:[Debian GNU/Linux 9.4.0 _Stretch_ - Official amd64 NETINST 20180310-11:21]/ stretch main

[toc] | [prev] | [next] | [standalone]


#235153

FromRichard Owlett <rowlett@cloud85.net>
Date2021-05-13 11:40 +0200
Message-ID<CefZ0-1pF-3@gated-at.bofh.it>
In reply to#235131
On 05/12/2021 03:06 PM, Liam O'Toole wrote:
> On Wed, 12 May, 2021 at 14:05:59 -0500, Richard Owlett wrote:
>> I've seen a reference to using the ISO file of DVDnn in a sources.list .
>> I remember that it gets identified as being ISO9660 and labeled as trusted,
>> But I can't find a detailed example. All I find are references to unpacking
>> the iso to a directory which is then loop mounted. That's not what I'm
>> looking for.
>> Pointers please.
>> TIA
>>
>>
> On a new install, the ISO is added automatically to sources.list, but commented out. Like this:
> 
> # deb cdrom:[Debian GNU/Linux 9.4.0 _Stretch_ - Official amd64 NETINST 20180310-11:21]/ stretch main
> 

But I have an iso file on a disk drive -- be it internal HDD or a USB 
flash drive.

[toc] | [prev] | [next] | [standalone]


#235211 — RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list

FromRichard Owlett <rowlett@cloud85.net>
Date2021-05-15 12:10 +0200
SubjectRESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list
Message-ID<CeZp8-3SH-9@gated-at.bofh.it>
In reply to#235130
On 05/12/2021 02:05 PM, Richard Owlett wrote:
> I've seen a reference to using the ISO file of DVDnn in a sources.list .
> I remember that it gets identified as being ISO9660 and labeled as 
> trusted, But I can't find a detailed example. All I find are references 
> to unpacking the iso to a directory which is then loop mounted. That's 
> not what I'm looking for.
> Pointers please.
> TIA
> 
Exactly what I was looking for does not exist.
I had a poor recollection of a partially understood article.

I don't grok loop devices. Wikipedia summarizes by saying "In Unix-like 
operating systems, a loop device ... is a pseudo-device that makes a 
computer file accessible as a block device."

Also the article I read evidently took advantage of "mount" being able 
to loop mount without the loop option being explicitly referenced.

I have a machine dedicated to install experiments and a low data cap on 
my internet access. I wish to have the ISO's of all install DVDs on a 
dedicated partition of my hard drive as a local repository.

[toc] | [prev] | [next] | [standalone]


#235214 — Re: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2021-05-15 14:20 +0200
SubjectRe: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list
Message-ID<Cf1qW-537-11@gated-at.bofh.it>
In reply to#235211
Hi,

Richard Owlett wrote:
> I don't grok loop devices. [...]
> Also the article I read evidently took advantage of "mount" being able to
> loop mount without the loop option being explicitly referenced.

Yes. mount is smart enough to see that your "device" is a data file and
that it has to use a loop device.
A little test as superuser with already existing directory /mnt/iso:

  # mount debian-10.6.0-amd64-netinst.iso /mnt/iso
  mount: /dev/loop0 is write-protected, mounting read-only
  # ls /mnt/iso
  EFI
  ...
  win32-loader.ini

So it used the existing /dev/loop0. If no idle loop device is available
then it will create a new one.

See in man mount the section
  THE LOOP DEVICE


> I wish to have the ISO's of all install DVDs on a dedicated
> partition of my hard drive as a local repository.

You could mount them all, e.g. by a script which knows all their names
and the desired mount points. Each mount point would need its own line
in sources.list.

-------------------------------------------------------------------------
Alternative:

Or you could also copy the ./pool trees of the one-by-one mounted ISOs to
a ./pool directory in the filesystem of your dedicated partition.

I understand that sources.list will then want the directory above ./pool
as source for packages. I.e. if you copy to
  /your/partition/pool
then it wants to see in the deb line
  /your/partition

Possibly you will have to set in that line the option
  [trusted=yes]
to compensate the lack of a skilled Debian setup in your copied tree.

-------------------------------------------------------------------------
Alternative:

For copying without being superuser and without mounting the ISO, you could
use xorriso. Like:

  ISO_PATH=./debian-10.6.0-amd64-netinst.iso
  xorriso -osirrox on:auto_chmod_on \
          -indev "$ISO_PATH" \
          -extract /pool /your/partition/pool

The option "auto_chmod_on" of xorriso command -osirrox causes:
  [that] access  restrictions  for  disk  directories get circumvented if
  those directories are owned  by  the  effective  user  who  runs
  xorriso.  This happens by temporarily granting rwx permission to
  the owner.
The first ISO extraction will work without this option. But when copying
multiple trees from ISOs to disk, it will enable xorriso to write into the
previously created directories under /your/partition/pool and to overwrite
existing files in that tree. Both is elsewise hampered by the fact that
xorriso copies the access permissions from the ISOs, where they are set to
be read-only.

-------------------------------------------------------------------------
Alternative:

Another method would be to let xorriso change the permissions in the ISO
before extraction and to tell it to discard the permission changes rather
than trying to write them as new session:

  xorriso -osirrox on \
          -indev "$ISO_PATH" \
          -chmod_r u+rw /pool -- \
          -extract /pool /your/partition/pool \
          -rollback_end

The "--" after -chmod_r is important because it ends the list of paths
to manipulate.
The command -rollback_end prevents the attempt to write a new session after
you made changes to the loaded ISO. Without it (and without an -outdev)
you would get an error message after successfule extraction:
  xorriso : FAILURE : No output drive acquired on attempt to write
and the exit value would be non-zero.

The extracted files will not be read-only afterwards. This eases manipulation
and removal of the pool tree, but also gives no protection against removal
by mistake. Read-only trees will need superuser power or a run of chmod -R
before you can remove files or the whole tree.


Have a nice day :)

Thomas

[toc] | [prev] | [next] | [standalone]


#235215 — Re: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list

FromRichard Owlett <rowlett@cloud85.net>
Date2021-05-15 17:10 +0200
SubjectRe: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list
Message-ID<Cf45s-6Fj-13@gated-at.bofh.it>
In reply to#235214
On 05/15/2021 07:18 AM, Thomas Schmitt wrote:
> Hi,
> 
> Richard Owlett wrote:
>> I don't grok loop devices. [...]
>> Also the article I read evidently took advantage of "mount" being able to
>> loop mount without the loop option being explicitly referenced.
> 
> Yes. mount is smart enough to see that your "device" is a data file and
> that it has to use a loop device.
> A little test as superuser with already existing directory /mnt/iso:
> 
>    # mount debian-10.6.0-amd64-netinst.iso /mnt/iso
>    mount: /dev/loop0 is write-protected, mounting read-only
>    # ls /mnt/iso
>    EFI
>    ...
>    win32-loader.ini
> 
> So it used the existing /dev/loop0. If no idle loop device is available
> then it will create a new one.
> 
> See in man mount the section
>    THE LOOP DEVICE
> 
> 
>> I wish to have the ISO's of all install DVDs on a dedicated
>> partition of my hard drive as a local repository.
> 
> You could mount them all, e.g. by a script which knows all their names
> and the desired mount points. Each mount point would need its own line
> in sources.list.
> 

That raises a couple of questions.

IIRC there was a limit on the number of loop devices created {8?}.
Is there any default limit now?

Also, I notice the phrase "auto-destruction of loop devices".
That raises a red flag. Might I lose one (or more) of my loop devices 
without some intentional explicit action by me?????

[snip discussion of extracting pool directories and possible uses of 
xorriso for possible later discussion]

Thanks.

[toc] | [prev] | [next] | [standalone]


#235218 — Re: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2021-05-15 18:10 +0200
SubjectRe: RESOLUTION --- Re: How to reference xxxdvd1.iso in sources.list
Message-ID<Cf51w-7iv-1@gated-at.bofh.it>
In reply to#235215
Hi,

Richard Owlett wrote:
> IIRC there was a limit on the number of loop devices created {8?}.
> Is there any default limit now?

That would be
  man losetup
and
  https://www.kernel.org/doc/Documentation/admin-guide/devices.txt

The former seems to tell no limitation.
The latter lists "loopback devices" for "major" number 7 with unlimited
range for the "minor" device number. The "minor" number is the one that
gets appended to the "/dev/loop" name.
IIRC this "unlimited" range traditionally means 0 to 255. But the dev_t
variable in the result of stat(2) reserves 20 bits for the minor number:
  https://github.com/torvalds/linux/blob/master/include/linux/kdev_t.h

So this numbering might reach up to a million.

As experiment, a normal user creates a file of 1 MiB

  $ dd if=/dev/zero bs=1M count=1 of=/tmp/loop_test
  1+0 records in
  1+0 records out
  1048576 bytes (1.0 MB) copied, 0.00240163 s, 437 MB/s
  $

and the superuser connects it to loop device 1000:

  # losetup /dev/loop1000 /tmp/loop_test
  #

Checking the status of the device looks ok:

  # losetup /dev/loop1000
  /dev/loop1000: [2066]:5899 (/tmp/loop_test)
  #

(Don't ask me what the numbers mean ...)

To remove the device association:

  # losetup -d /dev/loop1000
  # losetup /dev/loop1000
  losetup: /dev/loop1000: No such file or directory
  #

Despite the error message the device file still exists.

  $ ls -l /dev/loop1000
  brw-rw---- 1 root disk 7, 1000 May 15 17:34 /dev/loop1000

(This is a fine example why any re-use of Unix error numbers should be well
thought. Here it was not so well done. losetup names the device file but
reports about its lack of association to a data file. That data file does
still exist, too. So no file is missing here.)

Now i remove the file /tmp/loop_test, but keep the device file
/dev/loop1000 out of superstition. It brings bad luck to delete in /dev.


> Also, I notice the phrase "auto-destruction of loop devices".

Reading the whole phrase it becomes clear that this is just about properly
cleaning up after umount:

  Since Linux 2.6.25 auto-destruction of loop devices is supported, mean‐
  ing  that  any  loop  device allocated by mount will be freed by umount
  independently of /etc/mtab.

> Might I lose one (or more) of my loop devices
> without some intentional explicit action by me?????

You lose the association, which was created by mount.
I expect that you don't lose the device file. But even if the device file
vanishes, the next mount or losetup will create it again, if that same
loop device number is desired.

I use loop mounting often and did not notice any special risk of it.


Have a nice day :)

Thomas

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web