[Gllug] dd'ing a nearly empty disk to a SMALLER disk - is it possible?

Bruce Richardson itsbruce at workshy.org
Sun Oct 31 19:29:39 UTC 2010


On Sun, Oct 31, 2010 at 06:28:59PM +0000, Malcolm Blackmore wrote:
> I need to transfer the contents of a nearly empty windows/linux
> partitioned 500gb disk to a 320gb disk mirroring the windows-root-home
> structure. There is less than 150gb actual content on this 500gb disk.
> This is to transfer the windows XP which there are no disks to reinstall
> the pre-installed XP that was on the original 40gb disk of the fujitsu -
> which was replaced with a larger disk. That was no problem, of course.
> But I bought 4x of these P4 computers for 50 quid the lot and now one of
> the disks in one of them has died and I have 3 spare 320gb sata disks to
> use.
> 
> Is this possible?

It would work if the desination disk were the same size or larger; it's
going to fail here.  No matter how little data there is now on the
partitions, some of it may be stored at locations beyond the first 320GB
of the original disk.  The 40G first partition would be OK but the
second one wouldn't.

> How can I get the partitions and their contents,

Here's one suggestion:

Take the 320G disk and create a 40G partition for Windows and use the
rest for your Linux layout.  Make sure the destination Windows partition
has at least as many sectors as the source (a few extra for padding
won't do any harm).  Then use dd to copy the Windows partition (you can
use dd to copy between any block devices, not just whole disks).  Use
mkfs to create new, empty filesystems on the Linux destination
partitions and then use rsync to copy the Linux filesystems across.
Once this is all done, you'll have to install a bootloader on the new
drive and make sure it picks up the configuration.

It is possible to copy FAT and NTFS partitions with rsync, but dd is
safer when it's a system disk.

-- 
Bruce

Explota!: miles de lemmings no pueden estar equivocados.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20101031/c09231ca/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list