Solved

dd and lilo boot to 2nd hard drive

Posted on 2000-04-13
6
305 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SMB share across internet 15 116
I NEED A "BARE" LINUX ... 9 123
python - find anything after $ question. 9 87
MySql Linux vs Windows: bad results for Windows but why? 10 76
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

710 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