Solved

dd and lilo boot to 2nd hard drive

Posted on 2000-04-13
6
300 Views
Last Modified: 2013-12-16
Hello,

I run a cron job that copies the 1st hard drive in my linux redhat 6.0 server to my 2nd hd. I use the following command: dd bs=81920 if=/dev/hda of=/dev/hdb

I do this in the event of an hda crash, I could possibly change the /etc/fstab file and pass lilo some parms and boot to my 2nd hard drive and be up and running. Also, I've got a new distribution release I'd like to reinstall fresh to hda and while I'm readying that for production during business hours I'd like to run off the 2nd hd on the older release.

My question is what parms do I need to pass to lilo to make this happen. I don't want to use a floppy if possible that's something extra to keep track of. Also, I thought I could do this straight from the lilo boot prompt and not have to hack the lilo.conf file.

We currently do this on our Sun Solaris machines and it works great. It gives you a good safety net as well. On a Sun box you can nvalias the boot path to a 2nd disk and at the OK prompt give the command boot <alias-name> and away you go.

Any ideas?

0
Comment
Question by:cd02154
6 Comments
 
LVL 4

Expert Comment

by:kiffney
ID: 2712130
From the lilo boot prompt you could just type
 
boot=/dev/hdb

to boot off that drive.  You would probably also have to add

root=/dev/hdb1
replacing hdb1 with whatever the root partition is, since linux stores the root partition name inside the kernel and you'll need to tell it to use a different root partition.   I don't think lilo (at least the version I'm using) can switch automatically - that would be a neat feature.  There's a Bootprompt-HOWTO with many kernel parameters like this you can set at boot time.
0
 
LVL 4

Expert Comment

by:kiffney
ID: 2712159
On further thought, you wouldn't need to do all this if hda were yanked, as hdb would now be hda.  But if hda was still in the machine, your /etc/fstab would still need to be edited - maybe you'd have to boot into 'single' mode and do all that.  The nvalias thing sounds neat but I don't know if Linux has that.
0
 
LVL 2

Expert Comment

by:bernardh
ID: 2714168
edit and add an entry to your /etc/lilo file

   label=linux2
   table=/dev/hdX

replace X with the name of your hard disk drive

re-read lilo with the command
 
   /sbin/lilo -v

reboot...when lilo prompt appears, press tab, select linux2



0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:toddrose
ID: 2714605
Several steps are needed for this to work smoothly.

1. You can boot with the RedHat CD and use this at th boot: prompt

root=/dev/hdb1 read-write

use the correct /dev that contains the '/' system.

I'm not sure if you can send any other partitions like /usr or /home.

you must use 'read-write' or the system will not be able to update system files or even boot cleanly.

2. (or possibly first) if you have multiple partitions listed in /etc/fstab they will have to be modified prior to attempting to boot for the second drive.  This should be do-able if you mount the second drive and edit the /etc/fstab entries in place.

3. Ideally I would recommend making a boot disk using a 'special' lilo.conf file.  This way you will know that you can boot up before you destroy /dev/hda.  This will also allow your system to reboot without user intervention after hours or any other time it is unattended.
0
 

Author Comment

by:cd02154
ID: 2723753
Kiffney,

You solution worked out the best for me. If you want to propose an answer I'll get you your points.

I ended up using the following at the lilo prompt: linux boot=/dev/hdb root=/dev/hdb8

That did exactly what I wanted.

Thanks!
0
 
LVL 4

Accepted Solution

by:
kiffney earned 100 total points
ID: 2723798
Sure, I'll propose this as an answer.  I think there is an option for you (as the questioner) to 'accept comment as answer' (but I'm not sure about that)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now