LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-21-2006, 01:52 AM   #1
rhythmking
Member
 
Registered: Dec 2003
Posts: 54

Rep: Reputation: 15
slack 10 hard disc copy and config


I just replaced my spare 20 gig hard drive with a 7200 rpm 120 gig.
I partitioned it as hdb1 linux and hdb2 swap
I want to copy my hda1 linux partition to the new 7200 rpm drive and use it as the main linux partition with hdb2 as the swap.
Is there an easy way to do this.

Thanks in advance for any help.
 
Old 11-21-2006, 02:20 AM   #2
milkycow
LQ Newbie
 
Registered: Jan 2004
Posts: 29

Rep: Reputation: 15
Assuming you want to replace the old drive and boot from it:
first you copy the MBR:
Code:
dd if=/dev/hda of=/dev/hdb count=1 bs=512
then you partition it (you already did this, though I'm not sure if copying the MBR affects the partition table)
and then you create a filesystem on hdb1 with mkreiserfs or whatever FS you use
and finally you can just mount hdb1 and do a
Code:
cp -a / /path/to/hdb1
or if you prefer, do cp -a on each directory under / individually, since you don't need to copy /dev or /proc over
 
Old 11-21-2006, 08:12 AM   #3
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
Code:
 dd if=/dev/hda of=/dev/hdb conv=noerror,sync bs=4k
this command is copy a drive (/dev/hda) directly to another hard drive (/dev/hdb)

take care, using dd. read before doing it, also take care about the entries after "if" and "of"
 
Old 11-21-2006, 08:14 AM   #4
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
Quote:
Assuming you want to replace the old drive and boot from it:
first you copy the MBR:
Code:

dd if=/dev/hda of=/dev/hdb count=1 bs=512
this also copies your partition table, just google around and see
Quote:
and then you create a filesystem on hdb1 with mkreiserfs or whatever FS you use
and finally you can just mount hdb1 and do a
Code:

cp -a / /path/to/hdb1
not a prefered way, also with dd yuo dont need to mount the hard disk
 
Old 11-21-2006, 09:13 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: SlackwareŽ
Posts: 13,453
Blog Entries: 32

Rep: Reputation: 2641Reputation: 2641Reputation: 2641Reputation: 2641Reputation: 2641Reputation: 2641Reputation: 2641Reputation: 2641Reputation: 2641Reputation: 2641Reputation: 2641
Hi,

FYI, a good link for a LQ reference of DD.

AwesomeMachine has done a great job on this thread!
 
  


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
slack boot disc zux Slackware - Installation 4 09-08-2006 03:16 AM
slack disc mount cormack Slackware 1 11-24-2005 12:46 PM
copy hard disc data, with permissions tidasu Linux - Newbie 3 08-29-2004 09:30 PM
Changed normal debian to hard disc version of knoppix - lilo config bigjohn Debian 13 10-04-2003 02:39 PM
Disc clone/copy szak Linux - Newbie 1 01-21-2002 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:41 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration