iMac Linux Rescue
This mini-howto explains how to fix your system when (rather than if ;-) the installation has failed. I'm now running Mandrakelinux 10.1, but most of this is very generic.
The installer for Mandrakelinuxlinux 10.1 works just fine with the defaults. To install Mandrakelinux 9.1 on my slot-loading iMac G3, I needed this:
install-gui old-gui video=atyfb128
Might be handy to know.
So if all else fails, and you get a black screen for some reason or other, try this:
(in the following, you should replace XX by the relevant partition numbers)
1. Boot the rescue image
- Boot from the install CD.
- Choose the "rescue" image
- If this works, you should get a root prompt (# ) If not, it means your CD is damaged. Get a new one ;-)
2. List your partitions.
If you know which partition is your root partition, you can skip this step. Otherwise,try to list your partition table
$ pdisk -l
You should see something like this:
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: Apple_Driver43*Macintosh 54 @ 64
3: Apple_Driver43*Macintosh 74 @ 118
4: Apple_Driver_ATA*Macintosh 54 @ 192
5: Apple_Driver_ATA*Macintosh 74 @ 246
6: Apple_FWDriver Macintosh 200 @ 320
7: Apple_Driver_IOKit Macintosh 512 @ 520
8: Apple_Patches Patch Partition 512 @ 1032
9: Apple_HFS untitled 37023999 @ 1544 ( 17.7G)
10: Apple_HFS untitled 2 2048000 @ 37025543 (1000.0M)
11: Apple_Bootstrap bootstrap 20480 @ 39073543 ( 10.0M)
12: Apple_UNIX_SVR2 Linux Native 7168000 @ 39094023 ( 3.4G)
13: Apple_UNIX_SVR2 swap 512000 @ 46262023 (250.0M)
14: Apple_UNIX_SVR2 Linux Native 11831097 @ 46774023 ( 5.6G)
3. Mount the root partition.
If you know which partitions you have (something like /dev/hda6 or /dev/sda11 or whatever), you might try to mount them one by one to find out which one is the root partition:
$ mount -t ext2 /dev/hda6 /mnt/disk
On Mandrakelinux, the mount point is /mnt/disk. This might be different for other distro's.
Then do:
$ ls -l /mnt/disk
You should see something like this:
total 200
drwxr-xr-x 2 root root 4096 Apr 17 11:38 bin
drwxr-xr-x 2 root root 4096 Nov 21 2001 boot
drwxr-xr-x 3 root root 90112 Apr 16 18:14 dev
drwxr-xr-x 83 root root 8192 Apr 30 11:02 etc
drwxr-xr-x 2 root root 4096 Feb 6 1996 home
drwxr-xr-x 2 root root 4096 Apr 29 09:27 initrd
drwxr-xr-x 13 root root 4096 Apr 16 17:39 lib
drwx------ 2 root root 4096 Apr 18 03:04 lost+found
drwxr-xr-x 9 root root 4096 Apr 16 16:49 mnt
drwxr-xr-x 2 root root 4096 Apr 29 09:26 opt
drwxr-xr-x 2 root root 4096 Nov 21 2001 proc
drwx------ 40 root root 4096 Apr 29 09:25 root
drwxr-xr-x 2 root root 4096 Apr 16 18:13 sbin
drwxrwxrwt 22 root root 12288 Apr 29 09:27 tmp
drwxr-xr-x 2 root root 4096 Nov 21 2001 usr
drwxr-xr-x 24 root root 4096 Apr 16 17:26 var
If not, it means the installation failed. Maybe you chose "hard disk install" or "network install" instead of "CDROM install"?
If the list looks OK, you can try to fix your system.
4. Fix your system: boot trouble
- Change OF boot script (/etc/yaboot.conf)
The boot loader configuration is stored in the file /etc/yaboot.conf.
$ cd /etc
$ vi yaboot.conf(or pico yaboot.conf if you don't like vi)
- Run ybin
/sbin/ybin -v
- That's it, unless your system does not support nvsetenv.
In that case (and you'll know because your system doesn't boot :-), boot into OF (Option-Command-O-F) and type
setenv boot hd:XX,\\:tbxi
5. Fix your system: graphics trouble
Trouble with the graphical system can be fixed by modifying the /etc/X11/XF86Config file.
Typical causes for trouble are:
- wrong driver.
If all else fails, try
Driver "fbdev"
in Section "Device".
It's slow but should be independent of your hardware.
- color depth or resolution too high:
in Section "Screen"
DefaultDepth 16
Subsection "Display"
Depth 16
Modes "600x800"
EndSubsection
6. When all is done.
- Go back to the rescue system root:
$ cd
- Then unmount your root partition:
$ umount /mnt/disk
- Remove the install CD and reboot.
7. Some more checks.
Some further checks for the file system on the partition:
$ df -h /dev/hdaXX
This will tell you how much free space you have on /dev/hdaXX.
$ umount /dev/hdaXX
$ e2fsck -c /dev/hdaXX
This will check /dev/hdaXX for bad blocks etc., and try to fix it.
8. Still not OK.
The "Add a partition" howto gives some more in-depth information (how to change/add partitions, modify your file system table etc). And the description of the boot process might be usefull as well.