LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-14-2013, 03:53 PM   #1
Magic02
LQ Newbie
 
Registered: Jul 2005
Location: Ireland
Distribution: Suse 9.3 Pro
Posts: 15

Rep: Reputation: 0
Copy between Two USB Hard drives


I have a 160Gb usb hard drive and I want to copy it's contents to a 1Tb usb hard drive.I have Ubuntu 13.04 installed.how do I go about it?
 
Old 11-14-2013, 04:30 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Assuming the 160 gig drive is one partition, and with the partitions (source and destination) mounted, you could the tar command to copy the files to the larger drive:
From tiplib.com
Code:
Copy filesystem to another filesystem using tar

We assume /source/dir is a filesystem, if there are other filesystems under /source/dir they
will also be copied to /destination/dir

cd /source/dir
tar -cf - . | ( cd /destination/dir ; tar -xpvf - )
 
Old 11-14-2013, 04:49 PM   #3
Dman58
Member
 
Registered: Nov 2010
Location: The Danger Zone
Distribution: Slackware & everything else in a VM
Posts: 286

Rep: Reputation: 29
Maybe something like:

Code:
cp -vr /path/of/source /path/to/destination
Optionally you can leave out the (-v) option but but you won't see any screen output until its completed
 
Old 11-14-2013, 05:20 PM   #4
Magic02
LQ Newbie
 
Registered: Jul 2005
Location: Ireland
Distribution: Suse 9.3 Pro
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks Will i still have a one terabyte had when I am finished
 
Old 11-14-2013, 05:22 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
The same way you copy any file/dir from one location to another. cp, rsync, etc.

Personally, I would use rsync -a so that everything is preserved (owner, timestamps, etc) and you can stop/resume the copy at any point:
Code:
rsync -av /path/to/source/ /path/to/destination/
 
1 members found this post helpful.
Old 11-14-2013, 05:26 PM   #6
Magic02
LQ Newbie
 
Registered: Jul 2005
Location: Ireland
Distribution: Suse 9.3 Pro
Posts: 15

Original Poster
Rep: Reputation: 0
Many thanks I will try tomorrow and post back.
 
Old 11-14-2013, 10:51 PM   #7
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 304

Rep: Reputation: 121Reputation: 121
Quote:
Originally Posted by Magic02 View Post
Thanks Will i still have a one terabyte had when I am finished
Using any of the three methods posted above, you will still have a one terabyte filesystem when you are finished.

rsync would be my preference too.

Last edited by Beryllos; 11-14-2013 at 10:54 PM.
 
Old 11-18-2013, 11:03 AM   #8
Magic02
LQ Newbie
 
Registered: Jul 2005
Location: Ireland
Distribution: Suse 9.3 Pro
Posts: 15

Original Poster
Rep: Reputation: 0
I copied it over using the dd command but some of the files are pausing and not playing right so i want to try the rsync command but i cannot get it to work.Could you give me an example witn sdc1 as the input and sdd1 as the target drive.Thanks I am new to Linux.
 
Old 11-18-2013, 11:21 AM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Two questions:

1) How did you use dd? What was the exact command?
2) WHY did you use dd? Nobody here recommended it, and that's for good reason. It is NOT designed to do what you asked in your original post. Why even bother posting this thread if you're not going to listen to the responses?


As for using rsync, as with ALL of the methods posted above, the drives need to be mounted first. These solutions do NOT work on the raw disk like dd does (again, for good reason).

You probably need to reformat your 1TB drive now, as I suspect you trashed the filesystem using dd. I hope you didn't have anything valuable on it...

Last edited by suicidaleggroll; 11-18-2013 at 11:23 AM.
 
Old 11-18-2013, 11:25 AM   #10
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
can you please post the output of df -h.

have you tried opening a file manager and rite-clik-copy the files and directorories you want and dragging them to the other location ?
 
Old 11-18-2013, 04:53 PM   #11
Magic02
LQ Newbie
 
Registered: Jul 2005
Location: Ireland
Distribution: Suse 9.3 Pro
Posts: 15

Original Poster
Rep: Reputation: 0
I used dd if=/dev/sdc1 of=/dev/sdd1 and it copied everything across.I could not get rsync to work and i got the dd command from a man who had a similar problem on this site.I am not sure if the problem could be that the Dreambox cannot handle a 1Tb hard drive or what.I tried what one member said here to my post to copy and paste and it is copying ok but it is 90gb of data so i will try it again then.I had nothing on the drive so i have not lost anything so it is no problem.
 
Old 11-18-2013, 05:08 PM   #12
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by Magic02 View Post
I used dd if=/dev/sdc1 of=/dev/sdd1 and it copied everything across.I could not get rsync to work and i got the dd command from a man who had a similar problem on this site.
Then why didn't you ask what you were doing wrong? Are you sure the person with the dd command had same problem? Probably not. dd is used for an entirely different task than what you asked about in this thread.

In short, you asked for a way to copy files. dd, in the way that you used it, copies disks. Not just the files on the disk, but the disk itself, and every bit on it, used and unused. It doesn't care what's on the disk, it just copies it over, bit for bit, to the destination, wiping out everything in its path, including the filesystem

You can think of a disk like a plot of land, while a filesystem is a library built on that land, and files are books in the library. You asked for a way to copy files from one drive to another, that's like asking how to move some books from library A into library B. By using dd, you bulldozed library B and built a brick-for-brick copy of library A in its place. See the difference?

You need to be working on the filesystem level, NOT the raw disk, to accomplish what you asked about. You should reformat your 1 TB disk...wipe it and re-partition it from scratch. Then mount both drives and use any of the above suggestions to copy the files over.

Quote:
Originally Posted by Magic02 View Post
I am not sure if the problem could be that the Dreambox cannot handle a 1Tb hard drive or what.
Doubtful. The more likely explanation is that dd corrupted the filesystem on your 1 TB drive.

They don't call dd "Disk Destroyer" for nothing.

Last edited by suicidaleggroll; 11-18-2013 at 05:22 PM.
 
1 members found this post helpful.
Old 11-18-2013, 06:41 PM   #13
Magic02
LQ Newbie
 
Registered: Jul 2005
Location: Ireland
Distribution: Suse 9.3 Pro
Posts: 15

Original Poster
Rep: Reputation: 0
http://www.linuxquestions.org/questi...nother-894643/.
Is that the same as I want to do.i will do what you suggested.in bed now.Thanks
 
Old 11-18-2013, 07:23 PM   #14
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Yes he's wanting to do the same thing, I'll let schneidz explain his reasoning for recommending dd in that application. It seems like he was just offering a bit-for-bit mirror option in case that's what the OP was really looking for.

Essentially, dd is good for mirroring a disk. This is VERY useful when you have a corrupted disk or deleted file you want to recover, you can use dd to mirror the disk into an image file (or onto another disk) and then work with the mirror to try to recover your data, rather than working with the original disk and risk corrupting it further. This works well since dd is not copying files, it's doing a bit for bit copy of the disk's actual contents...empty space, used space, it's all just bits on a platter, and it all gets copied equally.

dd is also useful for cloning a disk - partition table, boot sector, everything. It's good for when you set up a system exactly like you want it, and then clone the disk to a backup. Years later you might get a corruption, and you can just swap in your mirrored disk and pick right back up where you left off.

dd is not so good for copying or backing up files/directories, though. For one, the disk onto which you're copying becomes a mirror of the original - size, filesystem type, etc. Two is that dd copies everything, the entire disk. Even if you only have 1 1MB file on your source drive, dd is going to copy all 160 GB, every time you want to make a backup.
 
1 members found this post helpful.
Old 11-18-2013, 07:32 PM   #15
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 276Reputation: 276Reputation: 276
If you can't get rsync to work, probably because of syntax, install grsync, which is a gui frontend for rsync. If you can't make that work, you really need to spend some time learning computer basics.
 
  


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
USB SCSI hard Drives Dan Willis Linux - Newbie 2 12-17-2009 04:07 AM
Copy of IBM Server hard disk data to Another USB External Hard disk mazharcdn Linux - Server 2 09-02-2009 01:41 AM
On Mounting USB Hard Drives jerm1701 Linux - Hardware 2 04-17-2007 02:24 AM
Using 'dd' to copy hard drives? SlowCoder Linux - Newbie 3 02-20-2007 11:18 PM
USB External Hard drives lukepiewalker Fedora 2 08-03-2005 10:14 AM


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