Subject: Re: find question
To: None <netbsd-help@netbsd.org>
From: Georges Heinesch <geohei-ml@geohei.lu>
List: netbsd-help
Date: 06/05/2001 20:14:37
Quoting Frederick Bruckman (03-Jun-01 15:54:57):
> On 3 Jun 2001, Georges Heinesch wrote:
[...]
>> I got the answer now via e-mail (from Wolfgang Solfrank).
>>
>> An empty (newly created directory) in NetBSD has a linkcount of 2.
>> If it's filled, it's +2. The iso 9660 standard usually burns CD
>> with a linkcount of 1.
>>
>> find sees 2 (with my CD, creating the problem) and stops searching
>> since 2 means an empty directory. If !=2 is found, the recursive
>> routine inside find starts.
>>
>> Here what ls -ld /mnt/cd0 says with the CD in question inserted and
>> mounted!
>>
>> # cd /mnt/CD0
>> # ls -ld
>> # drwxrwxrwx 2 root wheel 2048 Mar 1 14:23 .
>>
>> Here a properly mastered iso 9660 CD.
>>
>> # cd /mnt/CD0
>> # ls -ld
>> # dr-xr-xr-x 1 root wheel 2048 Sep 15 2000 .
>>
>> That's te reason ...
> Thanks for the excellent followup! I still have a couple of
> questions, if you don't mind...
> 1) On the bad CD, what does "ls <mountpoint>"
# ls /mnt/cd0
#
> and "cd <mountpoint>;
> ls; cd <somedir>; ls; find" give?
# cd /mnt/cd0:
# ls -l
total 8
drwxrwxrwx 2 root wheel 2048 Feb 28 16:50 Art
-rw-rw-rw- 1 root wheel 2098 Jul 30 1998 Disk.info
drwxrwxrwx 2 root wheel 2048 Feb 28 17:01 Misc
drwxrwxrwx 2 root wheel 2048 Feb 28 09:49 NetBSD
# cd NetBSD
# ls -l
total 18
-rw-rw-rw- 1 root wheel 611 Nov 28 2000 .message
drwxrwxrwx 2 root wheel 2048 Feb 28 09:49 NetBSD-1.4.3
drwxrwxrwx 2 root wheel 2048 Feb 28 09:47 NetBSD-1.5
-rw-rw-rw- 1 root wheel 1483 Nov 28 2000 README
-rw-rw-rw- 1 root wheel 266 Nov 28 2000 README.NetBSD-1.0-1.3.1
-rw-rw-rw- 1 root wheel 611 Nov 28 2000 README.export-control
-rw-rw-rw- 1 root wheel 12432 Nov 28 2000 README.sup
# find . -name syssrc.tgz
# find . -name README.sup
./README.sup
"syssrc.tgz" exists in a subdirectory.
> In other words, is the CD
> apparently empty by all accounts, or is it really only a problem
> with "find" on the mountpoint?
It's a problem with "find"
> 2) What _is_ the wrong way to burn a CD on NetBSD? The right way?
Wrong: linkcount of 2 when the directory is not empty.
Right: 2 possibilities:
1. the correct linkcount, which is not supported AFAIK by
ISO 9660.
2. linkcount 1
Regards.
--
Cu Georges Heinesch, Luxembourg
geohei@geohei.lu
http://www.geohei.lu
PGP RSA & DH/DSS public key on request and on public servers
... never touch a running system ...