On Thu, Sep 24, 2009 at 4:53 PM, Matthew Walker <[email protected]> wrote:
>
> On Thu, September 24, 2009 4:45 pm, Merrill Oveson wrote:
>> I've got a terabyte drive.
>>
>> It's almost full.  This drive houses all the OS, etc in addition to data.
>>
>> Here's what I'd like to do.
>>
>> 1) Get a two terabyte drive.
>> 2) Copy all the data from the existing one terabyte drive to the new
>> terabyte drive
>> 3) Unplug the one terabyte drive, plug in the new two terabyte drive
>> 4) Have everything come up flawlessly, i.e. no need to mess with any config
>> files, etc - or at least very minimal messing.
>>
>> Is there a special tool that can do this in linux?
>>
>> Is #4 possible?
>
> The basic idea for any method of doing this short of cloning the drive using 
> dd or some
> similar tool comes down to this:
>
> 1. Plug in new drive.
> 2. Partition and Format as desired.
> 3. Mount it to /mnt/whatever, and mount any sub-folders etc
> 4. Use rsync or cp -a, or some other method of copying files + permissions to 
> new drive.
> 5. Set up boot records on new drive.
> 6. ???
> 7. Profit.

I've done this many times. Some tips for you:
- mount /'s partition again under a new mount point and rsync from
there--a simple way to avoid skipping other dynamic partitions like
proc, sys, var/tmp, and especially dev in your copy command (often,
there is a minimal set of static device nodes in /dev/ used for
booting that get hidden or replaced once udev runs--this way gets to
them in a sane fashion)
- if you kept the /boot partition the same size and same offset on the
new drive as the old, you can simply dd the first 512 bytes from the
old drive to the new and not need to worry about running grub
- you can of course still change the other partitions around
- if you do change the size or location of the /boot partition, once
you've copied all the data, mount the new /boot partition onto the new
/'s partitions .../boot mount point, chroot to the new /'s partition
mount point and run grub from inside the chroot. be sure to specify
the correct device, and remember that the device name may be different
still in the final grub.conf
- if worse comes to worse, you can boot a livecd, mount your new drive
and chroot to run grub from there to get it correct.

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to