Resize NTFS img file
Hi gurus!
I was cloned an entire disk (with one NTFS partition of 70GB, only 15GB used) using ddrescue with the following command... Code:
ddrescue --no-split /dev/sda /media/usb250/ntfs.img /media/usb250/ntfs.log If somebody can halp me, I will be a little bit more happy ;) |
Maybe the ntfsresize(8) command is the right one for you.
|
Thank's irmin, I tried ntfsresize before, but don't work with an entire disk image...
Code:
$ /media/DISK/$ ntfsresize -i sapbes.img For now, I'm creating a new image, only with one partition... Code:
ddrescue --no-split /dev/sda1 /media/usb250/ntfspart1.img /media/usb250/ntfs.log |
From ntfsresize(8):
Quote:
|
In post #1 you have copied a whole HDD as a whole disk image, not just the relevant partition as a partition image.
You need to get the partition out of the whole disk image, and then mount that with the -o loop option. Fortunately, this is remarkably easy to do with linux. See this thread and read it all the way to the end before you start experimenting. If you have created a new image of just the partition, then mount it (all as root): Code:
modprobe ntfs-3g Don't forget to ummount everything before you start unplugging things. |
Ok, the command ntfsresize finish ok! ...
Code:
$ ntfsresize -s 28G sapbes.img Code:
$ ls -lh Thank's! |
Wait a moment... if I mount the new file...
Code:
$ mount -o loop sapbes.img /mnt/temp Code:
$ df -h Now I try to restore the img file to a new (little) disk. I will comment on changes ;) |
No luck,
after a couple of hours, i get this error... Code:
$ dd if=./mbr.img of=/dev/sda Code:
*** STOP: 0x0000007B (0xF789A63C,0xC0000034,0x00000000,0x00000000) Now, as tredegar said, I'm trying to mount sapbes.img, and copy files using 'cp' command instead of dd. Again, I will comment on changes. |
Quote:
So there is empty space after the filesystem on that partition. From man ntfsresize Code:
Shrinkage a size that will hold your resized filesystem. Easier, I think, is just to copy the files to a new filesystem on a partition of the right size on the disk of your choice. |
Ok, I tried to copy the files to a new system with the same result :(
I think it's a problem with the Windows 2003 and the disk controller drivers. Now I try to explain why I'm doing this ... We had an old server with Windows 2003. This server had a hard disk that began to fail and we cannot copy in any way (Veritas BackupExec, ntbackup, ...). To demostrate the versatility of Linux to my work colleagues I wanted to pass the old system of this machine to a host within a VMware ESX Server using Ubuntu LiveCD, but as you saw, does not boot. I think the installation of windows can not support this beasty hardware change (from an old Asus server to a VM ESX virtual host). Tomorrow I try to restore it in another (phisical) machine with a similar hard as the initial I can. Thank's for you support! |
Quote:
What you are trying to do is "Copy Windows". Unlike linux, win does not like to be "copied". It likes to be "reinstalled" from the original medium with the "product activation codes" etc. We are not supposed to help you copy windows, even if it is for an understandable reason. ( Check the LQrules. ) |
Quote:
anyway, thank's again for your support! |
Quote:
At least you learnt something, and can now rescue your files, if not win. |
Exactly, and as a last option, we can just buy a hard drive and return to the old Asus server with the recovered files.
|
All times are GMT -5. The time now is 10:00 PM. |