-
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.
-
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!
-
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.
-
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.
-
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
-
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.
-
I'm at it.
Originally Posted by
DirkS
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.
-
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"?
-
Senior Member
registered user
Originally Posted by
DirkS
Is there a way to declare the thread as "solved"?
I suggest you PM Werner P. Schulz to see if this is possible.
-
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
-
Forum Rules
IBM 8231-E2C Power p730 Server, 3.55GHz 16 core, 2 x EPC3, PowerVM express
$995.00
IBM x3650 M3, 7945-AC1, 40GB, XEON e5507, 2.26ghz x2 with RAID Card, No HDD
$249.00
IBM 8203-E4A pSeries 520 6-Bay Server System Power6 2 Core 4.2GHz 4GB No HD
$299.99
IBM Lenovo X3650 M5 2U 8x 2.5ā€¯ CTO Rack Server ā€“ 2x HS, 2x 750W
$199.00
IBM S822LC 8335-GCA Power 8 2U Server 2xPower8 TESTED
$695.00
IBM eServer xSeries 346 3GHz Xeon 1Gb SDRAM 73Gb SCSI 2U Rack Server
$89.99
IBM S814 8286-41A 78EDF6W Power8 Rackmount Server EPX6 3.72GHz 64gb SEE NOTES
$750.00
IBM Qradar xx29 M6 Server w/ 2x Intel Xeon E5-2650 v4, 32GB, 2x PSU & Cords
$499.99
(LOT OF 10) IBM 32GB 4Gx72 M396B4K73CH0-YF8M6 CDIMM Server Memory
$300.00
IBM 44M1501 BladeCenter JS12 Blade Server with 2-Way 3.8GHz PS701/702
$162.50