On Fri, 18 Nov 2005, Enrique Perez-Terron wrote:
> I have a NTFS partition that I cannot locate on the disk when running Linux.
>
> I used Disk Manager (or is it "Disk Management", in Computer Management
> in the control panel) to format a logical partition previously containing
> an ext3, with ntfs, and I specified a mount point "Program Files". I
> copied into it the contents of a former "Program Files" directory which
> I had renamed out of the way.
>
> When running W2k, everything works, and I can open e.g.,
> /Program Files/MinGW/SysM/doc/COPYING, which begins "GNU GENERAL PUBLIC
> LICENSE" in ascii.
>
> However, in Linux, the partition is still type "83 Linux", and "file -s
> /dev/hdb10" says ext3.
>
> I wrote a small C program to search through the sectors of the partition,
> and look for "NTFS ". No hit. Then I modified it to search for "Microft"
> in Unicode, case insensitively, since several directories have names
> starting with "Microsoft". No hit. Testing the same program on other
> partitions does give hits. The same program is also capable of searching
> the whole disk /dev/hdb, but still no hits except that "NTFS " occurs
> in the source of the program, and that one is found in the correct
> partition. Searching for "GNU GENERAL PUBLIC LICENSE" in ascii, no hits.
>
> What could the explanation be?
>
> Perhaps there is no NTFS_BOOT_SECTOR when the fs is to be mounted, not
> given a separate drive letter?
>
> I am not aware of any "compression" setting on the file system, I don't
> even know where I would set that. I suppose compression would only affect
> file contents, explaining the failure to find "GNU" etc, but how about
> "NTFS " and the directory names?
The fact that you cannot find NTFS string is odd. Have you checked in
disk manager in windows that c:\Program Files really is the partition you
think it is rather than just your original system disk (maybe you did
something wrong)?
Other than that what does an fdisk -ul /dev/hdb say from Linux?
Maybe when you did the ntfs partition you did not delete and create again
the partition but just formatted it? If so it is possible Windows did not
update the partition type to 7 (NTFS) and left it to 0x83 (Linux). If
that is the problem just fire up fdisk /dev/hdb and change the partition
type like so:
$ fdisk /dev/hdb
t <- t = change partition type
10 <- assuming it is hdb10
7 <- type 7 is ntfs
p <- print partition table so you can verify it did the right thing
w <- write the partition table to disk and exit fdisk
Now reboot and it should be fine.
Note "file /dev/hdb10" may still tell you ext3. But just try mounting
using ntfs on Linux "mount -t ntfs /dev/hdb10 /mnt/ntfs" and if that works
everything is fine. The reason it may be detected as ext3 is that
formatting a partition does not erase the old data. And NTFS in
particular only erases the first 8kiB of the disk and then only writes way
into the disk. That means the ext3 metadata at the beginning of the disk
is still there so when an application looks for it, it can still see it.
You have to be very careful about such things as if you told Linux to
mount this partition as ext3 it probably will succeed and trash the NTFS
data in the process...
When formatting a partition from one type to another it is alwayst safest
to use the slow format setting, i.e. not quick format, which causes the
whole partition to be erased to zero first thus the above described
problems cannot occur.
btw. To check whether your program is not detecting it properly, you can
just run "hexedit /dev/hdb" and you should see "NTFS " at offset 3 into
the first sector.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|