How can I clone a hard drive with Centos 4 to a larger hard drive and utilize the "new" free space on the drive?

Posted on 2007-08-01
Last Modified: 2013-12-16
I have a Centos 4 web server with an 80 GB hard drive and I need to upgrade it to a new 320. What is the best way to clone the drive and make the remaing 240 GB available in the / partition. In Windows its as easy as using Symantec Ghost. I know that there is a project called Ghost for Linux, but it doesn't state the ability to "grow" the partition. Any suggestions?

Question by:bacamaro
    LVL 63

    Assisted Solution

    1) I think that there are a number of partition editos etc for unix systems, Qparted etc that can grow a partition.

    2) I would check Ghost just in case to see if it allows creating a larger partition, it may be version dependent.

    3) in general, since Unix supports hard and soft file links, it should not be an issue as you can mount a new partition on an existing volume

    I hope this helps !
    LVL 7

    Accepted Solution

    Depending on your partition setup, you can use parted/qtparted/fdisk to make the same partition set on your new HDD, then copy data using dd. Example:

    you have /dev/hda1 partition and want it to be copied to /dev/hdb1:

    dd if=/dev/hda1 of=/dev/hdb1

    while input partition can be mounted, the second one shouldn't.

    It is maybe not the quickest way, but I think the safest way of copying whole partition/disk.
    You can also do just:

    dd if=/dev/hda of=/dev/hdb

    to dump exactly everything from disk one to disk two, and then manipulate partitions with data on disk two. In case, something fails, you have still disk one.

    LVL 15

    Assisted Solution

    Do your ghosting and then resize. Bootitng is a boot floppy, the trial version should handle the resize for you.

    Or get a  Linux boot CD like Knoppix and you can launch QtParted from there to resize.
    LVL 15

    Assisted Solution

    Symantec Ghost is not Windows specific. You can copy and resize ext2/ext3 partitions with it as well.
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    As hardware bugs go, this is a strange one! I upgraded a laptop in December 2011 with a 512GB Crucial m4 2.5-inch/9.5mm SATA Solid State Drive (SSD), Crucial part number CT512M4SSD2: …
    This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now