Solved

making bootable linux drive

Posted on 2000-05-08
3
191 Views
Last Modified: 2010-04-20
I'm replacing my hard drive in my linux box - but i dont want to have to reinstall linux - is there a way of making it bootable so I can just copy my entire exiting drive over to it?  (i.e. mount new hard drive alongside existing one, copy stuff over, make new drive bootable, then reboot with only new drive in box)

i have a feeling this is going to be quite simple using lilo - but i can't find the right command line switches

(also, there is no CDROM or floppy drive in the machine so I can't boot except from a hard drive)
0
Comment
Question by:shivers
3 Comments
 
LVL 4

Accepted Solution

by:
kiffney earned 100 total points
ID: 2788538
Sure, we do this all the time here.  Install the new drive as the second drive, create all your partitions on the new drive with fdisk, mount the new drive (let's say it's on /mnt/hdb), copy things them over with something like
cd /usr
cp -ax * /mnt/hdb/usr/

then do

lilo -v -r /mnt/hdb

then shutdown, remove the old drive, put the new drive on the first channel, and reboot to test things.  The nice thing is you will have your old drive preserved in case things get biffed up.
0
 
LVL 2

Expert Comment

by:tzanger
ID: 2810789
kiffney's way looks good, I'm not certain if the -x option to cp will stay out of /proc or not (it *should*).  -x will definately stay out of the /mnt directory.

If -x doesn't stay out of /proc, you can umount /proc.
0
 
LVL 1

Author Comment

by:shivers
ID: 2811106
luvly!  I haven't had a chance to do it yet as ~I dont have the new drive yet, but that info was just what i was looking for :)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
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 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…

708 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

14 Experts available now in Live!

Get 1:1 Help Now