LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-14-2006, 09:20 PM   #1
brgr88
Member
 
Registered: Apr 2006
Distribution: Slackware 14.2
Posts: 48

Rep: Reputation: 15
Making mirror copy of a partition with CP command?


I have Slackware 10.2, though I guess this question isn't distro-specific.

Currently, I have mounted:
/dev/hdb6 on /
/dev/hdb1 on /boot
/dev/hdb5 on /home

I've formatted a new ext3 partition as
/dev/hdb7
mounted on
/mnt/hd

Basically, I want to create a 'mirror' copy of my base install (hdb6) onto hdb7 so I can mess around with stuff in hdb7 w/o messing up my base working system on hdb6. If I'm in /dev/hdb6 and copy like so:
cp -r /* /mnt/hd

Am I looking at problems with those different partitions mounted as '/boot' and '/home'? Since hdb7 is mounted on the current root, but is also the one I'm copying to, is there going to be some looping issues to worry about?

Is there a better way to do this? Perhaps some special utility for copying entire partitions as opposed to a mounted filesystem? Maybe I'm not wording that right...

I guess I could just re-run the install CD on hdb7, but now I'm wondering if there's a quicker way.
 
Old 05-14-2006, 09:40 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Do it from a liveCD - then all your (valid) concerns evaporate.
 
Old 05-14-2006, 11:49 PM   #3
brgr88
Member
 
Registered: Apr 2006
Distribution: Slackware 14.2
Posts: 48

Original Poster
Rep: Reputation: 15
syg00, thanks, I didn't really think of that. Anyway, the 'cp' method went into an endless loop somewhere in '/dev/fd' and filled up all the space, but I remembered the DD command and used that and it seemed to work ok.

Looking back (and at man pages for cp), I probably could've used 'cp -R -P' to not follow symblinks.
 
Old 05-15-2006, 12:09 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
I deliberately avoided mentioning dd (and partimage) for this. The image you get is the same size (regardless of larger target partition) due to the filesystem being copied "as-is". Can be rectified, but just extra grief.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PERL: how to mirror copy images to another server? <db> Programming 4 04-26-2006 07:08 PM
Copy files from partition to partition too slow, SATA hard disk.What should I do£¿ Ryanlee SUSE / openSUSE 20 10-31-2005 07:30 AM
W2k Server, making a mirror!!! shakespy Slackware 4 08-05-2004 09:38 PM
making an exact cd copy coolamit78 Linux - Software 2 04-04-2004 02:03 PM
dd mirror command for 2 OSes thecatandmouse Programming 1 08-14-2001 06:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration