I am trying to get to the bottom of why, since upgrading to Lion, it takes so long to log in (or log out) when my machine has been idle for some time [but not sleeping]. Hardware is MacPro1,1 - 4x3.0Ghz with 12GB Memory. Storage is an Apple Raid Card with 4 500GB WD5000AAKS drives (internal), 1TB WD MyBook Premium Edition II (FW800), and an OWC Mercury Elite-AL Pro Qx2 - 4x1TB/RAID 5 (FW800). Note that because of the Apple Raid Card this machine never sleeps [limitation of the card] - but the external drive do go idle and spin down as set in Energy Saver preferences.
System and home directories are all on the internal RAID array.
The delay on login or logout is about 20 seconds, and appears to be due to the system waiting for my external disk drives to spin up. So, I set up opensnoop and fs_usage to run in the background, and see what was being accessed on those drives at login / logout time, and by which processes.
Login:
Logout:
Anyone care to comment? Any ideas?
Spidey!!!
System and home directories are all on the internal RAID array.
The delay on login or logout is about 20 seconds, and appears to be due to the system waiting for my external disk drives to spin up. So, I set up opensnoop and fs_usage to run in the background, and see what was being accessed on those drives at login / logout time, and by which processes.
Login:
- I found that the first culprit is Finder - which is not only looking for the list of drives connected, but also trying to open a file called ".hidden" in the root directory of each drive. It appears likely that Finder is blocking on this, and login cannot proceed until it has discovered the non-existance of these files. Does anyone know what ".hidden" does, why Finder is looking for it, and whether it is possible to suppress this behavior?
- Process "loginwindow" is doing a lot! It seems to be scanning ".TemporaryItems" and ".Trashes" folders on every disk at the moment of login. I understand ".Trashes" - but why would there be ".TemporaryItems" on EVERY disk?
- The second offender is fseventsd - which starts accessing files in "/.fseventsd" on each disk when I log in. I don't think this is really a problem - it is the filesystem events daemon, and presumably would have nothing to do if the disk had not been spun up for other reasons. On the other hand I do notice that it occasionally opens up files on my Time Machine disk even when backup is not running...
- Finally I see mds [Spotlight indexer] accessing this disk -- but this is not until later, and I do think it is the blocker.
Logout:
- Finder again is messing about, attempting to open "/Volumes/Time Machine/Backups.backupdb/Contents" - which does not exist. "/Volumes/Time Machine/Backups.backupdb" directory does exist, does not contain an item named "Contents". It is also looking for ".DS_Store" in the same directory, which likewise does not exist.
- Everything which "loginwindow" did on login, it is also doing on logout.
- Again, fseventsd is opening a file in "/.fseventsd" on each disk
Anyone care to comment? Any ideas?
Spidey!!!