-
Test problem for cloop operations -- failures.
I am having lots of trouble creating a working Knoppix
CD / filesystem. I can copy the various KNOPPIX/KNOPPIX files
(Knoppix lite, Luit Linux, Feather Linux) from the CD to a hard
drive partition, then boot them by unpacking the boot.img to a directory, configuring lilo
and running lilo, or else by using a boot floppy. However,
if I boot Knoppix from CD, copy the /cdrom/KNOPPIX partition
to (another) HD partition and directory e.g.,
/mnt/hda3/knx/source/KNOPPIX
and use this to make a new "big file", this file is different
from the original and generally (I've had one exception) won't boot.
(I also remade the boot directory and the boot floppy -- no joy.)
To try to get to the bottom of this (and to provide a didactic
tool for other folk that doesn't take a lot of time to run), I
created the following test. This example here was run under
Knoppix 3.3 Beta, booted from a HD partition. The tests were run
in a Reiserfs partition created by Xandros 2.0.
I'd really like to know how to mount my compressed filesystem --
Knoppix complains when I try -- see the /sbin/losetup below.
Any help much appreciated.
J C Nash, U. Ottawa 2004-5-11
Here's the example:
The 'filesystem' in 'rootdir' (under clooptest directory) is
rootdir (directory)
tt
john (directory)
john1
john2
john3
john4
mary (directory)
mary1
mary2
mary3
mary4
All files were small and plain text. They were created from my lilo.conf
file by putting the file name as the first and last line.
The output (comments in [] are NOT part of the output):
root@ttyp0[clooptest]# mkisofs -R rootdir >rootdir.iso
[ rootdir.iso is NOT an image, I just wanted a name for the file. ]
Total translation table size: 0
Total rockridge attributes bytes: 1279
Total directory bytes: 4096
Path table size(bytes): 34
Max brk space used 21224
186 extents written (0 Mb)
root@ttyp0[clooptest]# rm myrootdir
rm: remove regular file
yrootdir'? y
root@ttyp0[clooptest]# alias dir='ls -als'
root@ttyp0[clooptest]# dir
total 2216
1 drwxr-xr-x 4 root root 312 May 8 18:00 .
2 drwxr-xr-x 27 root root 1544 May 8 17:33 ..
1 drwxr-xr-x 4 root root 120 May 6 19:35 rootdir
372 -rw-r--r-- 1 root root 380928 May 8 18:00 rootdir.iso
root@ttyp0[clooptest]# create_compressed_fs rootdir.iso 65536 >rootdir.clp
Block# 0 size 65536 -> 1364 [compression ratio 2%, overall: 2%]
Block# 1 size 65536 -> 435 [compression ratio 0%, overall: 1%]
Block# 2 size 65536 -> 84 [compression ratio 0%, overall: 0%]
Block# 3 size 65536 -> 84 [compression ratio 0%, overall: 0%]
Block# 4 size 65536 -> 84 [compression ratio 0%, overall: 0%]
Partial read (53248 bytes of 65536), padding with zeros.
Block# 5 size 53248 -> 84 [compression ratio 0%, overall: 0%]
Block size 65536, number of blocks 6.
Done.
root@ttyp0[clooptest]# dir
total 392
1 drwxr-xr-x 4 root root 256 May 8 18:02 .
2 drwxr-xr-x 27 root root 1544 May 8 17:33 ..
1 drwxr-xr-x 4 root root 120 May 6 19:35 rootdir
4 -rw-r--r-- 1 root root 2327 May 8 18:02 rootdir.clp
372 -rw-r--r-- 1 root root 380928 May 8 18:00 rootdir.iso
root@ttyp0[clooptest]# mount
/dev/root on / type ext2 (rw)
/dev/cdrom on /cdrom type iso9660 (ro)
/dev/cloop on /KNOPPIX type iso9660 (ro)
/ramdisk on /ramdisk type tmpfs (rw,size=507760k)
usb on /proc/bus/usb type usbdevfs (rw,devmode=0666)
automount(pid706) on /mnt/auto type autofs
(rw,fd=4,pgrp=706,minproto=2,maxproto=4)
/dev/hda3 on /mnt/hda3 type ext3 (rw)
/dev/hdb1 on /mnt/hdb1 type reiserfs (rw)
[ The clooptest directory is on the hdb1 partition ]
[ Try to set up access to the cloop compressed file. ]
root@ttyp0[clooptest]# /sbin/losetup /dev/cloop3 rootdir.clp
ioctl: LOOP_SET_FD: Bad file descriptor
Attempts to expand:
root@ttyp0[clooptest]# dd if=rootdir.clp of=rootdir.exp
4+1 records in
4+1 records out
2327 bytes transferred in 0.000453 seconds (5137195 bytes/sec)
root@ttyp0[clooptest]# dir
total 412
1 drwxr-xr-x 4 root root 352 May 8 18:06 .
2 drwxr-xr-x 27 root root 1544 May 8 17:33 ..
1 drwxr-xr-x 4 root root 120 May 6 19:35 rootdir
4 -rw-r--r-- 1 root root 2327 May 8 18:02 rootdir.clp
4 -rw-r--r-- 1 root root 2327 May 8 18:06 rootdir.exp
372 -rw-r--r-- 1 root root 380928 May 8 18:00 rootdir.iso
[ Clearly did not work, so remove file. ]
root@ttyp0[clooptest]# rm rootdir.exp
rm: remove regular file rootdir.exp'? y
[ Try with extract_compressed_fs ]
root@ttyp0[clooptest]# extract_compressed_fs rootdir.clp >rootdir.exp
6 blocks of size 65536. Preamble:
#!/bin/sh
#V2.0 Format
insmod cloop.o file=$0 && mount -r -t iso9660 /dev/cloop $1
exit $?
Block 0 length 1364 => 65536
Block 1 length 435 => 65536
Block 2 length 84 => 65536
Block 3 length 84 => 65536
Block head:78DAEDC101010000
Block tail:0000000000000000
Block 4 length 84 => 65536
Block 5 length 84 => 65536
root@ttyp0[clooptest]# dir
total 792
1 drwxr-xr-x 4 root root 352 May 8 18:06 .
2 drwxr-xr-x 27 root root 1544 May 8 17:33 ..
1 drwxr-xr-x 4 root root 120 May 6 19:35 rootdir
4 -rw-r--r-- 1 root root 2327 May 8 18:02 rootdir.clp
384 -rw-r--r-- 1 root root 393216 May 8 18:06 rootdir.exp
372 -rw-r--r-- 1 root root 380928 May 8 18:00 rootdir.iso
[Seems it may have worked, but notice the different size.
And everything in one file still.]
[ Made a directory 'expanded', then ...]
root@ttyp0[clooptest]# losetup /dev/loop1 rootdir.exp
root@ttyp0[clooptest]# cp /dev/loop1 expanded/
root@ttyp0[clooptest]# dir expanded
total 385
1 drwxr-xr-x 2 root root 72 May 8 18:10 .
1 drwxr-xr-x 4 root root 352 May 8 18:06 ..
384 -rw------- 1 root root 393216 May 8 18:10 loop1
[ Not what we wanted. ]
root@ttyp0[clooptest]# mount /dev/loop1 /mnt/test
root@ttyp0[clooptest]# cp -Rp /mnt/test/* expanded
[ Works, as confirmed by recursive rm. ]
root@ttyp0[clooptest]# rm -R expanded/*
rm: descend into directory xpanded/john'? y
rm: remove regular file xpanded/john/john1'? y
rm: remove regular file xpanded/john/john2'? y
rm: remove regular file xpanded/john/john3'? y
rm: remove regular file xpanded/john/john4'? y
rm: remove directory xpanded/john'? y
rm: remove regular file xpanded/loop1'? y
rm: descend into directory xpanded/mary'? y
rm: remove regular file xpanded/mary/mary1'? y
rm: remove regular file xpanded/mary/mary2'? y
rm: remove regular file xpanded/mary/mary3'? y
rm: remove regular file xpanded/mary/mary4'? y
rm: remove directory xpanded/mary'? y
rm: remove regular file xpanded/tt'? y
Similar Threads
-
By nishtya in forum The Lounge
Replies: 42
Last Post: 12-13-2004, 10:55 PM
-
By lrathle in forum Customising & Remastering
Replies: 2
Last Post: 09-05-2004, 05:47 PM
-
By sabel in forum Customising & Remastering
Replies: 2
Last Post: 12-01-2003, 09:15 PM
-
By arkaine23 in forum Customising & Remastering
Replies: 2
Last Post: 07-08-2003, 05:57 PM
-
By bgristwo in forum Networking
Replies: 3
Last Post: 06-17-2003, 05:29 PM
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

Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot
$549.00

Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot
$100.00

Samsung 860 EVO 250GB SSD MZ-76E250 2.5" SATA III Solid State Drive -
$39.99

Netac 256GB SSD 2.5'' SATA III 6Gb/s Internal Solid State Drive 500MB/s PC/Latop
$40.00

Crucial MX500 1TB 2.5" SATA III Internal SSD CT1000MX500SSD1
$99.99

Crucial MX500 250GB 2.5" SATA III SSD - Preowned
$29.00

2 PACK 128 GB SSD M.2 2280 SATA Solid State Drive Major Brands, Samsung, LiteON
$28.00

Fanxiang 256GB 512GB 1TB 2TB 4TB SSD Lot 2.5'' SATA Internal Solid State Drive
$42.99

Netac 120GB 256GB 1TB 2TB Internal SSD 2.5'' SATAIII 6Gb/s Solid State Drive lot
$119.99

Netac 512GB SSD 2.5'' SATA III 6 Gb/s Internal Solid State Drive 500MB/s PC/MAC
$73.00