LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 11-17-2006, 03:20 PM   #1
Alphasiderius
Registered User
 
Registered: Feb 2006
Distribution: SuSE 10 (Novell)
Posts: 5

Rep: Reputation: 0
How to Handle hard drive Upgrade


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.

Thank you.
 
Old 11-17-2006, 03:24 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Is it possible to connect both disks to your machine at once?
 
Old 11-17-2006, 06:07 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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
  1. Backup any important data
  2. Connect the new drive to--eg the secondary IDE--keeping the other drive where it will boot.
  3. Do "fdisk -l" to be sure which drive is which--lets assume that old = /dev/hda1 and new = /dev/hda2
  4. 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) )
  5. 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
 
Old 11-17-2006, 06:41 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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.

Last edited by haertig; 11-17-2006 at 06:42 PM.
 
Old 11-17-2006, 06:42 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 11-18-2006, 09:22 PM   #6
Alphasiderius
Registered User
 
Registered: Feb 2006
Distribution: SuSE 10 (Novell)
Posts: 5

Original Poster
Rep: Reputation: 0
How to Handle hard drive Upgrade

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.

Regards,
Alphasiderius
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard drive upgrade DotHQ Linux - Hardware 2 04-04-2006 10:10 AM
laptop hard drive upgrade Arnaud_B Linux - Hardware 6 06-26-2005 01:27 AM
Motherboard upgrade with same hard drive ravebird Debian 9 01-10-2005 07:06 AM
Hard Drive/Partition Upgrade ivelgo Fedora - Installation 4 12-09-2004 10:30 PM
Hard Drive Upgrade BittaBrotha Linux - General 2 04-01-2002 03:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:57 PM.

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
Open Source Consulting | Domain Registration