Google
 

11/25/06

Mac disk utility--backup the hard drive.

Disk Utility's hidden talents

Working Mac

Poor Disk Utility. It seems fated to remain one of Mac OS X’s most underappreciated utilities. If you’ve even launched it at all, chances are you haven’t gone beyond using its First Aid features to repair a disk (see Mac OS X First Aid). But that merely scratches the surface of what this multitalented tool can do. Here are eight more ways to put Disk Utility to work.

1. Mount and unmount volumes

Most of the time, mounting and ejecting external drives and disks just works. But every now and then, a drive will refuse to mount, or you might eject a connected drive (Command-E) and find yourself puzzled about how to remount it.

PICTURES

click to see larger image

July Working Mac

Gone for Good: When you want to erase a disk and ensure that every scrap of information on it is really gone, use one of these Disk Utility options.

This is when Disk Utility (/Applications/Utilities) is handy to have around. Launch it, and you’ll see all connected but unmounted drives listed in the column on the left of its window. Select the desired volume and click on the Mount button in the toolbar, and your drive is back in action. Another advantage of Disk Utility is that you can use it to eject particular drive partitions. With the Finder, you must eject either all of a drive’s partitions or none of them.

2. Erase a CD-RW/DVD-RW disc

While write-once CDs and DVDs are the most common types of blank discs, there may be times when you work with rewritable (RW) discs. If so, you’ll eventually want to erase the contents of these discs so you can write new data to them. You don’t need add-on software to get this job done. Launch Disk Utility, select the disc from the left column, choose the Erase tab, and then click on Erase in the window that appears.

3. Completely erase a drive

Whether you’re selling your old computer or cleaning out your virtual desk before moving to another job, sometimes you want to erase everything that’s on your hard drive. Disk Utility gives you two options.

The quick and easy way is to select a volume, choose the Erase tab, and click on the Erase button. The disk will now appear empty, even though your data is actually still there. What’s gone is the catalog directory, or the “pointers,” to the files. Your Mac now considers the space free and will write over the data as new information is added.

It’s not easy to access files erased in this way, but a knowledgeable hacker (or a disk-recovery service) could ferret them out. So if you want to make sure that all existing data is truly gone, click on Security Options instead. In this sheet, Disk Utility gives you a number of erasure options, including Zero Out Data, 7-Pass Erase, and 35-Pass Erase. When you select multiple passes, the drive is erased multiple times to remove all data traces. But be aware that more passes take more time. Unless you work for the CIA, the Zero Out Data option (which is one pass) should be sufficient (see screenshot).

If you’re concerned that something sensitive you already deleted might still be recoverable but you don’t want to erase the entire drive, never fear. Disk Utility can help in this situation, too. Select the volume, choose the Erase tab, and click on the Erase Free Space button. In the sheet that appears, pick the desired number of erasure passes. Disk Utility targets only files that you’ve deleted, leaving your other files untouched. In the future, you can use the Secure Empty Trash command (Finder: Secure Empty Trash) to thoroughly delete files from the Trash.

4. Partition a drive

Once upon a time, many of us wondered what to do with our colorful iMacs’ whopping 6GB hard drives. But these days, the smallest hard drive you can get with a new iMac is 160GB. With so much space at your disposal, partitioning—splitting up a drive into separate parts—can make a lot of sense. For example, perhaps you want to create two bootable volumes—one for daily use and the other for emergencies or for safely testing new software. (For more reasons to partition, see Multiply Your Drive.)

Launch Disk Utility, select the drive in the left column, and choose the Partition tab. If you’re working with an external drive, click on the Options button and choose the desired option from the Volume Scheme menu. Next, whether you’re using an external or an internal drive, select the number of partitions you want and the size of each one, and give each one a name. Click on the Partition button, and the drive will be erased and reformatted.

5. Create a disk image

Much of the software you download from the Web, especially from Apple, arrives as a disk image (with the telltale file extension .dmg). Double-click on a disk image, and its contents appear on your desktop, almost as if you were mounting an external disk.

Using Disk Utility, you can create image files yourself. Doing so allows you to create a single file that contains an exact duplicate of a given folder’s contents, down to the position of the icons. If you stick with Disk Utility’s default options, the resulting file will also be compressed, so you can save disk space.

To create an image file, launch Disk Utility and select File: New: Disk Image From Folder. In the window that appears, navigate to the desired folder and then click on Image. Give the image file a name, and click on Save when prompted. That’s it.

Another useful aspect of disk images is that you can password-protect them. Select AES-128 from the Encryption pop-up menu in the Save dialog box. This is an easy way to protect important documents on your computer.

6. Burn a bootable duplicate of a disc

Worried about your OS X Install DVD getting damaged, or want a copy to take on a trip? You could burn a copy from the Finder, but you wouldn’t be able to boot from it when you were done. The simple way to create a bootable duplicate is to use Disk Utility to make a disk image and then burn a new disc. (One caveat: Keep in mind that you can’t create a bootable copy of a dual-layer Mac OS X Install DVD if your DVD drive can only record to single-layer DVDs.)

First, launch Disk Utility and mount the CD or DVD. Select the disc from Disk Utility’s left column. Then select File: New: Disk Image From name of disc. A Save dialog box appears. From the Image Format pop-up menu, select DVD/CD Master. Click on Save. After Disk Utility has created the image file, select Images: Burn. In the dialog box that appears, select the image file and click on Burn. Insert a blank disc when prompted.

7. Create a multisession disc

If you take the saying “waste not, want not” to heart, it probably pains you to burn a half-full disc. But did you know that you can record more than once even to so-called “write-once” CDs? You can’t erase what’s already there, but you can keep adding content to a disc until there’s no more free space left. Use Disk Utility to set up the CD as a multisession disc the first time you burn it.

To begin, launch Disk Utility, create an image file of the data you want to burn, and then select Images: Burn. In the dialog box that appears, locate the image file and click on Burn. You are now ready for a crucial step: in the window that appears, select the Leave Disc Appendable option. Click on Burn, and you’re done.

To add more data, you must again use Disk Utility; you cannot add data via the Finder’s Burn command. You can repeat the appending process until the disc is full. When you mount a disc with multiple sessions, each session will mount as a separate volume.

8. Back up a drive

Looking for a free way to back up a drive? Well, you’ve already got one—Disk Utility’s Restore tab. It’s a somewhat crude tool, but it does work. Launch Disk Utility and choose the Restore tab. Next, select the volume you want to back up in the left column, and drag it to the Source text field. Select the volume that will hold the copy, and drag it to the Destination text field.

If you want to erase the contents of the destination volume before storing your backup files there, select the Erase Destination option. Otherwise, the newly stored data is simply added to the existing files. Click on Restore to make a copy, and the backup process is complete. If you need to use your backup files later, simply reverse the Source and Destination directions.

As a bonus, Disk Utility lets you use a disk-image file (created separately via Disk Utility’s New Disk Image command) instead of an actual physical volume as your source. That’s particularly useful if you maintain multiple Macs with a standard preinstalled set of files—in a computer lab, for example. Put your disk image on a portable drive, and then use Disk Utility to restore each Mac to a default state.

[Contributing Editor Ted Landau is the author of Ted Landau’s Mac OS X Help Line: Tiger Edition (Peachpit Press, 2006).]

EDITOR’S NOTE: This story was corrected to reflect that Disk Utility cannot create a multi-session disc with a DVD. We also added a clarification about the need for a DVD burner with dual-layer capabilities to burn dual-layer DVDs.

More from the July 2006 Issue 11 Comments on this story
source from here.

Should also look at "rsync". It seems to be a very nice thing.

11/23/06

Macbook Pro display problem.

Here is the picture of the screen.
I am really disappointed about this Mac computer.
This problem was solved by the following:
1. shut off the computer.
2. turn on it
3. immediately press P+R+option+command, hold them till hear the third sound of the computer (the music).
4. Release it.

So far hard to know whether it is due to the hardware or not. But if it happens again, then should call them again.

11/22/06

Mac start up.

Choosing Startup Disks

Not surprisingly, many of the startup modifiers affect the disk used to boot the Mac. A number of these are specific to certain models of the Macintosh.

* The mouse button causes the Mac to eject floppy disks and most other forms of removable media, though not CD-ROMs.

* The C key forces the Mac to start up from a bootable CD-ROM, if one is present, which is useful if something goes wrong with your startup hard disk. This key doesn't work with some older Macs or clones that didn't use Apple CD-ROM drives; they require Command- Shift-Option-Delete instead (see below).

* Option activates the new Startup Manager on the iBook, Power Mac G4 (AGP Graphics), PowerBook (FireWire), and slot-loading iMacs. The Startup Manager displays a rather cryptic set of icons indicating available startup volumes, including any NetBoot volumes that are available. On some Macs with Iomega Zip drives, holding down Option at startup when there is a Zip startup disk inserted will cause the Mac to boot from the Zip disk.

* Command-Shift-Option-Delete bypasses the disk selected in the Startup Disk control panel in favor of an external device or from CD-ROM (on older Macs). This is also useful if your main hard disk is having problems and you need to start up from another device. (On some PowerBooks, however, this key combination merely ignores the internal drive, which isn't as useful.)

* The D key forces the PowerBook (Bronze Keyboard and FireWire) to boot from the internal hard disk.

* The T key forces the PowerBook (FireWire) (and reportedly the Power Mac G4 (AGP Graphics), though I was unable to verify that on my machine) to start up in FireWire Target Disk Mode, which is essentially the modern equivalent of SCSI Disk Mode and enables a PowerBook (FireWire) to act as a FireWire-accessible hard disk for another Macintosh.

from here.

Knoppix installation tips

By Prakash Advani <prakash@NOSPAMfreeos.com>
Posted: ( 2003-05-08 11:03:31 EST by prakash )

Like many Linux aficionados I have been interesting in trying out Knoppix. Knoppix is a Linux distribution that boots and runs off a CD; you dont have to install it on your hard disk. Its the fastest way to demonstrate Linux or check a system for hardware compatibility.I learned a few things from booting Knoppix from CD and later installing it to the hard disk. Here are some tips I hope make your experience with Knoppix easier.

To begin testing the distribution, download the latest Knoppix image and burn it to a CD-ROM. There are several mirrors on the Knoppix Web site from where you can get the latest image in the form of an ISO file, or purchase a CD-ROM. If you choose to download, get the latest version; Knoppix has a release almost every week. A suffix of EN at the end of the file name specifies that is the English version.

The command to burn a CD out of the ISO under Linux is:

cdrecord -eject speed=16 dev=0,0,0 KNOPPIX_V3.2-2003-04-15-EN.iso
Where cdrecord is the command, -eject ejects the CD once the recording is complete, speed=16 is the speed at which to burn the CD, dev=0,0,0 is the device ID and KNOPPIX_V3.2-2003-04-15-EN.iso is the name of the ISO image. If you don't know your CD device ID, the command cdrecord -scanbus will present a list of available devices. CD burning applications on Windows, such as Ahead Softwares Nero Burning ROM , Alcohol SoftwaresAlcohol 120% , and RoxiosEasy CD Creator, also allow you to create a CD out of an ISO image.

When I first booted Knoppix from the CD, it detected every piece of hardware on my system. I have heard of people whose hardware was not completely detected even with distributions such as Red Hat 9.0, so I was impressed.

The best thing about Knoppix is that you can run it off the CD and install it only when you like it. If you do this, you can still use the hard disk to store data. An advantage of this approach is that you dont have to bother with partitioning your disk drive. You can also easily upgrade to a newer version just by changing to a new CD. A disadvantage of this approach is that it runs more slowly than an operating system installed on a hard disk, since a hard disk is faster than a CD drive.

Once you are familiar with Knoppix and start liking it, you will be tempted to install it on the hard disk. Before you do, be sure to make a backup of the drives contents, and know the basics about hard disk partitioning.

Installation tips

When you boot up the Knoppix CD, a browser window pops up with a link to the softwares FAQ, which includes instructions for installing Knoppix on the hard disk. Dont follow them! If you do, you will install the German version of the software even though you booted from an English version of the CD. If you follow the instructions in the FAQ you can still convert the system to English, but to do so you have to change the locale setting in a number of places using a German interface.

Instead of following the installation instructions in the FAQ, go to the Knoppix section in the menu, run the root shell and type:

knx-hdinstall

This command invokes an easy-to-understand menu that allows you to partition your disk. It asks you to select the hard disk on which you would like to install the software; hda is the first IDE hard disk and hdb is the second, while if you have SCSI hard disks its sda and sdb. The partitioning tool, cfdisk, is fairly easy to use, but be sure you know what you are doing before you write your partition table to the disk or you may mess up your system and lose your existing data. Create a swap partition size of double the amount of memory in your machine but at least 256MB.

The installation procedure then asks you to select your swap partition, then formats it. Next, you select your root partition, where the procedure will install the operating system, and the file system type.

Tip: If you select a partition type of XFS as I did, Knoppix will not install. It will stall while coping files. A quick search on the Knoppix forum , which is the place to go if you run into problems, disclosed a bug here which was suppose to be fixed. Based on my experience, it isnt -- are you reading this, Knoppix developers?

Another glitch: if you select a partition type of EXT3, Knoppix mounts the EXT3 partition as EXT2 after installing, because the kernel shipped with Knoppix isn\'t compiled with EXT3. I selected EXT2 and was finally able to install the operating system. The installation takes about 2GB of disk space. Knoppix booted perfectly as a Debian system and ran much faster from the hard drive than it did from the CD-ROM.

Filling in the missing pieces

This release is not without some flaws. The Evolution mail client is missing. The Gaim client is an older version that didnt work with Yahoo Messenger. And the OpenOffice version installed was German.

Since Knoppix is based on Debian, I turned to Advanced Package Tool to fix these problems. I had heard a lot about APT but this was my first chance to try it out. APT is a great system, but it takes a little getting used to. To get the latest software you need to have an Internet connection or the latest Debian CDs.

To install Evolution and Gaim I typed:

apt-get install evolution/unstable

apt-get install gaim/unstable
And added automatic spell checking by entering the commands:
apt-get install aspell ispell gnome-spell aspell-en iamerican

If you dont specify /unstable the command still works but it gets a much older version of the software. The unstable versions are more recent and usually not literally unstable.

To change OpenOffice to English I removed the German version, installed the English version:

apt-get remove openoffice-de-en openoffice.org-bin openoffice.org-debian-files openoffice.org-l10n-en

apt-get install openoffice.org

One more tip: You can use the script install_flashplugin.sh to install the Macromedia Flash browser plug-in, but the script doesnt install the software system-wide. If you plan to have multiple users on the system, log in as root and copy the two files libflashplayer.so and flashplayer.xpt from your .mozilla/plugin directory to /usr/lib/mozilla/plugins/.

Despite its shortcomings, which were relatively minor, and limited installation support, I found Knoppix a great system. I have made it my Linux distribution of choice. If you have tips on how to make it even better, share them with me and NewsForge readers by posting a comment.

This article was first publised on Newsforge.

Other articles by Prakash Advani

Current Rating: [ 7.36 / 10 ] Number of Times Rated: [ 69 ]

From here

Knoppix DVD and CD.

Use the following command to copy the image file to hard drive so that after boot up, the CD/DVD can be removed.

knoppix tohd=/dev/hda10 dma xmodule=i810

Explanation: /dev/hda10 is the hard drive where you want to copy the image to. dma will accelerate the speed of the system. xmodule is used here for the intel i82845 vedio card.
After that, when you want to boot up, use the CD/DVD and get to the command line (F3) then input the following command.

knoppix fromhd=/dev/hda10 dma xmodule=i810
Now knoppix will run from the hard drive which is usually faster than the CD/DVD.

Freemind on Mac.

1. Use shift to select multiple nodes.
2. Use alt+command to connect different nodes by lines (instead of ctrl + shift).

knoppix and intel 82845G vedio card.

use the following when start up.
press F3 when start up, so that you can input the command.

knoppix xmodule=i810

Then it will ask for mode, select 80x60 or just press "space"
to continue. Actually I think it is better just press "space" and
ignor the mode selection.

Knoppix works great. One thing I am not sure is how
well it supports the vedio card and etc. And how widely
I can use it.

11/14/06

GNU g++ header file.

/********************************************************
* #include <_string>
* #include <_iostream> //this is a very commonly used one.
* #include <_fstream> // commonly used.
* #include <_iomanip> //commonly used.
* #include <_vector>
* #include "nr.h"
*********************************************************/
Note, in the program, there should not have '_' before string, or others. Here it is
used to display the content.

11/13/06

Use grep to search the .cpp files to find the strings/phrases.

For example, go to the src directory of the expamples of numerical recipes, and
then:
cat *|grep rk4
or
grep rk4

this is very convenient.

Use g++ and numerical recipes.

Here I show how to use numerical recipes (NR2). Now they have the latest version NR3 which is much better. You can find it on their website.

1. make a directory, called "bulbs" or whatever name you like.
2. make a include directory to store the head files, called "include", which resides in the directory "bulbs".
3. copy the head files: nr.h; nrtypes.h, nrtypes_lib.h, nrtypes_nr.h, nrutil.h, nrutil_nr.h, nrutil_val.h, print_array.h to the "include" directory.
4. Write the codes, say "bulbs.cpp", which will call the nr functions: expdev, sort1, and nrexit, ran1.
5. copy expdev.cpp, ran1.cpp, sort.cpp, to the directory which contains bulbs.cpp.
6. compile them by following commands (or you can write a makefile):
g++ -c -I ./include expdev.cpp
g++ -c -I ./include ran1.cpp
g++ -c -I ./include sort.cpp
g++ -c -I ./include nrexit.cpp
g++ -o bulbs bulbs.cpp expdev.o ran1.o sort.o nrexit.o
this should give the executable bulbs.

11/6/06

mount usb drives.

I have such problem:
#:> mount -t vfat /dev/sda1 /usb

mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or other error
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)
In some cases useful info is found in syslog - try
dmesg | tail or so

I want to check what are the partitions on sda. do the following:
#:> fsck -l /dev/sda
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 2 19457 156280320 f W95 Ext'd (LBA)
/dev/sda5 2 19457 156280288+ b W95 FAT32

So it is obvious that /dev/sda1 has some problems. Instead should use:
#:> mount -t vfat /dev/sda5 /usb
Now it works.

To check the status of usb storage, use:
#:> dmesg|grep usb
sometimes it is necessary to check the log files
#:> more /var/log/messages |grep usb