homehowtokbslinksaboutcontactprojectsmusic

Index > Help Tutorials > NTFS Clone Imaging
In this setup I am going to use:

192.168.1.2 for my nfs server, please adjust to yours
Different hard drives in size, source and destination is not same of size hard drive
/dev/sda is my hard drive and /dev/sda1 be my partition
Resize/shrink the hard drive
ntfresize /dev/sda1 -i | grep "You might resize" | cut -d " " -f8
This will give you the size of used disk in MB. Now just to safe run the read only resize test, replace xxx with number you got in previous command
ntfresize /dev/sda1 -n -s xxxM
If everything ok then run do the actual resizing
ntfresize /dev/sda1 -f -v -P -s xxxM
mkdir ntfs
Mount windows to ntfs directory
ntfs-3g -o force,rw /dev/sda1 /ntfs
Remove page and hiberfile if exists
rm -fr /ntfs/{pagefile.sys,hiberfil.sys}
Unmount windows drive [/dev/sda1]
umount /ntfs
Mount remote nfs share to ntfs directory
mount -o nolock,proto=tcp xxx.xxx.xxx.xxx:/nfsshare /ntfs
Backup MBR
dd if=/dev/sda of=/ntfs/sda.mbr bs=512 count=1
dd if=/dev/sda of=/ntfs/sda.vbr bs=512 count=63
Capture image, compress it using gzip and send it to nfsshare
ntfsclone -s -f -o - /dev/sda1 | gzip -c | cat > /ntfs/imagename.gz
Restore image from nfsshare
mkdir ntfs
Mount nfs share
mount -o nolock,proto=tcp xxx.xxx.xxx.xxx:/nfsshare /ntfs
cat /ntfs/imagename.gz | gunzip -c | ntfsclone -r -O /dev/sda1 -
Restore MBR, if device is same or larger
dd if=/ntfs/sda.mbr of=/dev/sda bs=512 count=1
Restore MBR, if device is different in size ( this setup assume that )
dd if=/ntfs/sda.mbr of=/dev/sda bs=446 count=1
Resize the hard drive to its original size, if you skip this your hard drive will show the size of disk from where the image was captured
ntfsresize /dev/sda1 -x -f -b -P

References:

spiceworks.com
cyberciti.biz
edoceo.com
ebalaskas.gr
nilbus.com
ntfsresize