Solved

making bootable linux drive

Posted on 2000-05-08
3
194 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
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.

830 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