InfiniteMac OSx86

InfiniteMac OSx86 (http://infinitemac.com/forum.php)
-   10.X (http://infinitemac.com/forumdisplay.php?f=36)
-   -   Guide: Creating a very safe OS X system (http://infinitemac.com/showthread.php?t=1234)

naquaada 07-17-2008 12:56 PM

Guide: How to create a very safe Mac OS X system

This should be a guide for a very safe OS X system. I'm using it since my first OS X installation in 2006 and so I saved a lot of reinstallations. It makes a lot of use of the Disk Utility, so it won't work correctly with all Tiger versions since 10.4.8 because the Disk Utility is faulty there.

The system is based on two boot partitions and one storage partition, so if one fails you can boot with the other and repair it from there without needing to boot from the DVD in single user mode or something else. If a partition crashed totally, you can easily restore it with the Disk Utility.

naquaada 07-17-2008 01:05 PM

1. Setting up the HD drive

You need a full seperate harddisk for this type of system, not too small. I'm using 320 GB IDE harddisks for booting, IDE is often faster as SATA. I wouldn't recommend IDE harddisks larger as 400GB.

Boot from your favourite installation DVD, select your language and wait until the menu bar is available. Select the Disk Utility in the menu. After it's open and your HD is recognized, click on it and select 'Partition' on the right side. Select your partition map, the most common is MBR. Now choose in 'Volume Scheme' 3 Partitions. You'll get three partitions the same size. Resize the partitions to the following sizes, beginning at the last partition:

3rd partition: 30,90 GB
2nd partition: 15,90 GB
1st partition: The rest of it.

This is for a 320 GB harddisk, on smaller harddisks you can vary the sizes, but don't make them to small. The 2nd partition should be not smaller than 10-12 GB, the third should be at least 20 GB. If you're wondering about this ,90 at the end: On Tiger my second partition was 7,90 GB so that it could fit on a double-layer DVD. For Leopard the partition had to be bigger, but I kept the ,90 at the end. You don't have to do this.

For the names I use for the first partition 'Leopard', for the second 'Recovery' and for the third 'Shared'. I will use these names in the guide from now on. You can change them, but I would recommend not to use Spaces because it's more difficult in use with the Terminal. After you are finished click on 'Apply'. It all went fine you'll get a partition table like this:

http://naquaada.na.funpic.de/naq/osx...m_diskutil.jpg

I also want to say that you can't partiton the drive earlier from a working OS X system because the Disk Utility works a bit different in the Installation DVD. You'll see this because the partitions have a different size after partitioning. The 2nd partition 'Recovery' will be bumped from 15,90 to 16,03 GB, the 'Shared' partition will be lowered from 30,90 GB to 30,65 GB. Only the main partition 'Leopard' will stay the same size, 251,42 GB on a 320 GB harddisk (which has an effective space of 298,1 GB).

Now reformat the partitions using the security option 'Zero out Data'. This removes all existing data, checks the harddisk and every block of the disk came in touch with the HFS+ file system. This can take a while, so you can do something more important than staring of the blue format process bar ;-)

naquaada 07-17-2008 01:48 PM

2. Installation

Install OS X first on the Leopard partition and configure it a bit, but don't spend too much work on it. After this install again on the Recovery partition. Hmmm... what's the sense of this? So I have to do twice an installation and twice the work? Don't judge too early, we haven't just started.

Now begin to install the Recovery partition. Configure it much better, especcially system-based. Establish the Internet connection and download ASU. Update your system and the kernel. If something wents wrong, you can boot in the Leopard partition using the Darwin boot selector and try to repair the error from there. If it's not possible, you have to install again. Install some very neccessary software, f.e. your favourite browser and I always recommend Onyx for cleaning the system.

naquaada 07-17-2008 02:06 PM

3. Creating the first Backup

If you think the system is fine, restart and boot into the Leopard partition using the Darwin boot selector. Note: You can easily see from which partition you booted: The drive icon is always on the top. Start Disk Utility and select the Recovery partition. Now use either the button 'New image' from the toolbar or use it in the menu 'File -> New -> Disk Image from diskXs2 (Recovery)'. Now a save requester opens. If you don't have the path options, use the triangle right to the file name.

http://naquaada.na.funpic.de/naq/osx...kutil_save.jpg

The image format 'compressed' is selected by default. If you use Onyx and activate the hidden Disk Utility options you'll get a bzip2-compression which is much more effective. Now select the Shared partition and best create a folder 'Disk Images' on it. Save the image in there, name is f.e. '10.5.x Recovery 1' and/or the date. I only use a number because at the beginning you create more than one version at one day.

The generating on the image can take a while depending on the partition size and your processor. After it's successfully finished, select in the Disk Utility's menu the option 'Images -> Scan Image for Restore'. This option is neccessary in Leopard, in Tiger you didn't need it. It checks the image if its valid. If there was an error during the check, try again to create an image. If this also wasn't working, try the repair option of the Disk Utility or boot back into the Recovery partition and use Onyx. But I only had once error at all on more than 20 backups, and it worked correctly after the second try. A compressed image from this installation (which is about 7 Gig or more) should be about 2,5 GB, so it would easily fit on a DVD.

naquaada 07-17-2008 02:24 PM

4. Optmizing the Recovery partition

Now you can continue optmizing your Recovery partition. I recommend to use the standard Apple background pic so that you can differentiate it from your main partition with a custom background picture. I always use these things to optimize a system.

- Remove unneccessary kexts

Removing unneccessary kexts saves space on the harddisks and could speed up booting. Especcially graphics card kexts could be removed. I have an ATI Radeon X1600, so I can remove all Geforce* kexts, all NV* kexts and all ATI kexts except ATINDRV.kext and the ATIRadeonX1000* kexts. It is also possible to remove AppleHWSensor.kext and ALF.kext. But - backup them. For this you can use again the Shared partition. But you can optimize it a bit more. Create with Disk Utility (again this tool) an empty Disk Image with the type 'sparse disk image'. This is a disk image which needs only so much space on disk which is needed. The advantage of using a disk image instead of a folder is that every kext (which are containing much more files) don't use a single entry in the directory, they will only stored in this disk image. Best use a subfolder 'Extensions' because you can backup more system data in there. Tip for creating an portable image: create an sparse image size with the size of 4095 MB. So the image will never reach the 4 GB border, which is the maximum file size for FAT32 (standard for external drives), and you can use the HFS+ filesystem on an FAT32 formatted drive.

- Editing system files

Editing system files directly in the /System/Library or /Library folders can be difficult because of the permisisions. For this you could again use the Shared partition. Copy the file you want to edit (f.e. com.apple.boot.plist) to this partition, now you can edit and save it without problems. Then copy it back to it's original place (you have to authorize) and repair the permissions with Disk Utility (what would we do without this tool). Tips: Backup the original file and use a color for the edited file.

- Optimize applications

I always can recommend the Xslimmer. It removes the PowerPC part and/or unneccessary languages from the programs and saves a lot of space this way. For exmaple, iChat will shrink from 117 to 17 MB! The program has a blacklist, so programs which are problematic (f.e. Mail, Safari and Adobe products) won't be slimmed. I never had problems with slimmed programs. It also has a function to backup programs, but I won't use it because it's rather slow. If you want to backup programs copy the files to another drive. You can use again the Shared partition, and maybe use a disk image again.

- Applications I can recommend:

These apps I have installed on my Recovery partition:

- AMD Tools: ASU, About this Mac modifier
- AppZapper: Removes applications and additional files. But it's not really neccessary.
- Butler: Great program selector for the menu bar
- ClamXav: Freeware Virus killer. Not very important for the Mac, but it's there.
- DivX: DivX Decoder/Encoder
- Docker: Allows manipulations on the Dock, color, 2D mode and so on. I use it to get the arrows back.
- FastIcns: Very easy to use program to create icons up to 512x512 pixels.
- Firefox: Don't know what's this for a prog ;-)
- Flip4Mac: WMV plugin for Quicktime
- Gutenprint: Freeware printer driver which supports a lot of printers
- iDefrag: Defragmenting program, useful before creating backups
- iTar: a prog which uses UNIX archive types which have a very high efficency
- KeyViewer: Applescript which shows the MacOS keyboard table.
- Leopaque: Changes the menu bar's transparency in %
- Little Snitch: Personal Firewall, great program
- LiteIcon: Freeware version of CandyBar, allows to change system icons. I use it mainly for the folders.
- NFOViwer: Shows the .NFO and .DIZ files which come from so bad web sites ;-)
- Perian: A freeware Quicktime plugin with codecs for nearly every format.
- PrefEdit: Allows editing all preferences files
- RapidoStart: Nice program launcher
- RealPlayer: Needed for the web.
- Renamer4Mac: A program and context menu entry which can easily batch rename files
- The Unarchiver: an extractor for a lot of archive types. I made new icons which look like the system icons.
- Toast Titanium 9: You know this.
- Transmission: Lightweight Bitt*rrent client
- VLC player: Multiformat media player which inbuilt codecs. Plays nearly everything.
- Xbench: Our standard benchmark program.
- XSlimmer: was already described above.

I didn't create links to all these progs, but you can find them all in www.macupdate.com.
If you now think, wow, with these progs the 16 gig of the partition are all used - wrong. With all optimizations and so on it's only 7,16 GB! A bzip2-compressed backup image needs only 2,59 GB. Not bad, eh?

naquaada 07-17-2008 03:06 PM

5. Creating the main partition

Now boot back into the Leopard partition and create again a backup of the Recovery partition as described in instruction no. 3. Then boot back in the Recovery partition. Start Disk Utility and select the Leopard partition. Select 'Restore' on the right side of the Disk Utility. Now drag the just created Disk Image to the 'Source' field. Alternative you can use the 'Select' button, then you'll get a file requester. Then drag the 'Leopard' drive from the left side of the Disk Utility to the 'Destination' filed. At least set the marker 'Erase destination'. It should look like this now:

http://naquaada.na.funpic.de/naq/osx...il_recover.jpg

If you now click on 'Restore' the image will be written blockwise to the Leopard partition. This will work because the Leopard partition is bigger than the Recovery partition. After it's finished successfully, you have two volumes with the name 'Recovery'. Rename your main partition back to Leopard and reboot into it. Wait until it's completely finished booting, it is also possible that the Spotlight process starts, so it can take a while. After it's finished, use Onyx (if installed) and reboot. You now have two identical systems. To see the difference, use a custom background pic on your main partition.

Now we have to make the Leopard partition bootable. Reboot the computer and boot from the installation DVD in single user mode (option -s). If the prompt is there, enter these commands:

fdisk -e /dev/rdisk0
update
f 1
w
q

and reboot. Now the computer should reboot in the Leopard partition without using the Darwin boot selector. If this works, boot into the Recovery partition and create an image from the Leopard partition.

Now you have backups from your Leopard and your Recovery partitions. You can use both partitions to defrag, repair, backup and restore each other. A new installation is so nearly unneccessary. And the backups are quick available on the Shared partition. If both partitions are smashed, you can boot with the installation DVD, use disk Utility and restore a backup from the installation DVD. This method should be safe enough for the most users.

naquaada 07-17-2008 03:30 PM

6. Advanced optimizing

Before this, continue installing your main partition. Configure Mail, copy some things like Colloquy, Skype and some other programs you use more often. But no too big programs like iLife or something like that, the image should still be so small that it's easy to backup. My main partition which was prepared for backup had already some games, an Amiga emulator, ScummVM, CrossOver, Parallels, about 500 MB mails and so on, but it still it needed only 8,7 GB on disk and less than 3,6 GB as an image.

If your image is ready for backing up, you can use the following optimizing methods: First use iDefrag or another defragmenting prog that moves all blocks to the beginning of the harddisk. Then use Disk Utility and use 'Erase free space' with the Zero Out function. With this method the free blocks can be crunched more effective. If you have activated the Disk Utility's hidden features and use the bzip2 compression it will even be more effective.

naquaada 07-17-2008 03:38 PM

7. Using the system

If you use the system, test new things always on the Recovery partition. If it crashes, restore it and try again or don't try this feature again. Use it only if it works stable on the Recovery partition. Your main partition won't be affected from this. If install bigger programs on your main partition it will be to big to backup sometime, so be careful at all.

I would recommend to keep more than one backup of the partitions. It can happen that there's a hidden problem on a newer version, but the older hasn't it. So you can restore the older one and try to avoid this problem. This is the reason why the Shared partition should not be too small.

The method with the backups also works great if you have rather compatible systems. I have four systems with three different boards, but all have nForce 4 chipsets and an X1600. I don't need to create extra installations, only write the images to the system and fix network drivers and settings (IP and computer name).

Make use of the Shared partition. It's called Shared at all because you have access to it from both boot systems. If you would f.e. only use the folder of your Leopard home directory it's difficult to access to it from the Recovery partition. Use it for quick downloads and as a temporary partition, so it helps to keep the desktop clean. You can add a folder Douments in where you create a notepad file. If you're using Butler you can add it in the menu bar and add a hotkey. I always keep a well sorted disk image on this partition which contains drivers and software which I need. It's also added in Butler, so I can open it with a hotkey. This is a screenshot of my Butler menu, if anyone wants the preferences files mail me, there are no private data in it.

naquaada 07-17-2008 03:39 PM

I hope you can use these instructions, it always worked well for me and my friends use this system too.
If there are questions, ask them. Read also my thread about the Disk Utility.

Greetings, Naquaada.

PingunZ 07-18-2008 08:52 PM

Great guide, very complete and it has screenshots! :)
Since I'm reinstalling tomorrow, I'll use this for sure!