FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Tue May 11, 2021 03:26



Post new topic Reply to topic  [ 3 posts ] 
ntfsclone / ntfscp; ntfs partition inside disk image file 
Author Message

Joined: Tue Jun 02, 2015 10:32
Posts: 2
Post ntfsclone / ntfscp; ntfs partition inside disk image file
Hi,

I am using xen to virtualize a Win2k8R2 Server. I am experimenting a little with a clone of that image.
But cloning 80GB on a RAID6 is really slow.

Instead of cloning I thought I could copy only the files i need to "restore" the clone to it's initial state
(i.e. copying the Windows folder (13GB )from the source disk image file to the cloned disk image file)

My idea was to:
- create a ram disk (15gb)
- create a temporary disk image inside that ram disk
- format the disk image with NTFS
- copy the Windows folder from my original Windows
- move the Windows folder to my clone

Sadly ntfscp seems not to be made to copy complete folders.
I read about some ntfscp.c / ntfscp.sh / ntfscp2.sh tools. Sadly neither of them is online.

Next attempt:
Using ntfsclone to save into a sparse file (should result in a 40 gig file, which i still could hold in a RAM disk)

This is the layout of the disk image file:

Code:
root@srv1:/mnt# fdisk -l /dev/vg0/win
Disk /dev/vg0/win: 80 GiB, 85899345920 bytes, 167772160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xff4b223d

Device         Boot  Start       End   Sectors  Size Id Type
/dev/vg0/win1  *      2048    206847    204800  100M  7 HPFS/NTFS/exFAT
/dev/vg0/win2       206848 167770111 167563264 79,9G  7 HPFS/NTFS/exFAT


So I was able to mount the ntfs partition with it corresponding offset:
Code:
mount -o loop,offset=105906176 -t ntfs-3g /dev/vg0/win /mnt/win


But I am not able to use ntfsclone, because using it on the disk file image fails, because ntfsclone wants a partition.
Providing the mounted partition also fails, because it is a folder.

You guys have any idea how to solve that?

Thanks in advance!

Regards,
l_e


Tue Jun 02, 2015 10:54
Profile

Joined: Tue Jun 02, 2015 10:32
Posts: 2
Post Re: ntfsclone / ntfscp; ntfs partition inside disk image file
Got it solved!

Code:
losetup -o 105906176 /dev/loop0 /dev/vg0/win
mount -t tmpfs -o size=42G none /mnt/ram_disk/
ntfsclone --save-image --output - /dev/loop0 | gzip -c > /mnt/ram_disk/win.img.gz


Tue Jun 02, 2015 13:59
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: ntfsclone / ntfscp; ntfs partition inside disk image file
Hi,

Quote:
Got it solved!

Glad you solved it. However :

Quote:
Instead of cloning I thought I could copy only the files i need to "restore" the clone to it's initial state (i.e. copying the Windows folder (13GB )from the source disk image file to the cloned disk image file)

If you were interested in copying the system files, it would be a bad idea to copy them because there are hard-linked files which would be unlinked. So better restore everything, then delete what you are not interested in.
Quote:
I read about some ntfscp.c / ntfscp.sh / ntfscp2.sh tools. Sadly neither of them is online.

See tools.zip from http://jp-andre.pagesperso-orange.fr/ad ... l#download though they probably do not serve your purpose if you have hard links to copy.

Regards

Jean-Pierre


Tue Jun 02, 2015 17:47
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.