An odd thing happened to me today, my camera was saying my 1GB memory stick was full, but I had only a few dozens of pictures on it. The solution did not occur to me right away so I thought I would bring it up here.

My first reaction was rather Pavlovian, I must admit. Disk full? Alright, I'll delete some files! but clearly, there was no way my few pictures were responsible for the loss of a full giga of disk space :) I then took a more rationale approach of looking at the memory stick info as shown on a Mac (Cmd-I).

Could it be that sectors of the fash memory had gone bad and been disabled? --I do not even know whether this makes any sense but I did ask myself that question. Apparently not, my GB of disk space is there and used by 914MB of stuff. Could it be that I copied data onto the stick without knowing/remembering it? Apparently not, when I open the memory stick inside Apple Finder, all the directories (root, DCIM and MISC) are empty. There's gotta be hidden files! I'm thinking. Since I cannot find some "show hidden files" check-box in the Finder's Properties (Cmd-,), I quickly open a Terminal and cd to the memory stick volume.

It turns out my Mac had been moving to a local trash directory all of the picture files I had copied away and/or deleted (Cmd-Enter) ever since I switch from a Windows to an Apple laptop. On Windows, the behavior is that files (on removable media) are deleted permanently. I learned today this is not the case on a Mac.

$ cd /Volumes/CYBERSHOT/ $ ls -la total 384 drwxrwxrwx 1 user group 16384 Sep 18 18:43 . drwxrwxrwt@ 11 root admin 374 Sep 18 18:42 .. drwxrwxrwx@ 1 user group 32768 Jun 15 2008 .Trashes -rwxrwxrwx 1 user group 4096 Jun 15 2008 ._.Trashes drwxrwxrwx 1 user group 32768 Sep 18 18:43 .fseventsd drwxrwxrwx 1 user group 32768 Jul 2 2006 DCIM -rwxrwxrwx 1 user group 0 Jan 1 1970 MEMSTICK.IND drwxrwxrwx 1 user group 32768 Jul 2 2006 MISC -rwxrwxrwx 1 user group 0 Jan 1 1970 MSTK_PRO.IND $ du -ks .Trashes 913964 .Trashes $ rm -r .Trashes