moving stuffs between harddisk

Net Llama! netllama
Sun Feb 6 11:07:49 PST 2005


On Sun, 6 Feb 2005, Roger Oberholtzer wrote:
> On Sun, 2005-02-06 at 22:18 +0800, Man-wai Chang wrote:
> > the old 5400rpm 20G harddisk (hda) of my linux server is getting.
> > I have a spare 7200rpm 20G harddisk (hdc).
> >
> > what's the fastest way of moving everything from the old harddisk to the
> > new harddisk? is it:
> >
> > dd if=/dev/hda of=/dev/hdc bs=1024000
> >
> > if the 2 disks have different geometry, will it work?
>
> As long as the new hard disk is not smaller than the old it should work.
> Keep in mind that this may also copy /proc, /dev and a few other places
> that should probably not just be copied. So, after the copy, I would
> make sure they are empty on the new disk.
>
> Another approach is to make a partition on the new disk (mounted as,
> say, /dst) and then use 'cp -a / /dst'. You can also mount your current
> '/' a second time on, say, /src, and then when you do the copy, no other
> things like /proc or mounted files systems will be copied. There is some
> mount option that lets you do this remount in the needed way. I can find
> it out if you need. This would also ley to change the file system type
> to something else at the same time (being sure support is in the kernel
> before making the change).

To elaborate a bit more on what ROger suggested, what I do is boot with
Knoppix, and then use the 'cp -a' routine.  This ensures that you're not
copying temporary or transient data (such as that in /proc or /tmp).

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lonni J Friedman                        netllama at linux-sxs.org
LlamaLand				http://netllama.linux-sxs.org


More information about the Linux-users mailing list