PS3 Boot Recovery HOWTO 2008.01.08 Copyright (c) 2007 Sony Computer Entertainment Inc. Copyright 2007 Sony Corporation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". DISCLAIMER THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF. TRADEMARK NOTICE "PLAYSTATION" and "PS3" are registered trademarks of Sony Computer Entertainment Inc. "Cell Broadband Engine" is a trademark of Sony Computer Entertainment Inc. Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries. Other company, product and service names may be registered trademarks, trademarks or service marks of others. ABOUT THIS DOCUMENT This note gives some tips on how to recover your PS3-Linux system when it hangs up or no longer boots. You can always find the latest version of this document, and some other useful technical documents here: http://www.kernel.org/pub/linux/kernel/people/geoff/cell/ Please send comments to . PS3 BOOT RECOVERY HOWTO 1) Basic PS3 Tricks ** main power switch ** You should NEVER use the main power switch in the back of the PS3 to shutdown. You can always force a shutdown with the front power button. ** force a shutdown ** To force the PS3 to shutdown, for example when Linux hangs up, press the power button on the front of the system for about 10 seconds. The hypervisor will take control and shutdown the LPAR, then put the system in standby mode (red LED). ** force the game-os to boot ** To force the PS3 to boot into the game-os, shutdown the PS3, then press and hold the power button on the front of the system until a beep is heard, then release the power button. The video mode and boot flag settings will be re-set to the defaults and the game-os will boot. ** check bootloader integrity ** Use ps3-dump-bootloader to get the md5sum of the installed kboot and compare the value to the md5sum of the original kboot file. ps3-dump-bootloader --sum ** re-install kboot ** If you can boot into linux, then you can re-install kboot with this command: ps3-flash-util -w is the name of the kboot image file. The kboot image file is often named otheros.bld. If you cannot boot Linux, put the kboot image file on a supported type of removable media and boot into the game-os and install as you did in the original installation. ** backup flash data ** It is a good idea to make a backup of the data stored in flash memory. To backup the entire flash memory use this: dd if=/dev/ps3flash of=flash-bak-`date +%y.%m.%d-%H.%M.%S` You can also make a partial backup that does not include the bootloader image with this: dd if=/dev/ps3flash of=flash-bak-`date +%y.%m.%d-%H.%M.%S` bs=2k count=1 Included in the partial backup is the bootloader location and size but not the bootloader image, so update the backup if you install a new bootloader. If you restore from a a backup that used a different bootloader you can recover by re-installing the current bootloader. This will write the proper bootloader location and size to flash. You can view the settings in flash with this command: ps3-flash-util -s If the flash gets corrupted it can then be restored with this: dd if=flash-bak-xx.xx.xx-xx.xx.xx of=/dev/ps3flash count=1 bs=`ls -l flash-bak-xx.xx.xx-xx.xx.xx | cut -d' ' -f5` 2) Basic kboot Tricks ** kboot shell ** Kboot has a simple shell 'ash'. To invoke it just type 'ash' at the kboot prompt. You'll then see the ash prompt '#': kboot: ash # Ash only has a few utilities, but should be enough to mount your root filesystem to get the full set that were installed by your distro. ** partition table check ** One of the first things to check if kboot can't find your kboot.conf or yaboot.conf is to see if the hard disk's partition table is setup correctly. PS3-Linux uses a standard MS-DOS partition table, the same as that used on PC's. From the kboot or ash prompt use fdisk to view the hard disk partition info: # fdisk -l Disk /dev/ps3da: 47.1 GB, 47126736896 bytes 64 heads, 32 sectors/track, 44943 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/ps3da1 * 1 44431 45497328 83 Linux /dev/ps3da2 44432 44943 524288 82 Linux swap / Solaris Here the root device is /dev/ps3da1, and the asterisk in the 'Boot' column shows it is marked as 'bootable'. kboot looks for kboot.conf and yaboot.conf ONLY ON BOOTABLE partitions. If needed, edit the partition table with fdisk. ** kboot mount check ** Another thing to check if kboot can't find your kboot.conf or yaboot.conf is if kboot has mounted your root partition correctly. From the kboot or ash prompt use mount to view the mounted devices: # mount /dev/ps3da1 on /mnt/root type ext2 (ro) If you don't see the device where your kboot.conf is, then you need to find out why kboot hasn't mounted it. See the section 'Mounting File system' in HowToUsePS3Linux.html. The latest version is here: http://www.kernel.org/pub/linux/kernel/people/geoff/cell/CELL-Linux-*/doc/HowToUsePS3Linux.html ** fix-up for Fedora re-installs ** The installer of Fedora based distros will sometimes make the disk label /1 if it re-formats the disk on install. Check it, and change it if needed. Use the root partition found with fdisk. # e2label /dev/ps3da1 /1 # e2label /dev/ps3da1 / ** edit files on hard disk ** Kboot mounts the root partition as read-only. To edit any files re-mount the partition as read-write: mount -o rw /dev/ps3da1 /mnt/root ** chroot to installed distro ** It is also possible to chroot to the root partition and have access to all the installed utilities. # chroot /mnt/ps3da1 3) Other Recovery Tricks ** rescue CD ** A rescue CD can provide a richer environment for system recovery. Fedora provides iso images: http://download.fedora.redhat.com/pub/fedora/linux/releases/8/Fedora/ppc/iso/Fedora-8-ppc-rescuecd.iso The default display resolution is low, you can choose a higher one: kboot: rescue video=wxga or kboot rescue video=720p -EOF