Mac Is Badmac Is Bad Blog



In my opinion for this Mac Vs Pc, i would side with the mac. My mac runs better than any windows pc i have ever owned, and i get a good solid 60-120 fps. If you are a windows user, setting up a mac is EASY as it gets, the team at apple stores will take the time to help you get your new device, whether that be iphone or mac, up and running. Sure, the processors of most Macs are pretty good. Only the Mac books, specifically the Mac Book Pro has a Quad-core Processor. Yes, the displays are awesome as well on almost all Macs. When it comes to RAM and storage, they’re not bad as well. As a matter of fact, both Mac Books and their desktop versions are pretty good in terms of RAM.

If your Mac regularly and randomly pauses with the spinning color wheel, it may be because of bad blocks on the hard drive. Here is how to correct bad blocks for Macintosh systems running OS X. Just how bad is McDonald's food? Morgan Spurlock sought to find out in his 2004 documentary Super Size Me.In his film, I was interviewed and spoke about the role McDonald's food is playing in our epidemic of obesity and diabetes. Lucky for Apple, the bad bit of its brand philosophy hasn’t come home to roost quite yet. Apple currently thrives on what is essentially a captive market. There are Apple products and then everything else. As I mentioned above, the upshot of this is if you have a bunch of Apple products, they all work well together.

There are not many things I miss from Mac OS 9. But there’s one that was really useful: the ability to test a hard drive surface. OS 9 disk formatter (I don’t even recall it’s name) had a “Test Disk” option that would perform a surface scan of the selected hard drive. That was awsome to test for bad blocks on the drives.

Unfortunately, that’s impossible to do with Mac OS X, at least with it’s built-in software. There are some commerical applications to do that (like TechTool Pro), but I get a little pissed off when I have to spend a lot of money buying a software that does a zillion things when all I want is surface scans, and specially when I could do it with the “old” OS and not with the new powerful UNIX-based one.

Mac is badmac is bad blogging

Well, Linux has the badblocks command that will do just that: test the disk surface for bad blocks. It’s a simple UNIX command, so I thought there must be a port of that to OS X (and, of course, I could try to compile it in OS X as last resource). After some googling, I found out badblocks is part of the ext2fs tools. And, fortunately, Brian Bergstrand has already done the port to OS X, including a nice installer.

The installer installs all the ext2fs stuff, including an extension that will allow you to access ext2fs volumes on OS X. As always, this is a somewhat risky operation. Personally, I avoid as many extensions as I can, because they run too close to the kernel for me to feel confortable. So, if possible, install it on a secondary OS (like an utility/recover system on an exteral hard drive, or so).

Blogging

The badblocks command will be installed in /usr/local/sbin/badblocks, and it will probably not be on your PATH, so you have to type the entire path when using, or edit your PATH environment variable.

Usage is simple. First, run the “mount” command, so that you know the device names for the drives you want to test. You can obtain something like this:

arroz% mount
/dev/disk0s3 on / (local, journaled)
devfs on /dev (local)
fdesc on /dev (union)
on /.vol
automount -nsl [142] on /Network (automounted)
automount -fstab [168] on /automount/Servers (automounted)
automount -static [168] on /automount/static (automounted)

The internal hard drive is /dev/disk0 (note that /dev/disk0 is the entire drive, /dev/disk0s3 is a single partition). Imagining you want to test the internal hard drive you would type the command (as root):

badblocks -v /dev/disk0

This would start a read-only test on the entire volume. The -v is the typical verbose setting, so you may follow what’s happening. This will take a long time, depending on the hard drive you use. For a 160 GB hard drive, it took between 2 and 3 hours in a G5 Dual 2 Ghz.

I mention this because time is an important factor when testing hard drives! You should run badblocks on a known-to-be-in-good-condition hard drive, so that you can get the feeling of how fast (or slow) badblocks is. Later, if you test a possibly failing hard drive, and badblocks progresses notably slower, it will probably mean that the hard drive is in bad condition (even if it doesn’t have badblocks).

After running the command, you may get two results: your disk has, or hasn’t badblocks! 🙂 You will see many outputs of a successful surface scan, so I leave here an example of a not-so-successful one:

Mac Is Badmac Is Bad Blogging

/usr/local/sbin arroz$ sudo ./badblocks -v /dev/disk0
Password:
Checking blocks 0 to 156290904
Checking for bad blocks (read-only test): 120761344/156290904
120762872/156290904
120762874/156290904
done
Pass completed, 3 bad blocks found.

This is the result of a test on a 160 GB hard drive with 3 bad blocks.

BadBadAfter getting something like this, you may try to run badblocks again, in write mode.

Mac Is Badmac Is Bad Blogs

Note that this will destroy all the information you have on the hard drive!

Mac Is Bad

badblocks won’t copy the information to memory, and than back to disk. It simple destroys it. The point of running a write-enabled badblocks check is forcing the hard drive to remap the damaged sectors. Hard drives have a reserved space to use when bad blocks are found. The bad blocks are remapped to that reserved space, until it fills. And this will only happen on a write. So, run badblocks in write mode, and then again in read-only mode. If badblocks finds no bad blocks, your hard drive is fine (for now). If badblocks still finds bad blocks, it means that there are so many damaged blocks on the disk surface that the reserved area is full. Forget it, and throw the disk away. It’s useless.