Recover deleted Linux partitions when returning to OS X

Aug 25, '03 08:51:00AM

Contributed by: Anonymous

I ran into some problems when I tried to return to OS X and remove a Debian GNU/Linux basic installation from my PowerBook 667. Three partitions (7.9G) became invisible to OS X, and the partition table was not writeable with Darwin's pdisk in single user mode. I restored my partitions with these steps:

  1. I downloaded from debian.org the following files:As written on the debian.org page Install Debian without physical media, and I copied them to / (root diretory of OS X) with sudo cp linux.bin yaboot yaboot.conf root.bin /
  2. I booted to open firmware by holding Command-Option-O-F during boot. Once there, I booted the Debian install disk by typing boot hd:X,yaboot, where X was the partition number of Mac OS X - "9" for me).
  3. After linux's usual boot, I chose the language for the Debian installer, then selected "Partition hard disk" from the menu. Now you can delete partitions (choice D), create new Apple partition (C, and set the type to "Apple_HFS"), re-write the partition table (W), and quit (Q) Debian's pdisk.
  4. Stop the installation steps (before it's too late) by selecting "Reboot system" and confirm from menu.
  5. Hold Command-S to boot in single-user-mode, and run newfs_hfs -w -v MyNewVolume /dev/disk0sNN, where NN is the slice created with Debian's installer.
  6. Type reboot, and the volume will be back after login. Remember to remove the files copied to the root directory in the first step).
[robg adds: This originally ran in the "Is it a hint?" category, and the comments were split about evenly between "yes" and "no." In the end, I decided to run it, as it might prove helpful to someone who was trying to return to OS X after running Linux on their machine. It won't apply for most users, but if someone needs it, now it's in the database.]

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2003070310124682