LinuxQuestions.org
Review your favorite Linux distribution.
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 04-07-2004, 09:03 PM   #1
AudioMechanic
Member
 
Registered: Jun 2003
Distribution: OpenSUSE 12.3, CentOS 6, Xubuntu 13.04
Posts: 125

Rep: Reputation: 16
Copying drives in Linux...


Just as the title says, how do I copy a drive in Linux? I have Mandrake Linux installed on a 20GB drive and would like to transfer everything over to a 60GB drive and place the 20GB drive in another computer for other purposes.

How would I go about doing this? I'm sure that I install the 60GB drive in the Mandrake Box as "slave" and then erase it but from there I have no idea.

Thanx in advance for any suggestions or help!
 
Old 04-07-2004, 09:24 PM   #2
karlan
Member
 
Registered: Aug 2003
Location: San Francisco, California
Distribution: Slackware
Posts: 158

Rep: Reputation: 30
I don't know if you could use dd("man dd"), try to look that up. If you want the safe route use mv or cp("man mv" "man cp")......


"dd if=/dev/hda of=/dev/hdb" ??(try the copy method, I'm not sure if this leaves space)
"cp -dr / /mnt/hdb1/"

Last edited by karlan; 04-07-2004 at 09:26 PM.
 
Old 04-07-2004, 09:40 PM   #3
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 60
On a large hard drive using dd could take days to complete.
Man there are times when using paid for software is just plain better. That software happens to be Norton Ghost. I just did a disk copy on a linux box this afternoon and it is the cats meow ( IMHO of course ).
Ghost has the disk to disk option and you can change the size of partitions before it starts.
At this time there just isn't a better, faster way of doing this.
 
Old 04-07-2004, 10:23 PM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Could "dd" be used to copy a drive to an image file, instead of a another drive?
 
Old 04-07-2004, 10:28 PM   #5
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 60
If you really really want to use a linux tool, I would use partimage to save individual partitions ( can't do the whole drive in one shot yet ). Using the dd tool to save partitions to an image file would be painfully slow because it copies everthing ( used or not ) where partimage only copies the used data.
 
Old 04-07-2004, 10:42 PM   #6
Pwnz3r
Member
 
Registered: Jan 2004
Location: Lancaster, OH
Distribution: Gentoo
Posts: 393

Rep: Reputation: 30
You could also do:

tar -cjf /mount-point-of-other-drive/mandrake.tar.bz2 /

That would compress it into bzip2 format and make take transfer time down, and then you can extract it from the other drive.

Last edited by Pwnz3r; 04-07-2004 at 10:44 PM.
 
Old 04-08-2004, 07:52 AM   #7
AudioMechanic
Member
 
Registered: Jun 2003
Distribution: OpenSUSE 12.3, CentOS 6, Xubuntu 13.04
Posts: 125

Original Poster
Rep: Reputation: 16
Thanx for all the replies everyone! The one of these choices that I am most familiar with is Norton Ghost. I use it at work almost everyday. I just never knew that it could be used for drives that had a different filesystem than FAT, FAT32, or NTFS. In other words, I though that you could only copy windoze drives. I'll bring home a copy of Ghost tonight and try it out!

Thanx again!
 
Old 04-16-2004, 05:16 AM   #8
dukeinlondon
Member
 
Registered: May 2003
Location: London
Distribution: kubuntu 8.10
Posts: 593
Blog Entries: 1

Rep: Reputation: 30
Did it go ok ? I am doing a similar operation and I am interested in the outcome.
 
Old 04-16-2004, 07:57 AM   #9
AudioMechanic
Member
 
Registered: Jun 2003
Distribution: OpenSUSE 12.3, CentOS 6, Xubuntu 13.04
Posts: 125

Original Poster
Rep: Reputation: 16
Well, I used a copy of Norton Ghost from my work and tried to copy my Linux drive from a 20GB to a 60GB HDD. It looked like it transfered ok but the system wouldn't boot on the 60GB after that. I basically just transfered all my data from that HDD over to my GF's computer (she has Mandrake also) and wiped the 60GB and started over with the installation on it.

Didn't work out as planned but still worked out ok!
 
Old 04-16-2004, 09:03 AM   #10
dukeinlondon
Member
 
Registered: May 2003
Location: London
Distribution: kubuntu 8.10
Posts: 593
Blog Entries: 1

Rep: Reputation: 30
Sort of gathered that I would have to go down the reinstall route. I am only annoyed by the time that it will take. never mind.

Thanks for the feedback
 
Old 04-16-2004, 09:19 AM   #11
arnold
Member
 
Registered: Dec 2002
Posts: 226

Rep: Reputation: 30
This is clearly too late for the original post. However, there was some misinfo
and AudioMechanic's 1st try failed -so, for the record:

on the use of dd: if you dd if=20GB of=60GB,
you will have a 20GB image on the 60 GB - 40 GB unused.

"painfully slow" - you are not obliged to sit in front of your computer when you
copy drives. How often do you copy large partitions? Perhaps it takes hours?
So what? Has to be faster than
"transfered all my data from that HDD over to my GF's computer ... and started over with the installation"

This assumes AudioMechanic was copying a 20GB partition to a 60GB partiton.
If multiple partitions, repeat following for each partition (with modifications if there are FAT* partitions):

/sbin/mkfs.ext2 /dev/60gb # or /sbin/mkfs.ext3
mount /dev/60gb /mnt/60gb
cd /mnt/20gb
cp -Rpd . /mnt/60gb 2>/tmp/copying.err

have a smoke

after copying complete, do some checkout:
less /tmp/copying.err # just in case
du -s /mnt/20gb /mnt/60gb # should be close
ls -CF /mnt/20gb /mnt/60gb|less # low value "eyeball" tesst

if /dev/60gb will be new root partition:
edit /mnt/60gb/etc/fstab to set root partition to /dev/60gb
chroot /mnt/60gb
ls -l # run a few commands to see that things work
exit

if /dev/60gb is not new root ,
edit /etc/fstab to mount /dev/60gb on next boot
 
Old 04-16-2004, 09:30 AM   #12
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,288

Rep: Reputation: 65
Dang. Something's wrong if it takes days. I can copy a 80 gig hard drive to another in 45 minutes. Making the block size a little bigger helps speed. also having on a different cable helps too.
hdparm -d1 /dev/hda /dev/hdc # to make sure dma is on.
dd if=/dev/hda of=/dev/hdc bs=1M

after that finishes, remove the 20 gig drive, and put the 80 gig as primary master.
it should boot fine and everything then. i do it all the time. then use a partition program to increase the size of hda1 or create a new partition using the empty space, and use it how you wish.
my drives copy almost 2 gigs a minute with the above stuff. i added a counter into my custom dd to show me the megs copied, so i can see if something is wrong with the speed right away.
 
Old 04-16-2004, 09:38 AM   #13
dukeinlondon
Member
 
Registered: May 2003
Location: London
Distribution: kubuntu 8.10
Posts: 593
Blog Entries: 1

Rep: Reputation: 30
Thanks, that sounds like the way to go. Does the target drive need to be void of existing partition or does dd bulldoze the whole thing ?
 
Old 04-16-2004, 09:56 AM   #14
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,288

Rep: Reputation: 65
it bulldozes. the partition table is about the first thing overwritten.
 
Old 04-16-2004, 10:05 AM   #15
dukeinlondon
Member
 
Registered: May 2003
Location: London
Distribution: kubuntu 8.10
Posts: 593
Blog Entries: 1

Rep: Reputation: 30
Gooood.
 
  


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
burning and copying cds to multiple drives quercusalba Linux - Software 4 09-25-2005 12:46 AM
Copying a windows or linux install to a new hard disk using linux.... some_cs_student Linux - Software 7 05-24-2004 08:17 PM
Mountind drives / Copying file from home drive to floppy ozwalker Linux - Newbie 1 09-04-2003 10:06 PM
Copying and distribution of Linux elzmaddy Linux - General 17 05-07-2003 10:15 PM
problems w/ copying from cd drives yocompia Linux - Newbie 4 05-03-2003 06:56 PM

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

All times are GMT -5. The time now is 05:03 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