LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   copy whole drive sdb to sda3 (https://www.linuxquestions.org/questions/linux-newbie-8/copy-whole-drive-sdb-to-sda3-847850/)

EDDY1 12-02-2010 02:41 AM

copy whole drive sdb to sda3
 
I installed Debian squeeze to 40Gig pata hdd on my AMD 1090T desktop, with1Tb sata hdd.
Now that I'm quite comfortable with dual-booting, I'd like to transfer 40Gig Hd(sdb) to sda3.

I viewed this thread, which is similar to my situation, but not quite the formula.
http://ubuntuforums.org/archive/inde...t-1382181.html

I intend on reading more on this 1 to see if what I'm looking for is include.
http://www.linuxquestions.org/questi...ommand-362506/

I've never done the dd command, so it's not like I'm going to do it today, but would like a little bit more documentation to get a further understanding of the dd command.
Any suggestions are very much appreciated.
Thanks in advance.

catkin 12-02-2010 03:01 AM

You can't copy a whole drive such as /dev/sdb (unless it has no partitions?) to a partition such as /dev/sda3. You can copy partitions to partitions as long as the target partitions are at least the same size as the source partitions.

syg00 12-02-2010 03:10 AM

There are plenty of threads re how to do similar.
My advice - do *NOT* use dd for copying. You can't do as you requested as catkin indicated, and dd is the wrong tool anyway. Use a filesystem aware tool like cp or rsync. Search on that would be a better bet.

EDDY1 12-02-2010 03:11 AM

Thank you catkin
I've been installing and reinstalling os'es since march of this year, so now I'm trying to get to the point where I can save some of the information and the setup that I have without
always starting over. Is it posible to do this using blu-ray burner?

Thank you also sygOO

EDDY1 12-02-2010 03:36 AM

I have moved partitions using gparted-live-cd is it possible to do the same?

syg00 12-02-2010 03:51 AM

If you're looking for a "point in time" basis, I like to use something that verifies the data - see fsarchiver for example.
Use a liveCD.

i92guboj 12-02-2010 03:57 AM

Quote:

Originally Posted by catkin (Post 4177906)
You can't copy a whole drive such as /dev/sdb (unless it has no partitions?) to a partition such as /dev/sda3. You can copy partitions to partitions as long as the target partitions are at least the same size as the source partitions.

You can just as you can store any random data inside any block device, it will be just an unformatted partition in which regards the Linux user land tools. So, is is possible to store a whole disk layout this way. I agree that it is not too practical, though.

You don't need that in linux. Just tar the files, burn them or copy them somewhere and be happy.

All you need to restore that is to boot a livecd, format, un-tar the big thing and re-install your bootloader (this might not be needed, depending on how you did things).

EDDY1 12-02-2010 04:16 AM

That 1's very informative. Have to read up on it a little, and it's available through synaptic.

mlangdn 12-02-2010 08:09 AM

You can use cp to do this if sda3 is formatted and ready to go.

Code:

# cp -pidRv /dev/sdb/* /devsda3
the -pidRv preserves the data in the same state its in now - concerning permissions and timestamps, etc. Its just going to take a bit of time! That said, if you wish to boot from sda3, you will need to adjust whatever bootloader you use.

TobiSGD 12-02-2010 08:55 AM

Quote:

Originally Posted by mlangdn (Post 4178113)
You can use cp to do this if sda3 is formatted and ready to go.

Code:

# cp -pidRv /dev/sdb/* /devsda3
the -pidRv preserves the data in the same state its in now - concerning permissions and timestamps, etc. Its just going to take a bit of time! That said, if you wish to boot from sda3, you will need to adjust whatever bootloader you use.

Maybe I am confused here, but this will not work. It will only work if sdb is used without partitions, what I assume is not the case here.

mlangdn 12-02-2010 09:00 AM

The OP said that sdb is a 40gb hd. The OP does not mention if it has multiple partitions. I am assuming it is only one partition.

stress_junkie 12-02-2010 09:09 AM

Quote:

Originally Posted by mlangdn (Post 4178180)
The OP said that sdb is a 40gb hd. The OP does not mention if it has multiple partitions. I am assuming it is only one partition.

Also, it is possible to create an extX file system on an unpartitioned disk. It is probably ill advised due to the possibility of creating confusion when talking about it such as we see in this thread.

I recall that there was a recent thread about the person wanting to do this. I don't want to look it up.

TobiSGD 12-02-2010 09:15 AM

Quote:

Originally Posted by mlangdn (Post 4178180)
The OP said that sdb is a 40gb hd. The OP does not mention if it has multiple partitions. I am assuming it is only one partition.

Even the, shouldn't it be /dev/sdb1 in your post, and not /dev/sdb? May be I am confusing something here, but if he is asking how to copy this, I doubt he has a setup without partitions.

@EDDY1: To clear things can you please post the output of
Code:

fdisk -l /dev/sdb
Don't forget that you have to fire up the command as root.

mlangdn 12-02-2010 09:38 AM

You are correct TobiSGD. There could be a swap partition in there, or it could be on another drive. If EDDY1 runs the above command, it will be crystal clear how to copy.

EDDY1 12-02-2010 12:10 PM

Quote:

Maybe I am confused here, but this will not work. It will only work if sdb is used without partitions, what I assume is not the case here.
They're separate partitions

Quote:

@EDDY1: To clear things can you please post the output of
Code:

fdisk -l /dev/sdb

Don't forget that you have to fire up the command as root.
The device name maybe different but I'll post the output.


All times are GMT -5. The time now is 08:45 AM.