Serving Two Masters
In spite of all the Linux zealots who infect the comp.os.linux.advocacy Usenet newsgroup with cries for the total elimination of MS-Windows—and usually Microsoft, as well—there are many people who want to be able to switch between Linux and Windows 95. Many users who were using LILO to choose easily between Windows 3.x and Linux installed Windows 95, and then found that Linux would no longer boot. Some who use LOADLIN also found that they were in trouble.
Windows 95 follows a “world domination” strategy when it is installed; it overwrites the master boot record on the hard drive with one which, by default, only boots Windows. The master boot record is essentially a very small program that is loaded from a fixed place on the hard drive as the first step of loading an operating system from the hard drive. The boot record installed by old versions of MS-DOS and by Windows 95 is very limited: it is only capable of allowing the boot process to proceed to the single partition which is marked as the “active” partition.
In contrast, the LILO loader that comes with Linux installs a boot record which allows you to choose to continue booting from any partition quite easily. In fact, LILO even allows you to boot from partitions on the second drive, something that the DOS master boot record cannot do. LILO's boot record is capable of booting Windows 95.
Notice that I didn't call LILO's boot record a “master” boot record. That's because while it can be installed as the master boot record, it doesn't have to be. On each partition on your hard drive, there is another boot record. When the DOS master boot record boots from the active partition, it does so by loading the boot record on the active partition. LILO's boot record can be installed either as the master boot records on the hard drive or as the boot record for your Linux partition.
In order to use LILO, therefore, you need to either install LILO's boot loader as the master boot loader, or install it as the boot loader on your Linux partition and make your Linux partition active. The advantage to installing it as the boot loader on your Linux partition and making your Linux partition active is that the next time you install Windows, all you will have to do to use LILO to choose your operating system is use the DOS fdisk program to make your Linux partition active.
Recovery recipe: Use an emergency boot floppy or boot from your installation boot/root floppy or floppy set. Get a shell prompt, probably either by choosing it from a menu or by pressing Alt-F2 (see the documentation for your Linux distribution if you don't know how to get a shell prompt). Then execute the following commands:
mkdir /mnt mount -t ext2 /dev/rootdevice /mnt /mnt/sbin/lilo -r /mnt umount /mnt
This assumes that /mnt does not exist; if it already exists, you don't need to create it. rootdevice is the name of the device that holds your root filesystem, such as hda2 (second partition of your first IDE hard drive) or sda1 (first partition of your first SCSI hard drive). If you don't remember which it is, you may have to use the fdisk program, which should be included with both installation programs and emergency boot disks, to find it. The -r /mnt part means to pretend that /mnt is your root directory. If your distribution didn't put lilo into the /sbin directory, you may have to look for it.
At this point, you should be able to reboot with the same options that you had before installing Windows 95.
Alternative recovery recipe: Again, boot from your emergency boot floppy or installation boot floppy, but add the command-line argument root=/dev/hda2 or root=/dev/sda1 or whatever partition is your root partition. This should eventually look as if you just booted off the hard drive normally. Now, simply log in as root and run the lilo command. You should now have the same booting options you had before you installed Windows 95.
Recipe to avoid future disaster with LILO: In your /etc/lilo.conf file, change boot=/dev/hda or boot=/dev/sda to point to the primary partition which holds your boot images. This is important on large hard drives; you may have partitions which use disk space that is not part of the first gigabyte on the disk, and that, as you probably know, is inaccessible to the BIOS which starts the bootstrap process. With your boot=/dev/hda3 or boot=/dev/sda4 statement in place in /etc/lilo.conf, run the lilo command. This will install the LILO boot sector on the partition named in the boot= statement.
Now, use the fdisk program to make the Linux partition on which you just installed the boot sector the active partition. You can do this either with the Linux fdisk program or with the DOS fdisk program.
Now, the next time you have to re-install Windows 95 because your .INI files are hopelessly messed up, or Windows 95 refuses to run for no reason, you will be able to boot Linux just by running the DOS/Windows fdisk program and making the Linux partition the active partition. Reboot, and LILO will be working again.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Tips for Optimizing Linux Memory Usage
- Secure Desktops with Qubes: Introduction
- Working with Command Arguments
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Fancy Tricks for Changing Numeric Base
- Secure Desktops with Qubes: Installation
- CentOS 6.8 Released
- Linux Mint 18
- The Italian Army Switches to LibreOffice
- Petros Koutoupis' RapidDisk
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide