Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

dd and lilo boot to 2nd hard drive

Posted on 2000-04-13
6
Medium Priority
?
310 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
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 400 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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

705 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