Page 1 of 1

Discs and drives: best approaches? some specifics...

Posted: Tue Jan 29, 2019 2:02 pm
by cwinte
Hi,
I realise I am unclear about the best way to check for and fix any disk errors that might be found in the SS emulated world.
I have been using Edwards ready built 64bit SS based MacOS9 and moved my databases in there from ChubbyBunny where they had been for some years.
I was looking into the sparse bundle and backups of my MacOS9 configuration and noticed there seemed to be some errors, maybe, in the bundle. Working on backups I tried various things to investigate and maybe fix.

First major choice was to do it from within OS9 using a number of Apple or 3rd party tools I have used over the centuries (starting in 19xx). Well I started in host MacOS 10.11 since this is where I want to copy and preserve my data and figure I have the latest tools especially if I end up need AFPS etc in the mix (where i am also making moves towards moving to Mojave if I can assure myself on a few points first...)

I had been moving a fair bit of files around in the OS9 virtual system drive, and it seemed a good idea to look at empty trash and maybe "hdiutil compact" the host sparse image at
/Applications/MacOS9/Mac\ OS\ 9.app/Contents/Resources/Files/MacOS.sheepvm/MacOS9.sparsebundle
(FIRST MAKING SURE SS/MACOS 9 WAS CORRECTLY EXITED)
I got a first worry with the response:
Starting to compact…
Reclaiming free space…
hdiutil: compact failed - internal error

SS/ OS9 still runs up OK... a bit of research leads me to try
hdiutil attach -nomount -noverify -noautofsck <the MacOS9.sparsebundle>
that produced:
/dev/rdisk4s2: fsck_hfs started at Tue Jan 29 12:49:22 2019
/dev/rdisk4s2: /dev/rdisk4s2: ** /dev/rdisk4s2 (NO WRITE)
/dev/rdisk4s2: Executing fsck_hfs (version hfs-305.10.1).
QUICKCHECK ONLY; FILESYSTEM CLEAN
/dev/rdisk4s2: fsck_hfs completed at Tue Jan 29 12:49:22 2019

Not much else going on so run up ElCap's Disk Utility, see the container drive, see the active MacOS9 volume within it and so run Repair/Check on that:
/dev/rdisk4s2: fsck_hfs started at Tue Jan 29 12:52:39 2019
/dev/rdisk4s2: /dev/rdisk4s2: Executing fsck_hfs (version hfs-305.10.1).
/dev/rdisk4s2: ** Checking non-journaled HFS Plus Volume.
/dev/rdisk4s2: The volume name is MacOS9
/dev/rdisk4s2: ** Checking extents overflow file.
/dev/rdisk4s2: ** Checking catalog file.
/dev/rdisk4s2: Invalid BSD file type
/dev/rdisk4s2: Invalid BSD file type
/dev/rdisk4s2: Invalid BSD file type
/dev/rdisk4s2: Invalid BSD file type
/dev/rdisk4s2: Invalid BSD file type
/dev/rdisk4s2: Invalid BSD file type
/dev/rdisk4s2: Invalid BSD file type
/dev/rdisk4s2: Invalid BSD file type
/dev/rdisk4s2: ** Checking multi-linked files.
/dev/rdisk4s2: ** Checking catalog hierarchy.
/dev/rdisk4s2: ** Checking volume bitmap.
/dev/rdisk4s2: ** Checking volume information.
/dev/rdisk4s2: ** Repairing volume.
/dev/rdisk4s2: ** Rechecking volume.
/dev/rdisk4s2: ** Checking non-journaled HFS Plus Volume.
/dev/rdisk4s2: The volume name is MacOS9
/dev/rdisk4s2: ** Checking extents overflow file.
/dev/rdisk4s2: ** Checking catalog file.
/dev/rdisk4s2: ** Checking multi-linked files.
/dev/rdisk4s2: ** Checking catalog hierarchy.
/dev/rdisk4s2: ** Checking volume bitmap.
/dev/rdisk4s2: ** Checking volume information.
/dev/rdisk4s2: ** The volume MacOS9 was repaired successfully.
/dev/rdisk4s2: fsck_hfs completed at Tue Jan 29 12:52:39 2019

Sounds OK but now that copy will not start-up fully, flashing floppy icon and must force quit.

SO MY QUESTIONS?
What is the "best way" to delete files and tidy up / back up the config?
What are the ways and consequences of the various ways of looking at the disk drive?
In the event of corruption / data loss etc what is the best way to move forward?

Thanks for your time and hope this helps more than just myself!

Re: Discs and drives: best approaches? some specifics...

Posted: Tue Jan 29, 2019 6:48 pm
by adespoton
Having similar configurations, this is what I do:

I run Disk First Aid from within OS 9 after emptying the trash.

I use my sparserbundler script instead of compacting the sparse bundle (sparserbundler creates a new sparsebundle with 2mb partitions instead of using the compact flag -- the result is the same, but creating a new one means the old one's still there if something goes wrong).

I use Time Machine to back up the sparse bundles, so I can roll back to the previous known-good version when needed.

Using this approach, I haven't had a permanently fatal situation since I started using sparse bundles (back in 2011?).

When attempting repairs or tweaks, always start from the inside and work your way out; and ALWAYS back up and run Disk First Aid before compacting an image.

Re: Discs and drives: best approaches? some specifics...

Posted: Wed Jan 30, 2019 4:15 am
by emendelson
A few weeks ago I had exactly the same problem reported by cwinte - I was updating the MacOS9 app and found disk corruption in the copy I was using, and tried fixing it by various method - and the High Sierra disk utility produced exactly the same unbootable disk image.

I restored from a backup, and used the Sparsebundler app (as described above) to compress the image.

As reported in the first post, I had a disk image that booted correctly and the only problem I saw was when I tried to compress it and couldn't - and then I tried using Disk Utility to fix it, and got the unbootable image as a result.

EDIT: And I see that hdiutil compact fails with a freshly-made disk created by the SparserBundler app, so there seems to be something wrong with hdiutil, not with the disk image.

Need a secure file system base for long term data security

Posted: Wed Jan 30, 2019 10:52 am
by cwinte
That test of a fresh image reporting problems sounds VERY worthy of further investigation by someone who really knows what is going on and needed, for now and future AFPS etc.
I did wonder if the issue I saw was there from early on or I had introduced it somehow.
I strongly feel we need an image system that can handle removal of files and trimming down the sparse image size, though I will take steps to minimise file deletion on the system image from now on (at least until I know this is resolved!)...

I'd really like to smooth out this sort of issue as I need and expect to run my very old accounts database in this environment for 10 years or more, and thus onward into the pure 64 bit world... My data goes back to 1994 and l would like to keep it rolling along!

Any ideas about how/who to push this along with?

Re: Discs and drives: best approaches? some specifics...

Posted: Wed Jan 30, 2019 11:23 am
by cwinte
adespoton wrote: I use my sparserbundler script instead of compacting the sparse bundle (sparserbundler creates a new sparsebundle with 2mb partitions instead of using the compact flag -- the result is the same, but creating a new one means the old one's still there if something goes wrong).
....
Sounds good to look at but only found 1 other ref in the forum and no link to it... (feel like I should have turned it up) can you give me URL or clue? [apologies if I missed something obvious]

Re: Discs and drives: best approaches? some specifics...

Posted: Wed Jan 30, 2019 12:55 pm
by emendelson
I should have made clear that hdiutil compact fails on a fresh sparsebundle made from an existing disk from the MacOS9 system, using the SparserBundler utility to create the disk. So there may be something wrong with that disk image that I don't know about.

Re: Discs and drives: best approaches? some specifics...

Posted: Wed Jan 30, 2019 5:41 pm
by adespoton
The difference in methods here is that if you use hdiutil compact, it attempts to move data around on the original image to free up slack space for compression; sparserbundler instead uses hdiutil to create a new sparse bundle with small slice files, so data doesn't need to be moved around; instead, any part of the original image containing a 2MB chunk of slack space just won't be written out.

So if something in the partition map is wonky, compacting the original image will break it, but converting it to a 2MB slice sparsebundle will preserve the partition layout as it is and just drop the bits of the drive that have no readable data on them. This also means that any fragmentation is preserved, which compact will clean up.

If one of you still has an original copy of the drive image and wants to experiment with Norton Utilities to run a repair and defrag inside OS 9, that might reveal what's actually going on here with the original images.

Re: Discs and drives: best approaches? some specifics...

Posted: Wed Jan 30, 2019 7:23 pm
by emendelson
adespoton wrote:If one of you still has an original copy of the drive image and wants to experiment with Norton Utilities to run a repair and defrag inside OS 9, that might reveal what's actually going on here with the original images.
Norton Disk Doctor (vintage 1999) seems to lock up SheepShaver. Probably it searches for real hardware and doesn't find it.

Re: Discs and drives: best approaches? some specifics...

Posted: Wed Jan 30, 2019 8:21 pm
by adespoton
Right; I forgot about that. I seem to recall a tool that successfully worked, but it's probably easier these days to just spin up a new clean and formatted image and copy everything over.