Last updated on:
Sunday, July 06, 2008
Repairing Linux Using the Install System
This information was contributed by Peter Webb.
I recently applied service to my Redhat 7.2 Linux/390 system, and I neglected
to run zipl afterward to point to the new kernel. The kernel
would not boot, I didn't have a backup, and my other Linux machines were older
SUSE versions with incompatible disk layouts.
I did, however, still have my initial installation files, the initrd, kernel
and parm files. This describes how I used those files to repair my Linux system.
My broken Linux used the following disk layout:
- 200 (dasda) - /
- 201 (dasdb) - swap
- 202 (dasdc) - /usr
- 203 (dasdd) - /home
- Boot the Linux install system. For me this was running REDHAT EXEC on my
Linux userid under VM.
For a system running in an LPAR, this could be done by IPLing from a tape drive.
- Follow the install instructions and SSH in, but do not run 'loader'.
- At this point, you have a functioning Linux, but the disks for the broken
version are not accessible. To make them accessible, you have to make device
nodes for each disk you need to access. Enter:
mknod -m 660 /dev/dasda b 94 0
mknod -m 660 /dev/dasda1 b 94 1
mknod -m 660 /dev/dasdc b 94 8
mknod -m 660 /dev/dasdc1 b 94 9
- You will probably have to load the DASD drivers for your disks
insmod dasd_mod dasd=200,202
- Now the file systems can be mounted.
mount /dev/dasda1 /mnt
mount /dev/dasdc1 /mnt/usr
- Change the active root directory from the install system to the broken
/mnt/usr/sbin/chroot /mnt /bin/bash
- Edit the zipl configuration file to point to the correct kernel version
using your favourite editor.
- Run zipl to rewrite the boot files to the boot disk.
- Get out of the chroot environment
- Unmount your file systems so that they will be "clean" when you reboot
umount /mnt/usr /mnt
- The install system will not shutdown, so just get a CP prompt on your 3270
session, and boot your fixed Linux. It should now come up normally.
For a system running in an LPAR, this would be done by re-IPLing from the HMC.
A big thanks to Neale Ferguson, Mark Post, Guillaume Morin and, last but not
least, Vic Cross for their help in fixing my Linux and refining this procedure.