Hard drive dying. Need to move Linux partition over.
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hard drive dying. Need to move Linux partition over.
Recently, my hard drive has been dying. (making dying noises and such, Windows freezes, had to reinstall windows, everything). It is a 80GB Western Digital hard disc, and I'm currently doing an advance RMA (Where they ship me a replacement hard drive before I even ship mine out until 30 days. This gives me the advantage to copy the OS over.) Now, is there a way I could do this? Move my whole mandrake 10.1 official OS over to the new HD with the right software? Is there a program in windows that could do this, like patition magic? Thanks...
if you're getting a straight swap with identical hardware you shouldn't have a problem cloing each partition via "dd" on the new drive, create partitions that match the old ones, and then use dd under a linux boot cd or something:
Code:
dd if=/dev/hda1 of=/dev/hdb1
that should clone the partition for you no problem. To be honest i've not done it myself ever, but that's how it get's done.
Last edited by acid_kewpie; 01-29-2005 at 05:11 PM.
1) Get both drives into the machine at once.
2) Install Windows (if you must!)
3) Use the Mandrake installer to create partitions exactly the same size as the Mandrake partitions on the old disk, or slightly larger.
4) Boot into a recovery CD
5) Copy the raw file systems across using DD
6) fsck
7) resize2fs
Yes I know this is not a complete answer, but hopefully you see what I'm getting at. The important point is that in Linux you can copy an entire drive partition as if it was just a normal file, which sorts out the copying, and that the Mandrake installer is all you need to sort out the partitioning.
Or as you say you could use Partition Magic, but that is not free software.
The parts 'pid=$!' and the second line are not necessary. The second line shows how to monitor the number of records read and written so far. You may find this convenient for a very large copy.
Another option is to use the tar command. This example is from an 'info tar' page.
Quote:
Notable `tar' Usages
====================
_(This message will disappear, once this node revised.)_
You can easily use archive files to transport a group of files from one
system to another: put all relevant files into an archive on one
computer system, transfer the archive to another system, and extract
the contents there. The basic transfer medium might be magnetic tape,
Internet FTP, or even electronic mail (though you must encode the
archive with `uuencode' in order to transport it properly by mail).
Both machines do not have to use the same operating system, as long as
they both support the `tar' program.
For example, here is how you might copy a directory's contents from
one disk to another, while preserving the dates, modes, owners and
link-structure of all the files therein. In this case, the transfer
medium is a "pipe", which is one a Unix redirection mechanism:
$ cd sourcedir; tar -cf - . | (cd targetdir; tar -xf -)
The command also works using short option forms:
$ cd sourcedir; tar --create --file=- . | (cd targetdir; tar --extract --file=-)
This is one of the easiest methods to transfer a `tar' archive.
You would need to partition the replacement drive ahead of time and mount it somewhere first. Then run the line for each partition.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.