Click to See Complete Forum and Search --> : migrating sytem to a larger drive
davehar
04-21-2006, 04:43 AM
i currently have mandriva on a 20G hard drive and the first partion is full
hda0 which was 5.9G show 200Mb free space.
i have got a 160G drive to transfer the system to but it seems to be a pig to do.
with windows i jut connectup the new drive bot off a acrosnis migrateeasy disk and wait when its finished i swap jumpers on the drives nd it boots off the new drive job done no mucking about...
That whats required with linux .... No mucking about
or is this just wishing in the wind. :confused:
saikee
04-21-2006, 08:30 AM
Easier than you think mate.
Possibly the quickest is to hook the 20Gb disk a the master and the 160Gb as the slave so that it is known as hda and hdb. Boot up your Linux in the master disk hda.
One line of command in Bash
dd if=/dev/hda of=/dev/hdb bs=32768
Should take about 400 seconds if it is in my box which frequently transfers 5Gb per 100 seconds.
Revserse the master and slave order and the new disk will boot same as the old one.
The above is a 100% mirror cloning with the 160-20=140Gb ending up as unallocated free space. Original sizes of all your partitions remain unchanged. You haven't mentioned wanting a larger target partition so I stop here. If you do let us know the partitioning scheme by posting here the content of
fdisk -l
ph34r
04-21-2006, 11:47 AM
Or you can rsync it ...
je_fro
04-21-2006, 04:43 PM
or you can just partition the big drive the way you want it and cp the files where you want them to go....you'll need to setup grub on the mbr somewhere to point at your new disks /boot/grub/grub.conf. I've done it before and it worked, but I'm sure someone can come up with a technical reason that dd is better...even though it keeps your original partition scheme...
saikee
04-21-2006, 08:28 PM
dd copies the boot loader in every partition and the target disk boots exactly like the source.
Have done it with 60 partitions with a mixture of Dos, Windows and loads of Linux. That is why I used the word "quickest".
The backup command like cp, cpio, rsync and tar etc copies the file system only. As the boot sector isn't part of the file system and so it doesn't get copied across and so the boot loader needs to be restored. One can do compression with the backup commands.
dd copies sectors literally byte by byte but no commpression is done unless the output is piped for a second process.
dd isn't technically better but it is easier for those needing the target disk bootable without doing any extra work. By copying the binary pattern dd is therefore good for backing up NTFS partitions which most Linux refuse to write on.