Navigation:

Documentation:

Other:

Link Collection:

~~CLOUD:30~~

relocntfs - program for adjusting FS start sector on NTFS partitions

Dewin contributed relocntfs in his mail to Linux-NTFS-Dev on Sep 20, 2006.

relocntfs is not maintained or tested by Linux-NTFS members. Please report issues to the author via thisgenericname[at]gmail-com. Please report Linux-NTFS-Dev on an updated version.

See more contributions in the contrib section.

Original Mail

After encountering a problem when using ntfsclone to 'ghost' several
Windows XP machines (Why Dell sent us 'identical' machines that had
HDs with different geometries I will never know), I came across
Michael Dominok's page about modifying the NTFS filesystem's "start
sector" so Windows will actally boot when the partition starts on a
different start sector than it originally did:
http://www.dominok.net/en/it/en.it.clonexp.html

Well, the process there requires editing the disk by hand -- a process
I wanted to automate.  So I wrote "relocntfs" -- a simple C program
that displays (or changes) the start sector embedded in the FS (4
bytes starting at offset 0x1C).  It can accept a user-supplied value
(possibly obtained from fdisk -ul or similar), or it can try to
determine the correct value based on the results of the HDIO_GETGEO
ioctl.

This version is a mess and only sparsely commented as I wrote it
originally for my own use, but I figured I would contribute it to the
Linux-NTFS project in hopes that it can help someone else.  GPLv2'd
and copyright me, but consider this permission for the Linux-NTFS
project to change either of those facts to suit whatever standards are
in place (as long as I maintain rights to the original)

Attached is two copies of the program -- relocntfs.c (which uses
open()/read()/etc.) and relocntfs-old.c (which uses
fopen()/fread()/etc. but writes the value to the wrong location for
some mysterious reason).

-- Daniel Grace

Attachments

Known Issues

Known issue:

Running chkdsk on an ntfsreloc'd volume may produce an error “The second NTFS boot sector is unwriteable.” on every run. However, Windows (at least XP) will run just fine despite the error.

This does mean you are more likely to have the partition fail (should the first bootsector be corrupted) since XP no longer has a working backup to access (at least, it doesn't know where that backup is). Granted, if your first bootsector is failing you likely have bigger issues to worry about.

See Also

 
contrib/relocntfs.txt · Last modified: 2009/02/09 21:32 (external edit)