Mac OS 9 Lives

General => HELP BOARD ! Installing & Troubleshooting the Classic Mac OS => Topic started by: Europa on July 10, 2019, 04:52:47 AM

Title: Questions About btree Errors
Post by: Europa on July 10, 2019, 04:52:47 AM
What causes the irreparable btree errors in OS 9 Disk First Aid? I have always believed that it was caused by the coexistence of OS 9 and OS X on one partition/system, but I have recently been informed that is not the case. What causes those then and how can I prevent them? Also, if it is some component of OS X that causes them, is it a component I can remove/disable so that it won't happen?
Title: Re: Questions About btree Errors
Post by: OS923 on July 10, 2019, 06:11:52 AM
A faulty directory is the most common error on a Macintosh.

When it changes the directory, for example, when it deletes or copies files, then the changes are written to the disk cache. After some time, it may find it necessary to flush the cache, i.e. write the cache to disk.

If your computer crashes, then the disk cache may be lost, and the changes are not written to disk. This may cause that deleted files are suddenly back, or the directory points now to old versions of files that you recently updated, or your copied files are gone.

When you close a file, then it's automatically flushed. A crash will not cause the loss of this file, but the directory may now point to an old version of this file, causing the loss of this file anyway. That makes every crash an important issue.

In OS 9, the cache is not flushed frequently enough, causing many of those crashes, resulting in a sort of undo behavior. This is addressed by DiskShield. It does this by patching synchronous write. Unfortunately, this causes a flushing of the cache after every directory change, and your computer becomes very slow, especially when deleting or copying files: unbearable. This is solved simply by reducing the cache size. I choose a cache of 2 MB.

Another problem is bombs. When the bomb occurs, you have to restart, and the cache is lost. You can install a function in a program to make it react to bombs. Most programs don't have this. There are extensions like I think Bomb Shelter which install such a function in programs that don't have one. If such a function flushes all your volumes, then this sort of damage would be prevented, because it flushes all open files on that volume, including the directory file.
Title: Re: Questions About btree Errors
Post by: Europa on July 10, 2019, 10:06:01 AM
Ok, thank you so much! I will make sure to look into your suggestions. Is there anything else you would recommend before merging OS 9 and OS X installations onto the same volume?
Title: Re: Questions About btree Errors
Post by: GaryN on July 10, 2019, 03:01:28 PM
Yes: Don't. Just because you maybe can, doesn't mean you should.

I've posted many times about dual-booting OSX and OS9 and you've read some of it. I know because if I go back to the thread(s), I find comments from you there.

Re-read this: http://macos9lives.com/smforum/index.php/topic,4794.msg34474.html#msg34474

…and this: http://macos9lives.com/smforum/index.php/topic,4904.msg35349.html#msg35349

In summary, aside from the fact that 99% of the issues are caused by Spotlight and Time Machine, the fact remains that the two OS's are fundamentally incompatible and having them cohabitating the same volume is like putting cats and dogs in the same yard and hoping they just get along. While both systems theoretically know to keep their hands off of each other, there's no good reason to risk it when you only need to partition a volume to better ensure it - think of it like putting up a fence. There's no practical speed or efficiency advantage to force them both to live on the same volume, so why do it?
Title: Re: Questions About btree Errors
Post by: Europa on July 10, 2019, 05:43:49 PM
Ok, thank you. I have already disabled Spotlight entirely because I don't like it anyway. I run Tiger, so I don't have to worry about Time Machine. Do you think it would be safe enough (I do regular backups) to place everything on one volume. I know it isn't ideal, but I have some things I want to access from both OSes and it would be simpler to put them both on the same volume if possible.
Title: Re: Questions About btree Errors
Post by: FdB on July 10, 2019, 06:37:23 PM
Years and years and years of experience says…

“…the fact remains that the two OS's are fundamentally incompatible
and having them cohabitating the same volume is like putting cats and dogs in
the same yard and hoping they just get along.”

AND…

“…you only need to partition a volume to better ensure it -
think of it like putting up a fence. There's no practical speed or efficiency
advantage to force them both to live on the same volume, so why do it?”

Save yourself a lot of time and headaches. Partition that drive
and put OS 9 on one partition and OS X (Tiger) on the other.
Or don’t… and simply really wish that you had, later. ;)
Title: Re: Questions About btree Errors
Post by: GaryN on July 10, 2019, 11:02:32 PM
Thank you Fury…I couldn't have said it better myself.

Look Roger; it's your playpen. You can put whatever you want, wherever you want. All I (we) can say is that I (we) have been there - done that. Everyone's system and practices are unique. People use different software and combinations of software to do different things in different ways. Depending on what you do, how you do it and what you do it with you may have zero issues forever. OR… You may crash the system one day for an entirely unrelated reason and when you start it back up, it won't boot and you have to run either OS9 or OSX disk repair. That's when you just might encounter the wonderful world of b-tree insanity where OS9 disk repair "fixes" the directory and everything's fine - at least until the next time you boot OSX. Then, OSX decides it doesn't like the directory quite like that and so it RE-fixes it and all's well again - until you next boot OS9, and it has issues with ……do I have to go on?

All that matters is that once the b-tree gets f&$ked beyond a certain point, it becomes virtually UNrepairable without extreme recovery measures and software. This invariably happens ONLY when for some other unrelated reason, you failed to adequately back up something important and now it's gone because the only way out is to reinitialize the drive and reinstall and/or recover both OS's and files from backup.

Set your drive up any way you like. Think of it like driving around without a seatbelt. You may be just fine for a long, long time but one day you may get to meet your windshield up close and personal. So you gotta ask yourself: "Do I feel lucky?" (You know what comes next). There's absolutely no reason you can't access stuff in one partition from the other - they both just appear on the desktop in either OS so it's no more difficult at all compared to having one big volume. Hell, I have 4 drives and 9 partitioned volumes in my MDD and it helps keep things neat and orderly - like a file cabinet with multiple drawers and stuff in file folders and…and Oh Jeez! That's why they use those little picture of folders and stuff! I knew there had to be a good reason…
Title: Re: Questions About btree Errors
Post by: Europa on July 11, 2019, 04:49:21 AM
Ok, thank you. Looking at it now based on what both of you said, it does seem easier just to partition the drive. I saw something on one of the posts you referenced (which helped a lot, thank you for linking to those) that it is ideal to only access the OS X volume from OS 9. Does that hold true in this scenario, or would you say that I could access either volume from either OS?
Title: Re: Questions About btree Errors
Post by: IIO on July 11, 2019, 03:11:52 PM
What causes the irreparable btree errors in OS 9 Disk First Aid? I have always believed that it was caused by the coexistence of OS 9 and OS X on one partition/system, but I have recently been informed that is not the case. What causes those then and how can I prevent them? Also, if it is some component of OS X that causes them, is it a component I can remove/disable so that it won't happen?

i would put it like this: OSX is not causing the issue, it is the issue first in line.

sharing volumes full of data between different OS is usually not a problem, but you should never repair a volume or dirfectory from an actually OSX system from OS9, first of all because fiddling with it under OS9 can damage the OSX install and render it useless.
Title: Re: Questions About btree Errors
Post by: GaryN on July 11, 2019, 05:53:32 PM
Ok, thank you. Looking at it now based on what both of you said, it does seem easier just to partition the drive. I saw something on one of the posts you referenced (which helped a lot, thank you for linking to those) that it is ideal to only access the OS X volume from OS 9. Does that hold true in this scenario, or would you say that I could access either volume from either OS?
I'm going to quote myself from a previous post:
"You can always move files between OSX volumes and OS9 volumes without issues as long as you do it in OS9.
While you can move files without issues from OSX to OS9 in OSX, occasionally the Linux-derived OSX permissions will trip the wrong flag in OS9 and lock the file down. In my experience though, I've never had a problem moving a file in either direction while in OS9."

I am honestly not certain exactly how this happens. It seems to be dependent on the file type and also where the file may have been previously. In my experience, it seems to be less likely to happen to simple files (text, AIFF, TIFF) that are not tightly associated to an owner or app. BUT: For instance, say you download a file from somebody that was created in OSX and has sharing permissions set to "read-only" or such. Dumping that in OS9 may - not always, but may cause that file to be "seen" as not yours. Now you find you can open it, read it, maybe even copy it but you can't move it to another folder, delete or modify it in any way in OS9. The really sucky part is now both the original AND the copy are stuck on your OS9 desktop and you can't even delete the damn thing in OS9 or even if you go back to OSX and try from there! I suspect OSX doesn't know what to do with the file in OS9 because it either can't find the OS9 trash, or it too now "sees" the file as NOT yours and won't delete it and on and on.

It may also be related to the fact that the OS9 desktop folder is invisible. I have successfully deleted "stuck" files like this using a utility to make the desktop folder visible from a different boot of OS9 on another drive but it's a pain in the ass. All I really know is that it's A: Unpredictable B: Frustrating C: Did I mention it's a pain in the ass? This issue does (can't be certain) seem to be far more likely to happen with, as I mentioned, "alien" files rather than files created by me (you) but it's something to be aware of. Just don't do anything in OSX that might cause the ownership of a file to change while it's "away" from OS9.
What I also know it that this is all simply because OS9 probably never heard of Linux and definitely never heard of OSX and its Linux-derived multiple kinds of permissions, so it can get easily confused. Although I did once say, as quoted above, that it seems less likely to have an issue develop if you only use OS9 to move files between the two OS's I honestly can't swear that's a fact. This is the kind of random thing that doesn't happen for a long time, so you forget all about it and then…

Note that this crap does not happen using Tiger and Classic because the OS9 Classic runs in a sort of sandbox under 10.4 so there's never an OS9 System in charge and everything "belongs to" Tiger. This is an anomaly only seen (I think) on pre and post OSX dual-boot Macs.
Note also that it took Apple years to sort out OSX permissions issues. If you've run PPC versions of OSX you know how many times you've watched the little watch face while it took forever to "repair disk permissions". It's not surprising to me that a little of that confusion might spill back over onto OS9.

So: Be careful with foreign files: Verify their permissions are all set to "everybody" before transferring them to OS9 and don't do anything to change permissions to an OS9 file while it's open in OSX.
Title: Re: Questions About btree Errors
Post by: Europa on July 11, 2019, 06:28:48 PM
Ok, thank you all for your help. This has been enlightening and I can now transfer files without an intermediary drive. :D
Title: Re: Questions About btree Errors
Post by: IIO on July 13, 2019, 04:02:42 PM

"You can always move files between OSX volumes and OS9 volumes without issues as long as you do it in OS9.
While you can move files without issues from OSX to OS9 in OSX, occasionally the Linux-derived OSX permissions will trip the wrong flag in OS9 and lock the file down. In my experience though, I've never had a problem moving a file in either direction while in OS9."


strange enough, i had never had such issues with files created on my own system(s).

but i have seen it with third party files, which i received compressed over a network (made on 10.4 - 10.9)

sometimes it helped to make a copy of the file, sometimes i first had to transfer it over a network connection to make a copy.

more often i see files which refuse to keep position or which may not be renamed (despite that their name locked flag wasnt set). but this happens under 10.4 too and not only in OS9.
i solve it by remaning such files using filebuddy, after that its free from alien control again.
Title: Re: Questions About btree Errors
Post by: GaryN on July 13, 2019, 07:44:07 PM
As I said, that stuff happens randomly and since I've never done a comprehensive analysis, or any analysis to speak of, all I can be reasonably sure of is that it's connected to OSX vs. MacOS permissions. I did do a test with a problem file I had obtained from somewhere. Having copied it from OSX to OS9 IN OSX, it appeared on my OS9 desktop locked. I then copied it again while in OS9 and that copy appeared on the Desktop NOT locked. It's an oddity that doesn't happen often at all and indeed is not the original subject of this thread. My best guess is it requires you to obtain a file with OSX permissions set in some configuration that cause an issue in OS9 if you just dump it there. It probably can't happen at all with a Stuffit archive. It's obviously NOT a common problem.