data corruption when reading from a mount_cd9660 filesystem

From: <current1_at_BuggerIT.com.au>
Date: Tue, 11 Nov 2003 19:43:31 +1100
G'day,

It appears that files with size greater than 65536 bytes when read from
a cd9660 mounted filesystem appear corrupted.
Happens on any cd-rom I try regardless of where it was burnt,
even the original 5.1-RELEASE-i386-miniinst.iso now appears corrupt.


# uname -v
FreeBSD 5.1-CURRENT #0: Sat Nov  8 16:19:16 EST 2003...
kern.osreldate: 501113

# atacontrol list
ATA channel 0:
    Master: acd0 <PHILIPS DVD+RW SDVD6004/1.03> ATA/ATAPI rev 5
    Slave:       no device present
ATA channel 1:
    Master:  ad2 <IC25N060ATMR04-0/MO3OAD0A> ATA/ATAPI rev 6
    Slave:       no device present

# atacontrol mode 0
Master = UDMA33 
Slave  = BIOSPIO

Test data:
1. Copied /lib /libexec /etc (others) to directory from which to make an ISO.
2. Made an ISO image using:
# /usr/local/bin/mkisofs -b boot/cdboot -no-emul-boot -c boot.catalog \
                         -r -J -V FreeBSD_51 -o freebsd51.iso .                      
3. Burnt it to CD:
# /usr/sbin/burncd -f /dev/acd0 -s 8 data freebsd51.iso fixate

Test #1, read filesystem from mounted CD shows corruption:
# mount_cd9660 /dev/acd0 /cdrom
# diff /cdrom/lib/libc.so.5 /lib/libc.so.5
Binary files /cdrom/lib/libc.so.5 and /lib/libc.so.5 differ
# diff /cdrom/etc/services /etc/services
1912,1914c1912,1970
< www-dev               2784/tcp   #world wide s^_at_^_at_^_at_t^_at_^_at_^
..more garbage...
< ^H                0000000000000000_at_^_at_^_at_^_at_\xc3\xbf\xff\xff\
e7^O^H^E^_at_^_at_^_at_^Y^_at_^_at_^_at_}^_at_^_at_^_at_^_at_^_at_^_at_^_at_^Q^_at_^_at_^_at_\xa0\xf1^O^H^_at_^_at_^
_at_^_at_^_at_^_at_X client-server protocol
---
> www-dev               2784/tcp   #world wide web - development
> www-dev               2784/udp   #world wide web - development
..

There are numerous other differences, for example,
# strings /cdrom/lib/libc.so.5
shows data I found in /usr/ports/devel/boost/pkg-plist


Test #2, read filesystem from mounted ISO image, shows CD data is OK:
# dd if=/dev/acd0 of=cdrom.iso bs=2k
189376+0 records in
189376+0 records out
387842048 bytes transferred in 188.299548 secs (2059708 bytes/sec)
# mdconfig -a -t vnode -f /home/iso/cdrom.iso -u 4
# mount_cd9660 /dev/md4 /cdrom
# diff /cdrom/lib/libc.so.5 /lib/libc.so.5
and
# diff /cdrom/etc/services /etc/services
shows files are equal.

regards, Taras
Received on Mon Nov 10 2003 - 23:44:29 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:28 UTC