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.
Greetings and thank you in advance for any helpful comments.
I am a pleased, new SUSE 10 user. I need to upgrade the hard drive in my Linux machine to one of greater capacity. I'd like to "clone" my current drive and move it to the new drive. If you have successfully done this, I would appreciate any advice.
I have not actually done this, but here are the steps:
Assuming that the current drive is on primary ide...... WARNING: The slightest mistake can wipe out your current setup
Backup any important data
Connect the new drive to--eg the secondary IDE--keeping the other drive where it will boot.
Do "fdisk -l" to be sure which drive is which--lets assume that old = /dev/hda1 and new = /dev/hda2
Issue this command (as root):
dd if=/dev/hda1 of=/dev/hda2 bs=1M (This only works if the target (of) is larger than the source (if) )
Wait**
**If you want to know how LONG you will be waiting, add "count=10" to the dd command. This will copy 10MBytes. Look at how long this takes and then do the math to see how long the whole thing will take.
e.g.: 80GB disk at 10MB/5 seconds => 11 hours
Cloning will make an exact copy of your current disk to the new one. That includes making the partitions on the new disk the same size as they are on the current one, which may not be what you want. If all four slots of your primary partition table are currently used, your new disk will appear to be the same size as your existing one after cloning. You will then have to resize partitions to make use of the bigger disk. That can be messy.
I would recommend partitioning the new disk manually and creating the filesystems manually (i.e., "format" them). Then copy, not clone, your existing installation manually.
If you don't want to do that, I'd suggest at least partitioning manually, then cloning old-to-new on a partition by partition basis (not the whole disk at once). Then you can resize your filesystems to match their new partition sizes.
Note that with any type of cloning, the destination partition must be at least as large as the source partition. With copying, you can easily copy a larger source partition to a smaller destination one, provided what is actually used on the source will fit on the destination. e.g., a 1Gb source partition that only had 100Mb of data on it could by copied, but not cloned, to a destination partition of 100Mb. Cloning in this example would require your destination to be at least 1Gb - same as the source.
I personally consider cloning (or recovering a system using an image) to be something you do when you need to get up and running really fast. There are limitations, but the procedure is fast. Manual partitioning and copying, while slower and more labor intensive, gives you more flexibility. Chose whichever method best fits your needs.
If it is possible, you could use both drives. For example, you could mount the new drive under /home/yourusername. Or you could mount it someplace else and change the home directory entry in /etc/passwd to reflect your changes. Using the dd command to make an image copy would result in partitions that are the same size.
Also, check out the examples in the "info tar" info pages. There is an example where the contents of a directory are transfered by piping the files through the tar command.
Quote:
4.6 Notable `tar' Usages
========================
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.
Mandriva has a very good GUI partitioning program that may allow you to graphically copy from one partition to another. It's been some time since I used Mandrake Linux so I don't remember for sure.
I thank you all for your replies. I see what I need to do is install the second, larger drive; then format and partition it to make use of the increased disk capacity. Then I copy my existing install to it. This will make for quite a learning experience. Thank you again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.