Subject: Re: Apple Double?

From: Joerg Bullmann <[email-masked]>
Date: Fri, 7 Apr 2000 17:58:46 +0800

Hi Bill and all,

My god, I half got a heart attack reading this
thread!!!!!! Guys, be very very careful!

     DO NOT DELETE .APPLEDOUBLE STUFF

It is totally up to the applications what they
store in the resource fork (RF) and what in the
data fork (DF). And the RF is stored in .AppleDouble
files.

Bill, you are lucky that you only "cleaned up"
HTML's, JPG's, and a few GIF's. In those files,
usually nothing "important" is stored in the RF.
In text files you e.g. have the scroll and cursor
position. Photoshop adds custom icons (thumbnail
pix) and stuff like that.

But there are files that contain almost all their
contents or big parts it in the RF. Had it been
files like that, you would have been stuck
with mutilated and useless file carcasses. ;-|
Applications for example totally break if you
remove their R.

Look at it a bit like this; "I'll truncate all
files I have to multiples of 4096 so they fill
my hard disk more efficiently". You wouldn't do
that either.

I would recommend to not touch, change or remove
the .AppleDouble pendants of the files on netatalk
volumes. Resource data is "data" as well and noone
should assume it is redundant stuff.

Admittedly there are situations, where you want to
clean up stuff and dance with the big broom through
parts of your file systems. Do it with utmost care
though. TEXT, GIF, JPEG, and file formats that "live"
on the web (i.e. can be viewed directly through web
browsers) are usually safe, because browsers and
web servers don't know RF's.

In any case, do some testing first!

In general developers tend to move away from storing
stuff in the RF, probably for cross platform compati-
bility reasons (e.g. Macromedia's Dreamweaver project
files can be directly interchanged between Windows
and Mac; they only could this get this to work by
not using the Mac's RF because there are no RF's in
Windows). But I wouldn't let this tendency make me
go careless...

I hope I didn't miss anything, and I also didn't
want to sound LOUD. But we're talking really
dangerous stuff here, and I haven't read anything
in this thread that made my point explicitly enough:

     *GENERAL* rule is not that you *should*
     keep the RF of the files but that you
     *MUST KEEP IT*.

Others please correct me. It might be a bit on the
dogmatic side, but I hope this saves the odd hour
restoring broken files... ;-)

Joerg

---

From: Philip Bertuglia <[email-masked]>
Date: Fri, 07 Apr 2000 08:01:19 -0400

I agree 100%!

But, what do you do when you upgrade from an older version of afpd and the 
new afpd can NOT pars the old .ApppleDouble files? The answer, because what 
you said about the .AppleDouble files is correct, your basicaly stuck 
running the old binary until you figure out how to convert the old files. 
This is not easy to do on a production box.

This Monday, the older netatalk package I was running on a Linux 2.2.13 
kernel quit on me. Client Macs would totally lock up when trying to 
authenticate. The latest version on netatalk had no problems with 
authentication but the obove problem persisted. Being under the gun like I 
was, I figured out how to convert these old .AppleDouble files quickly and 
with very little down time. If you need this procedure please ask me for it.

phil
[email-masked]

---

From: Patrik Schindler <[email-masked]>
Date: Fri, 7 Apr 2000 14:30:29 +0200

At 8:01 Uhr -0400 07.04.2000, Philip Bertuglia wrote:

>new afpd can NOT pars the old .ApppleDouble files?

I saw this messages in syslog but never had a problem with this.

>The answer, because what 

I resolved this problem with a Mac-Copy from the whole server to another (the latter with a newer version of netatalk).

:wq! PoC

---

From: Philip Bertuglia <[email-masked]>
Date: Fri, 07 Apr 2000 12:22:24 -0400

Procedure for converting old .AppleDouble files.

1. Build a temporary server and install the old version of netatalk on it

2. Stop netatalk on the production box running the old version of netatalk 
and install the latest version.
     Do not allow any use of your normal netatalk shares until this is done.

3. mount a separate external HD on your scsi chain (if you can)
     OR create a directory on a partition big enough to hold all of the 
.AppleDouble files you need to convert

4. copy all of the .AppleDouble directories to this external HD or new 
directory
     I used:
find /usr2 /usr3 -type d -name .AppleDouble -exec cp -a -P {} 
/mnt/appledouble_old \;

5. mount this HD on the temporary system or ftp this directory onto the 
temporary server from step 1.

6. on the temp server, touch files of the same name as the .AppleDouble 
files, one directory higher than the .AppleDouble directory itself. I used:

find /mnt/appledouble/usr3/  /mnt/appledouble/usr2 -type f -fprint 
/tmp/files_to_touch

    then

sed s/"\\.AppleDouble"/./ /tmp/files_to_touch > /tmp/infile

    then

./touch_these < /tmp/infile

++++ BEGIN ./touch_these ++++++
#!/bin/bash
while [ 1 ]
do
   read FILE
   if [ -z "$FILE" ]
   then
     echo done.
     exit 0
   fi
   touch "$FILE"
done
++++ END ./touch_these ++++++++

7. setup a netatalk share called NEW and OLD on the production box running 
the latest version of netatalk and the temp server running the old version 
of netatalk respectively. The NEW share should mount to an empty directory 
that has enough room for all of the .AppleDouble files and the zero length 
data files (they do use up a block).

8. with a fast Mac client, drag the contains of the OLD share into the NEW 
share.

9. replace the .AppleDouble files with the one you just created one the 
production box. I used:

cd /mnt/appledoublenew   <----- this is the mount point of my NEW share

find ./usr2 ./usr3 -type d -name .AppleDouble -exec cp -v -R -P {} /  \;

10. setup all of your old shares on you production box and restart netatalk.

DONE

If you have any question please feel free to ask.

Philip Bertuglia
Systems Administrator
Wheaton College