Talk Root - PC Hardware, Software and Web Development forums

Go Back   Talk Root - PC Hardware, Software and Web Development forums > Operating Systems > Linux Discussion > Red Hat


Welcome to the Talk Root - PC Hardware, Software and Web Development forums. Are you a programmer, web developer, IT guy or a computer guru? We invite you to join our forums and participate in friendly discussion. It doesn't matter your skill level, we are here to help everyone.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Sponsored Links
Reply
 
LinkBack Thread Tools Rate Thread
Old 02-18-2004, 09:38 PM   #1
Mick Arundell
 
Posts: n/a
Clone Linux install onto a larger drive

Hi all,
How do I go about cloning an existing Linux installation complete with
data onto another, and much larger, hard drive?

Mick
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 02-18-2004, 10:45 PM   #2
Robert M. Riches Jr.
 
Posts: n/a
Re: Clone Linux install onto a larger drive

In article <40343dc0$1@news.comindico.com.au>, Mick Arundell wrote:
>
> How do I go about cloning an existing Linux installation complete with
> data onto another, and much larger, hard drive?


Just do it. Plug both drives in, boot, partition the new
drive with fdisk, use tar or 'cp -p' to copy the stuff over,
adjust /etc/fstab on the new drive, shut down, unplug the
old driver, boot from the new one.

One thing to watch out for is filesystem labels. Red Hat
systems typically use LABEL=... in /etc/fstab. If you try
to boot while you have two drives plugged in, giving you
duplicate labels (one on each drive), it won't boot. Get
_everything_ right, _then_ assign labels to the new drive,
then power down. Otherwise, don't use labels to boot from
the new disk. Knoppix can be useful for fixing up little
details.

Good luck.

Robert Riches
spamtrap42@verizon.net
(Yes, that is one of my email addresses.)
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-19-2004, 12:24 AM   #3
chris@nospam.com
 
Posts: n/a
Re: Clone Linux install onto a larger drive

On Thu, 19 Feb 2004 05:46:12 GMT, "Robert M. Riches Jr."
<spamtrap42@verizon.net> wrote:

>In article <40343dc0$1@news.comindico.com.au>, Mick Arundell wrote:
>>
>> How do I go about cloning an existing Linux installation complete with
>> data onto another, and much larger, hard drive?

>
>Just do it. Plug both drives in, boot, partition the new
>drive with fdisk, use tar or 'cp -p' to copy the stuff over,
>adjust /etc/fstab on the new drive, shut down, unplug the
>old driver, boot from the new one.
>
>One thing to watch out for is filesystem labels. Red Hat
>systems typically use LABEL=... in /etc/fstab. If you try
>to boot while you have two drives plugged in, giving you
>duplicate labels (one on each drive), it won't boot. Get
>_everything_ right, _then_ assign labels to the new drive,
>then power down. Otherwise, don't use labels to boot from
>the new disk. Knoppix can be useful for fixing up little
>details.



It will boot, but you're taking a gamble on which partition it will
actually use. Usually it's the first one it sees with that label, but
I've seen it pick the partition on the slave IDE first.

-Chris
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-19-2004, 07:29 AM   #4
RodgerH
 
Posts: n/a
Re: Clone Linux install onto a larger drive

Mick Arundell wrote:
> Hi all,
> How do I go about cloning an existing Linux installation complete with
> data onto another, and much larger, hard drive?
>
> Mick


Here is how I do it, with a clone script. It has worked well for me.


# CLONE procedure - read carefully.

# BEFORE running this clone script:
# - review the entire script and list of directories to be copied.
# - !! Unmount everything from /mnt before running this.
# - create a mount point called /temp_clone
# - format and mount your target partition

# AFTER running this clone script:
# - update the /etc/fstab on the cloned drive to reflect your changes.
# - update Grub.conf to reflect your new boot layout.
# - you may need to adjust your permissions for some directories, like home


# define target mount point for the empty target partition (do no place
# under /mnt !)
tgt='/temp_clone'


# format & mount the empty partition to receive the copy of the system
#mkfs.ext3 /dev/hdg1
#mount -t ext3 /dev/hdg1 $tgt


# define option string for cp (copy command)
#opt=' --archive --verbose --preserve --recursive --no-dereference '
opt=' -av '

echo "Cloning mountpoint set to: " $tgt
echo "Option string is: " $opt

# start cloning
src='/boot'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/bin'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/dev'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/etc'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/initrd'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/lib'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/lost+found'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/mnt'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/root'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/sbin'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/tmp'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/usr'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

src='/var'
echo "Cloning " $src " to " $tgt
cp $opt $src $tgt

echo "Creating new proc dir..."
mkdir /temp_clone/proc
chmod 555 /temp_clone/proc

echo "Creating empty home dir..."
mkdir /temp_clone/home

echo "Creating empty opt dir..."
mkdir /temp_clone/opt
echo "Done."



--
Regards,

RodgerH
---
Registered Linux User #285004
---
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 08:46 AM.


Sponsors
Banner Best Deals 24x7 @ Geeks.com!
Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0 RC8
vB Ad Management by =RedTyger=
© 2006 TalkRoot.com -