10 November 2009

A New Way to Recover Leopard

Something bad happened. My mac didn't boot, stuck on waiting root disk. Hmm, so I boot into karmic, and doing fsck.hfsplus -fy /dev/sda2, some error but unsuccessuly repaired. Some research on Google advise me to use DiskWarrior, or use Mac Install DVD, which both I don't own (and at the moment I have no external DVD drive to boot from, borrowed by a dude).


The mac partition was still readable but unfortunaely unwritable, because of journaling activated before. Quick thought, I created a new primary partition via Gparted, and made it as hfsplus w/o journaling. I then copied some important folders and files (almost all files and folder except Applications and Users) into the new partition via terminal (cp -arf ...). Creating some links into private folder, and reboot.

Grub2, enter console mode (press c), typing this:

set root=(hd0,4)
xnu_kernel /mach_kernel rd=disk0s4 -s
xnu_kextdir /System/Library/Extensions


and then press Ctrl-x to boot, I think the switch -s didn't work as usual (Karmic beta), but my surprise, the mac entering single user mode. Well, standard procedure: fsck -fy, so much invalid entry, but successfully repaired. And then executing mount -uw /, what? the file is missing? Whatta... mount is missing. So I manually mount / via mount_hfs, and then I soft linking mount into mountd.

Okay, mount read/write success, and then logout, logout again, enter login screen. Everything saved. Remain tasks are to copy/move a bunch of files and apps from old mac partition into the new and fresh partition.

Once again, Linux saves the day!

Update (11/10/09-05:37)
Times to work, so copied XAMPP from the  old into the new. XAMPP Control states that: start mysql error manager of pid file quit without updating.... And mysql won't start.

Googling as always, again no solution suitable to my case. Someone suggested to reinstall the XAMPP package. So, I started my own experiment. Quick looked into /Applications/XAMPP, all file ownership was myself (because I copied them using finder drag and drop), so I began to recover with:

chown -R nobody /Applications/XAMPP


Check again with XAMPP Control. Still no luck. Trying from terminal by this command:

/Applications/XAMPP/xamppfiles/bin/mysqld_safe --skip-grant
/Applications/XAMPP/xamppfiles/bin/mysql_install_db
(and then copy all databases from the old to the new, using terminal)


Enter phpmyadmin, add user root into table user in mysql database, run flush privileges from SQL windo. All should be normal again.


0 tanggapan: