You are not logged in.

#1 2011-04-11 09:34:15

cyberius
Member
From: Germany
Registered: 2008-08-30
Posts: 97

[SOLVED] Copy whole harddisk content to bigger one

Hello,

till now in my little homeserver there is a 80GB harddisk, recently I found a 200GB one and want to switch it, without having to reinstall archlinux.
I read about "dd" which can copy a whole harddisk byte-by-byte.

How do I use it?

Do I have to format the bigger harddisk first?

Do I have to switch runlevel to 1, so that no programms or e.g. random cronjobs run in that dd process? Or do I have to do it via a live-linux-cd, so that no virtual proc directories are mounted which would also be copied?
Or can I just attach the bigger disk and run dd from normal runlevel?

After copying I assume I have to resize the partition on the new harddisk? (Otherwise it still will be 80GB right?)


Thanks

Last edited by cyberius (2011-04-11 20:24:53)

Offline

#2 2011-04-11 10:06:37

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [SOLVED] Copy whole harddisk content to bigger one

IMO the easiest way is to create a partition on the new drive of whatever size you want, boot a live disc, cp -a the content of the old disc to the new disc, edit fstab, menu.lst, ... and reinstall grub to the MBR.

Offline

#3 2011-04-11 10:35:24

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Copy whole harddisk content to bigger one

I issue in such cases the following command:

rsync -Sax /source/dir /dest/dir

Works like a charm as long as you remember to update fstab and menu.lst / grub.cfg with new paths (that's important if you use UUIDs or change your partition layout). Anyway, looking inside those file is recommended.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#4 2011-04-11 19:26:12

cyberius
Member
From: Germany
Registered: 2008-08-30
Posts: 97

Re: [SOLVED] Copy whole harddisk content to bigger one

Thanks! cp -a worked!

Offline

Board footer

Powered by FluxBB