Solved

dd and lilo boot to 2nd hard drive

Posted on 2000-04-13
6
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

626 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