Resetting NTFS bad sectors list with ntfstruncate
I cloned my Windows/Linux triple boot drive onto a larger drive with the dd command, and it is running smoothly (they have the same cylinder/head/sector settings, as far as the computer can tell, so I've had no problems). I need to resize my partitions to take up the extra space, though, and ntfsresize doesn't want to work because my old drive had some bad sectors. (dd copied the bad sectors list along with everything else. The new drive does not have any bad sectors; it just thinks it does.)
I know it's possible to make ntfsresize work around the bad sectors with a command-line switch, but, since my new drive isn't actually bad, I'd rather do it Right and reset the bad sectors list. This is possible using the ntfstruncate command, as explained on the ntfsclone documentation page, but the instructions are not complete (and the wiki and forum have been down for the last few days, so I can't get any help over there). The instructions say: Quote:
|
I think that you are going to a lot of trouble for a negligible amount of disk space. If you really wanted to do this then this is what I would have done, and which you could still do.
On the original hard disk install Norton Ghost on Windows. Make a full backup of Windows onto an external or extra internal disk using Norton Ghost. Use tar under Linux to back up the Linux partitions onto an external or extra internal disk. You don't really need to back up the partition table since you want to create new partition sizes. If you did want to backup the MBR and extended partitions then you could use the dd command on Linux to back up the MBR, and use sfdisk on Linux to back up the extended partitions in the partition table. Code:
dd if=hda of=mbr.dd bs=512 count=1 conv=notrunc,noerror Then on the new disk use the bootable Norton Ghost CD to restore the backup of Windows onto the new disk. The should be bootable at this point. You then boot Windows and run chkdsk /R to find the bad blocks. Then boot a live Linux CD and use fdisk to create your extra partitions any size that you want. Under Linux use the tar command to restore the data to the partitions. Then you have to use chroot to recreate the LILO or GRUB boot sector. This is how. If your Linux root partition is on /dev/hda2 and you have GRUB boot loader then do this: Code:
mkdir /mnt/new You might also want to format your swap partition while you're in there. If it is /dev/hda3 then do this: Code:
mkswap /dev/hda3 That's how I would have done it. The problem with using the dd or partimage utilities is that they have to be restored back into a partition of the same size as the original. Using Norton Ghost in Windows and tar in Linux avoids this problem. Since you can restore your LILO or GRUB boot sector using a live Linux CD and the chroot utility then that appears to me to be the most flexible way to do backups. |
Quote:
Code:
dd if=/dev/hda of=/dev/hdc |
I was telling you how you could have avoided being in your current situation. I think you are making a mistake trying to use Linux utilities to modify an NTFS partition.
If you look at the commands that I showed it isn't very much, and the entire post isn't five pages. So you only entered one command, so far. You've still got to resize your partitions. |
Quote:
Code:
ntfsresize -s 73432432543 /dev/hda2 So now my Windows should be taking up the full 70 GB or so available, as I wanted, but it would still be nice to reset the bad sectors list, seeing as how there aren't actually any bad sectors. I figured out that typing Code:
ntfsinfo -i 8 /dev/hda2 |
The instructions have been updated with the answer to my question!
Quote:
|
Quote:
|
Quote:
|
Merry Chrismas and THX alot for your Howto
Sure this is only needed in rare cases, but I cloned a notebook hdd which had bad sectors on to a new hdd (whith ntfsclone) and so parted thought the new drive also has bad sectors and refused to resize my partition. After those steps I could successfully resize the partition. |
Windows will reset bad clusters for you
I realize this is a Linux forum, but I ran into the same problem while using ntfsclone to replace a questionable WD Green EADS drive.
A new feature happened to be added to chkdsk in Windows Vista and later. From windows run "chkdsk /b" which resets the ntfs bad cluster list and then runs a full rescan on the next boot (or right away if you are not checking the boot drive). |
All times are GMT -5. The time now is 12:02 PM. |