Results 1 to 10 of 10

Thread: Mounting self-made cloop file - how?

Hybrid View

  1. #1
    Member registered user
    Join Date
    Sep 2005
    Posts
    36

    Mounting self-made cloop file - how?

    I create a cloop file using the following commands:\n XXX\nYYY I

    root@Microknoppix:/media/sdc2# ddrescue /dev/sda1 /media/sdc2/sda1_2017-03-04.img ... root@Microknoppix:/media/sdc2# create_compressed_fs -L -1 sda1_2017-03-04.img /media/sdc2/sda1_2017-03-04.cloop ... root@Microknoppix:/media/sdc2# ls -l sda1_2017-03-04.* -rwxrwxrwx 1 knoppix knoppix 266178504 Mär 4 21:35 sda1_2017-03-04.cloop -rwxrwxrwx 1 knoppix knoppix 314572800 Mär 4 21:31 sda1_2017-03-04.img Looks OK. Now I can mount the uncompressed image: root@Microknoppix:/media/sdc2# mkdir /media/img-test /media/cloop-test root@Microknoppix:/media/sdc2# mount -r -o,loop -t ntfs /media/sdc2/sda1_2017-03-01.img /media/img-test/ root@Microknoppix:/media/sdc2# df | grep test /dev/loop0 307196 233384 73812 76% /media/img-test OK. Then I wanted to mount the cloop file... The file itself contains the following lines of script: #!/bin/sh #V2.0 Format modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1 exit $? So I tried: root@Microknoppix:/media/sdc2# modprobe -v cloop file=/media/sdc2/sda1_2017-03-04.cloop which outputs nothing. Did it work so far? No idea. Trying anyway: root@Microknoppix:/media/sdc2# mount -r -t ntfs /dev/cloop /media/cloop-test NTFS signature is missing. Failed to mount '/dev/cloop0': Das Argument ist ungültig The device '/dev/cloop0' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around? hmmm... root@Microknoppix:/media/sdc2# mount | grep cloop /dev/cloop0 on /KNOPPIX type iso9660 (ro,relatime) /dev/cloop1 on /KNOPPIX1 type iso9660 (ro,relatime) So /dev/cloop0 and /dev/cloop1 are in use (telling me that KNOPPIX itself managed to mount its files just fine. Trying /dev/cloop2 instead: root@Microknoppix:/media/sdc2# mount -r -t ntfs /dev/cloop2 /media/cloop-test Failed to read bootsector (size=0) Failed to mount '/dev/cloop2': Das Argument ist ungültig The device '/dev/cloop2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around? This might suggest that the modprobe command silently failed. Trying the losetup method, mentioned in /usr/share/doc/cloop-utils/README: root@Microknoppix:/media/sdc2# losetup /dev/cloop3 /media/sdc2/sda1_2017-03-04.cloop losetup: /dev/cloop3: Loop-Gerät konnte nicht eingerichtet werden: Das Dateisystem ist nur lesbar (Translation: Loop device could not get created. The filesystem is readonly.) Hmmm... root@Microknoppix:/media/sdc2# ls -l /dev/cloop* lrwxrwxrwx 1 root root 6 Mär 4 20:38 /dev/cloop -> cloop0 brw-rw---- 1 root disk 240, 0 Mär 4 20:38 /dev/cloop0 brw-rw---- 1 root disk 240, 1 Mär 4 20:38 /dev/cloop1 brw-rw---- 1 root disk 240, 2 Mär 4 20:38 /dev/cloop2 brw-rw---- 1 root disk 240, 3 Mär 4 20:38 /dev/cloop3 brw-rw---- 1 root disk 240, 4 Mär 4 20:38 /dev/cloop4 brw-rw---- 1 root disk 240, 5 Mär 4 20:38 /dev/cloop5 brw-rw---- 1 root disk 240, 6 Mär 4 20:38 /dev/cloop6 brw-rw---- 1 root disk 240, 7 Mär 4 20:38 /dev/cloop7 root@Microknoppix:/media/sdc2# rm -f /dev/cloop6 root@Microknoppix:/media/sdc2# ll /dev/cloop* lrwxrwxrwx 1 root root 6 Mär 4 20:38 /dev/cloop -> cloop0 brw-rw---- 1 root disk 240, 0 Mär 4 20:38 /dev/cloop0 brw-rw---- 1 root disk 240, 1 Mär 4 20:38 /dev/cloop1 brw-rw---- 1 root disk 240, 2 Mär 4 20:38 /dev/cloop2 brw-rw---- 1 root disk 240, 3 Mär 4 20:38 /dev/cloop3 brw-rw---- 1 root disk 240, 4 Mär 4 20:38 /dev/cloop4 brw-rw---- 1 root disk 240, 5 Mär 4 20:38 /dev/cloop5 root@Microknoppix:/media/sdc2# losetup /dev/cloop6 /media/sdc2/sda1_2017-03-04.cloop losetup: /dev/cloop6: Loop-Gerät konnte nicht eingerichtet werden: Datei oder Verzeichnis nicht gefunden (Translation: Loop device could not get created. File or directory not found.) root@Microknoppix:/media/sdc2# losetup -f /dev/loop0 Why /dev/loop0, that one should be in use! How can I do this? What am I overlooking? It it impossible to do with a poor-man's-installation of Knoppix? Has anyone managed to do this using Knoppix 7.7.1? Please help!
    Last edited by DirkS; 03-04-2017 at 10:53 PM. Reason: Formatting is totally f'ed up.

  2. #2
    Member registered user
    Join Date
    Sep 2005
    Posts
    36
    WTF. Again:

    I create a cloop file using the following commands:

    root@Microknoppix:/media/sdc2# ddrescue /dev/sda1 /media/sdc2/sda1_2017-03-04.img
    ...
    root@Microknoppix:/media/sdc2# create_compressed_fs -L -1 sda1_2017-03-04.img /media/sdc2/sda1_2017-03-04.cloop
    ...
    root@Microknoppix:/media/sdc2# ls -l sda1_2017-03-04.*
    -rwxrwxrwx 1 knoppix knoppix 266178504 Mär 4 21:35 sda1_2017-03-04.cloop
    -rwxrwxrwx 1 knoppix knoppix 314572800 Mär 4 21:31 sda1_2017-03-04.img

    Looks OK. Trying to mount the uncompressed image:

    root@Microknoppix:/media/sdc2# mkdir /media/img-test /media/cloop-test
    root@Microknoppix:/media/sdc2# mount -r -o,loop -t ntfs /media/sdc2/sda1_2017-03-01.img /media/img-test/
    root@Microknoppix:/media/sdc2# df | grep test /dev/loop0 307196 233384 73812 76% /media/img-test

    OK. Then I wanted to mount the cloop file... The file itself contains the following lines of script:
    #!/bin/sh
    #V2.0 Format
    modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1
    exit $?

    So I tried:

    root@Microknoppix:/media/sdc2# modprobe -v cloop file=/media/sdc2/sda1_2017-03-04.cloop

    which outputs nothing. Did it work so far? No idea. Trying anyway:

    root@Microknoppix:/media/sdc2# mount -r -t ntfs /dev/cloop /media/cloop-test
    NTFS signature is missing. Failed to mount '/dev/cloop0': Das Argument ist ungültig
    The device '/dev/cloop0' doesn't seem to have a valid NTFS.
    Maybe the wrong device is used? Or the whole disk instead of a
    partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

    hmmm...

    root@Microknoppix:/media/sdc2# mount | grep cloop
    /dev/cloop0 on /KNOPPIX type iso9660 (ro,relatime)
    /dev/cloop1 on /KNOPPIX1 type iso9660 (ro,relatime)

    So /dev/cloop0 and /dev/cloop1 are in use (telling me that Knoppix itself managed to mount its files just fine. Trying /dev/cloop2 instead:

    root@Microknoppix:/media/sdc2# mount -r -t ntfs /dev/cloop2 /media/cloop-test
    Failed to read bootsector (size=0)
    Failed to mount '/dev/cloop2': Das Argument ist ungültig
    The device '/dev/cloop2' doesn't seem to have a valid NTFS.
    Maybe the wrong device is used? Or the whole disk instead of a
    partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

    This might suggest that the modprobe command silently failed. Trying the losetup method, mentioned in /usr/share/doc/cloop-utils/README:

    root@Microknoppix:/media/sdc2# losetup /dev/cloop3 /media/sdc2/sda1_2017-03-04.cloop
    losetup: /dev/cloop3: Loop-Gerät konnte nicht eingerichtet werden: Das Dateisystem ist nur lesbar (Translation: Loop device could not get created. The filesystem is readonly.)

    Hmmm...

    root@Microknoppix:/media/sdc2# ls -l /dev/cloop*
    lrwxrwxrwx 1 root root 6 Mär 4 20:38 /dev/cloop -> cloop0
    brw-rw---- 1 root disk 240, 0 Mär 4 20:38 /dev/cloop0
    brw-rw---- 1 root disk 240, 1 Mär 4 20:38 /dev/cloop1
    brw-rw---- 1 root disk 240, 2 Mär 4 20:38 /dev/cloop2
    brw-rw---- 1 root disk 240, 3 Mär 4 20:38 /dev/cloop3
    brw-rw---- 1 root disk 240, 4 Mär 4 20:38 /dev/cloop4
    brw-rw---- 1 root disk 240, 5 Mär 4 20:38 /dev/cloop5
    brw-rw---- 1 root disk 240, 6 Mär 4 20:38 /dev/cloop6
    brw-rw---- 1 root disk 240, 7 Mär 4 20:38 /dev/cloop7
    root@Microknoppix:/media/sdc2# rm -f /dev/cloop6 /dev/cloop7
    root@Microknoppix:/media/sdc2# ll /dev/cloop*
    lrwxrwxrwx 1 root root 6 Mär 4 20:38 /dev/cloop -> cloop0
    brw-rw---- 1 root disk 240, 0 Mär 4 20:38 /dev/cloop0
    brw-rw---- 1 root disk 240, 1 Mär 4 20:38 /dev/cloop1
    brw-rw---- 1 root disk 240, 2 Mär 4 20:38 /dev/cloop2
    brw-rw---- 1 root disk 240, 3 Mär 4 20:38 /dev/cloop3
    brw-rw---- 1 root disk 240, 4 Mär 4 20:38 /dev/cloop4
    brw-rw---- 1 root disk 240, 5 Mär 4 20:38 /dev/cloop5
    root@Microknoppix:/media/sdc2#

    They are gone. Doesn't look readonly to me. Anyway:

    root@Microknoppix:/media/sdc2# losetup /dev/cloop6 /media/sdc2/sda1_2017-03-04.cloop
    losetup: /dev/cloop6: Loop-Gerät konnte nicht eingerichtet werden: Datei oder Verzeichnis nicht gefunden (Translation: Loop device could not get created. File or directory not found.)

    root@Microknoppix:/media/sdc2# losetup -f
    /dev/loop0

    Why /dev/loop0, that one should be in use!

    How can I do this? What am I overlooking?
    It it impossible to do with a poor-man's-installation of Knoppix?
    Has anyone managed to do this using Knoppix 7.7.1?
    Please help!

  3. #3
    Member registered user
    Join Date
    Sep 2005
    Posts
    36
    Meanwhile I found a way to mount a cloop-image that works under Knoppix 7.0 but not under 7.7.1, so now I suspect that something is broken in 7.7.1.

  4. #4
    Member registered user
    Join Date
    Dec 2006
    Posts
    44
    I make a cloop file directly from the mounted file system like this:
    Code:
    $ genisoimage -input-charset ISO-8859-15 -R -l -D -V KNOPPIX_FS -quiet \
      -no-split-symlink-components -no-split-symlink-fields \
      -hide-rr-moved -cache-inodes /path/to/cloop/filesystem/root/directory \
      | create_compressed_fs -q -B 65536 -t 8 -L 9 \
      -f /tmp/isotemp - /path/to/created/cloop/file
    I don't know if your creation method with ddrescue and create_compressed_fs does the same.
    Does the method below work for you?
    Code:
    $ sudo losetup --verbose --read-only  /dev/cloop7 /mnt-system/KNOPPIX/KNOPPIX1
    losetup: /mnt-system/KNOPPIX/KNOPPIX1: Warning: file does not fit into a 512-byte sector; the end of the file will be ignored.
    
    $ sudo mount --verbose  /dev/cloop7  /mnt-user
    mount: /dev/cloop7 is write-protected, mounting read-only
    mount: /dev/cloop7 mounted on /mnt-user.
    
    $ sudo blkid | grep cloop7
    /dev/cloop7: UUID="2016-10-22-16-00-20-00" LABEL="KNOPPIX_ADDONS1" TYPE="iso9660"
    
    $ df | grep cloop7
    /dev/cloop7      1033766   1033766         0 100% /mnt-user
    Since Knoppix 7 I cannot find a way to detach the cloop device again, so I have to reboot to release the device.
    Code:
    $ sudo umount --verbose  /dev/cloop7
    umount: /mnt-user (/dev/cloop7) unmounted
    
    $ sudo losetup --verbose --detach  /dev/cloop7
    losetup: /dev/cloop7: failed to use device: No such device
    
    $ sudo blkid | grep cloop7
    /dev/cloop7: UUID="2016-10-22-16-00-20-00" LABEL="KNOPPIX_ADDONS1" TYPE="iso9660"
    Last edited by fredvej; 03-05-2017 at 11:33 AM.

  5. #5
    Member registered user
    Join Date
    Dec 2006
    Posts
    44
    The file system in the cloop file cannot be changed and must be attached as read-only
    Code:
     sudo losetup --verbose --read-only  /dev/cloop7 /media/sdc2/sda1_2017-03-04.cloop

  6. #6
    Member registered user
    Join Date
    Sep 2005
    Posts
    36
    Just quick: Thank you very much! I'll try these later, some hours later if I can, otherwise tomorrow or next weekend.

    The method I tried (twice) on Knoppix 7.0 was, after becoming root:
    Code:
    # mkdir /media/test-cloop
    # mount /media/sdc2/sda1_2017-03-04.cloop /media/test-cloop -o loop=/dev/cloop3,ro
    I didn't even need to specify the filesystem type.

    Also thanks for the confirmation that something is off in 7.7.1. I want to find out where the ability to mount cloop-files on an already running Knoppix (instead of during booting) got lost and I'm on the hunt for older Knoppix versions between 7.0 and 7.7.1. Meanwhile I found some on Sourceforge. Preparations and tests will take some time... As soon as I discover something, I report here.

  7. #7
    Member registered user
    Join Date
    Sep 2005
    Posts
    36
    I'm at it.

    Quote Originally Posted by DirkS View Post
    The method I tried (twice) on Knoppix 7.0 was, after becoming root:
    Code:
    # mkdir /media/test-cloop
    # mount /media/sdc2/sda1_2017-03-04.cloop /media/test-cloop -o loop=/dev/cloop3,ro
    I didn't even need to specify the filesystem type.
    This method also works in 7.3 but fails in 7.4.2, 7.7.0 and 7.7.1
    For the following tests I used /media/sr0 as mountpoint instead of creating a directory named /media/test-cloop.
    Using the commands that are contained in the cloop file at the beginning, slightly modified:
    Code:
    #modprobe cloop file=/media/sdd2/sda1_2017-03-01.cloop; echo $?
    # mount -r -t auto /dev/cloop3 /media/sr0
    This works in 7.4.2, even though it took me several tries to find the correct number after /dev/cloop. But this method does not work in 7.7.0 and 7.7.1:
    Code:
    root@Microknoppix:/media/sdd2# mount -r -t auto /dev/cloop3 /media/sr0
    mount: /dev/cloop3: Superblock konnte nicht gelesen werden (Translation: Superblock could not get read)
    Also failed with all other cloop devices.

    Your method:
    Code:
    root@Microknoppix:/media/sdd2# losetup --verbose --read-only /dev/cloop6 /media/sdd2/sda1_2017-03-04.cloop
    root@Microknoppix:/media/sdd2# mount --verbose  /dev/cloop6 /media/sr0
    works in 7.7.0. Yay! I have to reboot to test it in 7.7.1 and/or older versions, but I wanted to write this post with the results so far first.

    By the way, while still being root I was able to do
    Code:
    root@Microknoppix:/media/sde2# df | grep sr0; echo $?
    /dev/cloop6        307196     233384      73812   76% /media/sr0
    0
    root@Microknoppix:/media/sdd2# umount /dev/sr0
    root@Microknoppix:/media/sdd2#  df | grep sr0; echo $?
    1
    so umounting as root works for me. But I cannot free/detach /dec/cloop6:
    Code:
    root@Microknoppix:/media/sdd2#  losetup --verbose -d /dev/cloop6
    losetup: /dev/cloop6: Benutzung des Gerätes ist fehlgeschlagen: Erfolg (Translation: Using the device failed: Success - sorry, that's what it says.)
    So indeed, at this point a reboot is required.
    Last edited by DirkS; 03-12-2017 at 10:21 PM. Reason: added some info.

  8. #8
    Member registered user
    Join Date
    Sep 2005
    Posts
    36
    Wrapping up.

    Code:
    root@Microknoppix:/media/sdd2# losetup --verbose --read-only /dev/cloop6 /media/sdd2/sda1_2017-03-04.cloop
    root@Microknoppix:/media/sdd2# mount --verbose  /dev/cloop6 /media/sr0
    also works in 7.7.1. Double Yay! So I have a solution for the newest Knoppix. Now I hope that it will still work in the upcoming Knoppix 8.

    Is there a way to declare the thread as "solved"?

  9. #9
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    Quote Originally Posted by DirkS View Post
    Is there a way to declare the thread as "solved"?
    I suggest you PM Werner P. Schulz to see if this is possible.

  10. #10
    Member registered user
    Join Date
    Sep 2005
    Posts
    36
    Thanks, utu, I haven't done this yet, but I'm considering it.

    Meanwhile I'm going through the mailing list and found something:

    https://lists.debian.org/debian-knop.../msg00000.html - title: "losetup from 7.6.1 can't detach a cloop device" - sounds familiar, isn't it? Seems like this is caused by a change in losetup. Klaus Knopper posted an answer in which he mentioned that he filed a bug report and using the losetup of busybox should work. I can't test that right now, just leaving the info here so it will not get forgotten.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


ORICO 5 Bay Raid USB3.0 to SATA External Hard Drive Enclosure for 3.5'' HDD US picture

ORICO 5 Bay Raid USB3.0 to SATA External Hard Drive Enclosure for 3.5'' HDD US

$131.99



ORICO 5Bay Raid Hard Drive Enclosure USB3.0 to SATA for 3.5'' HDD SSD 150W Power picture

ORICO 5Bay Raid Hard Drive Enclosure USB3.0 to SATA for 3.5'' HDD SSD 150W Power

$65.99



OWC 4TB RAID ~ Mercury Elite Pro Dual ~  USB 3.1 Memory picture

OWC 4TB RAID ~ Mercury Elite Pro Dual ~ USB 3.1 Memory

$60.00



SAS9305-16I LSI SAS 9305-16I 16 Port PCIe 3.0 x8 12 Gb/s Host Bus Adapter FH picture

SAS9305-16I LSI SAS 9305-16I 16 Port PCIe 3.0 x8 12 Gb/s Host Bus Adapter FH

$64.00



Fantom Drives DUO 2 Bay Mobile DUO RAID - Case only (NO Hard Drives Included) picture

Fantom Drives DUO 2 Bay Mobile DUO RAID - Case only (NO Hard Drives Included)

$23.95



SAS9266-8I LSI MegaRAID SAS 8-Port 6Gb/s 1GB SATA/SAS RAID Controller LSI00295 picture

SAS9266-8I LSI MegaRAID SAS 8-Port 6Gb/s 1GB SATA/SAS RAID Controller LSI00295

$19.00



Adaptec - ASR-7805 6Gbs SAS- PCI EXPRESS 3.0 X8 -1GB Cache RAID Controller Card picture

Adaptec - ASR-7805 6Gbs SAS- PCI EXPRESS 3.0 X8 -1GB Cache RAID Controller Card

$24.99



LSI MegaRAID SAS 9361-4i 12Gb/s SAS RAID PCIe Controller Card picture

LSI MegaRAID SAS 9361-4i 12Gb/s SAS RAID PCIe Controller Card

$24.95



8 Bay UNAS RAID Array Case mITX 8GB RAM AMD Athlon 5350 ASRock AM1H-ITX Storage picture

8 Bay UNAS RAID Array Case mITX 8GB RAM AMD Athlon 5350 ASRock AM1H-ITX Storage

$475.00



OWC 6TB RAID ~ Mercury Elite Pro Dual ~  USB 3.1 Memory picture

OWC 6TB RAID ~ Mercury Elite Pro Dual ~ USB 3.1 Memory

$85.00