Slashdot Mirror


Using the Real ntfs.sys Driver Under Linux

caseih writes "A very neat hack uses the real ntfs.sys driver (obtained from your own windows XP partition and used via a wine-like layer (borrowed from ReactOS) to mount an ntfs partion with full read/write access. While not an ideal solution and certainly not free as in speech, this is an ideal stop-gap measure for many people trying out linux. I think that we'll probably see this in Knoppix pretty soon."

37 of 548 comments (clear)

  1. OK... good by herrvinny · · Score: 2, Interesting

    OK, but I imagine having to load all that would take a toll on performance. How fast does it run, and more importantly, how can a free (read: non-encumbered) version of this be made?

    1. Re:OK... good by gl4ss · · Score: 3, Interesting

      well, i can certainly see uses for this when somebody is messing around with knoppix and wants to access his ntfs partitions that he normally uses windows from.. though i'm pretty sure ms is going to try some nasty eula trick on this(actually i'm pretty sure xp's eulas could forbid, maybe not enforceably but anyways, using it in this fashion).

      -

      --
      world was created 5 seconds before this post as it is.
    2. Re:OK... good by caseih · · Score: 4, Interesting

      Performance would not be anywhere near the performance of a native linux file system (either ntfs or ext3) since it uses the lufs kernel module to communicate via a unix socket with the user-land ntfs hack. So you wouldn't want to use it as your root file system or anything. But for accessing mp3s, changing the Windows administrator password, or other similar operations, this seems to work ok. Heck, even just reading and writing MS Word doc files would be fast enough to not really be noticable to a user.

    3. Re:OK... good by tiger99 · · Score: 3, Interesting
      I hope you are right. I wonder if there are any other ways of attacking the problem, other than beating up Bill of course, which is best left to Melinda.

      It is clearly always possible using simple methods (unless M$ do really stupid things with the disk format, and then it would break on some disks and/or controllers) to read what is on the disk, using Linux, or for that matter an old version of Norton Utilities (when there really were useful utilities). There is no shortage of people who could run simple file writes from Windoze, and read back the changes to see what had really happened. I could do that, given some basic instructions. So. gathering info is not too hard, making sense of huge volumes of it, all the special cases, error recovery and all that sort of thing, possibly working around deliberate obfuscation, may be another matter.

      I wonder if it might be better to do a clean-room implementation of the .dll, one team, who absolutely never, ever writes kernel code, disassembles it (they may even do an instruction trace with an emulator if it helps) and writes a spec, while the other re-implements it, without having ever seen the disassembly. That is legal. The key is writing an accurate spec from the results of the disassembly.

      I don't know which method the kernel team are using, but IMHO they need more help (people, not competence, which they already have plenty of), only it would have to be meaningful and properly coordinated otherwise it would be a nuisance. Due to the past history of damaged files etc, they really ought to have many thousands of beta, or even alpha, testers on this one, and not pass the code as fit for general use until many gigabytes on thousands of different PCs have been read and written successfully. If someone would publish a to-do list, they might well find that useful assistance would be forthcoming.

    4. Re:OK... good by caluml · · Score: 2, Interesting

      The best thing for Linux would be ntfs2ext2,3,reiserfs, whatever, and a Windows ext2/3/reiserfs driver.
      Get people converted to an open filesystem, I say.

  2. I'm not sure if we'll see it in knoppix by Steve+'Rim'+Jobs · · Score: 5, Interesting

    Surely it is illegal to copy the ntfs.sys driver and distribute it in another operating system, seeing as how it is a part of Windows.

    1. Re:I'm not sure if we'll see it in knoppix by TiggsPanther · · Score: 5, Interesting

      Wouldn't need to copy it. At least, not to distribute, anyway.

      Use the copy off the hard drive. Mount it in read-only using the normal way, copy it to the Knoppix ramdrive, and then run the driver from there.

      --
      Tiggs
      "120 chars should be enough for everyone..."
    2. Re:I'm not sure if we'll see it in knoppix by k98sven · · Score: 5, Interesting

      and how to actually load the ntfs.sys file from an NTFS filesystem. It is not entirely a chicken and egg situation, as Linux already have NTFS read support

      Um... I'm wondering here: How does Windows load ntfs.sys from an NTFS partition???

    3. Re:I'm not sure if we'll see it in knoppix by stevey · · Score: 2, Interesting

      But the NTFS driver would be on the Windows partition, which would be an NTFS filesystem - right?

      So presumably the setup looks like this:

      • Mount the NTFS filesystem RO with the normal kernel driver
      • Copy the ntfs.sys driver to /tmp
      • Unmount the NTFS filesystem
      • Mount it RW using the copied driver

      Seems to me that either just "stealing" the ntfs.sys driver (wonder if it gets changed by different service packs?) or using the normal kernel one would be far easier.

      But then again I don't use Windows so I have no NTFS partitions..

  3. Knoppix by arikb · · Score: 5, Interesting
    I think that we'll probably see this in Knoppix pretty soon.

    I wonder how it's going to be done in Knoppix, without distributing a commercial DLL with the CD. Perhaps the following scheme could work:

    1. Look for NTFS partitions and mount them with the R/O driver
    2. Scan those folders for the dll and copy it into the ramdisk
    3. Unmount the partitions, then remount them with the Windows dll for r/w

    Tricky. Depends on having the DLL somewhere on the disk.

    -- Arik

    1. Re:Knoppix by tsetem · · Score: 4, Interesting


      > 1. Look for NTFS partitions and mount them with the R/O driver
      > 2. Scan those folders for the dll and copy it into the ramdisk


      mount -t ntfs /dev/hda1 /ntfs
      if (-e /ntfs/winnt/system32/drivers/ntfs.sys)
      {
      cp /ntfs/winnt/system32/drivers/ntfs.sys /ramdisk
      }
      umount /ntfs
      if (-e /ramdisk/ntfs.sys)
      {
      # Do Wrapper voodoo here.
      }

      Doesn't seem to conceptually hard (or tricky) to me.

  4. How about the other way around by October_30th · · Score: 3, Interesting

    Is there any free-as-beer software for Windows that would let me access (rw) my ext2 and ext3 partitions from Windows?

    --
    The owls are not what they seem
  5. What about users/permissions? by SharpFang · · Score: 4, Interesting

    ntfs.sys surely can handle that, but what about the database? Ownership, permissions, sharing, all that stuff Microsoft boasts to have much better than Linux (better gradation of permissions in operations). That's pretty essential and would require pretty big amount of Microsoft backend software.

    --
    45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    1. Re:What about users/permissions? by jhoffoss · · Score: 2, Interesting

      What about the flipside: could you implement this driver somehow so that it followed permissions at some level? Can you modify nfts permissions from Linux? (Never messed with this...) Does windows have any problem if I were to create a file on an NTFS partition from Linux and then move to Windows? In this situation, what are the default permissions for any files created? (Wide open, inherited, etc.)

      --
      Linux: The world's best text-adventure game.
  6. "Secret" software is a real problem for OSS by Steve+'Rim'+Jobs · · Score: 4, Interesting

    This is similar to the current situation with Quicktime, Real and WMV playback on Linux - there is a technical solution, but it is illegal. Unfortunately, it is doubtful that the companies developing these secret formats will ever port to Linux, and even less likely that they will make them open source.

  7. Useful by mc_wilson · · Score: 5, Interesting

    This would be very useful if you have an unbootable windows partition. I had problems with my logon file in XP once. I had replaced it to try something and ended up hosing my system. I had the file backed up but I couldn't use the Windows XP command line recovery because it couldn't logon and I couldn't copy it back over in Linux because of poor NTFS support. This would help people being able to fix the same or similar problems.

  8. How stable? by teslatug · · Score: 4, Interesting

    I don't care if it's not free as in speech. I've been waiting for a long time for some stable read/write support for my dual-booting system. If it's as stable at reading/writing as Windows, then this will be a great hack.

    1. Re:How stable? by zerblat · · Score: 2, Interesting

      If you don't care about free as in whatever, there's been stable r/w support for a long time.

      --
      Please alter my pants as fashion dictates.
  9. Not 'free as in speech', but rather by RLiegh · · Score: 3, Interesting

    'free as in warez'? Hell, that's nothing new.

    as a knoppix user, I hope to hell this stays WAY AWAY. Microsoft has published a good deal of api's for writing device drivers; it would be a better idea to develop OSS device drivers that allow read/write access to ext2/ext3/reiserfs filesystems instead.

    Would be better legally, as well.

  10. Knoppix won't have ntfs.sys ever by Anonymous Coward · · Score: 1, Interesting

    "I think that we'll probably see this in Knoppix pretty soon."

    Knoppix won't provide ntfs.sys because that is copyrighted by Microsoft. Now knoppix may allow loading the driver if you have nt/2000/xp on a hard-drive, but won't you need to load the linux ntfs driver first, if it's on an ntfs drive?

    This may be a helpful idea for the short-term, but you're better off with more free-open-source-driver.

  11. look at the windows boot loader by gimpboy · · Score: 2, Interesting

    And if it isn't in a certain folder in the Windows base directory, Windows can't find it anyway. So it's just a matter of finding the base directory, and grabbing it from there.

    so knoppix can probably find out where windows is installed by examining the bootloader for windows. i believe it points to the windows installation directory (which device, directory, etc.).

    --
    -- john
  12. Call me crazy but... by buck09 · · Score: 2, Interesting

    I think it would be a good idea to get Linux to natively support NTFS partitions. That way, users of Windows would be able to boot either OS, and easily share data between the two. The way I see it, you could have a \Linux folder, containing everything execpt the /swap filesystem.

    This would be very handy to me, since I use XP for Video / Photo Editing, Gaming, and Linux for everything else.

    Am I crazy? Is this crazy talk? Why not give users the option to use Ext3, RiserFS, NTFS, etc all on the same page?

    --


    Press any key to continue, any other key to quit.
  13. Re:What is this good for? by ShavenYak · · Score: 2, Interesting

    Actually, I have another use for it. Back when I had a Win98 dual-boot box, I could run Quake III under Linux with a symlink for the PAK0.PK3 file pointing to my FAT32 partition. On my current XP/Linux box with an NTFS partition, it didn't work - I had to copy the file to my ext3 partition, wasting a scad of diskspace. I'm guessing that QIII opens the .PK3 files r/w and errors out if that fails.

    --

    Hey kids, there's only 5 days left 'til Yak Shaving Day!
  14. Already in the works, chum. by sethadam1 · · Score: 3, Interesting

    Good ol Seth Nickell and Storage. WinFS-ish to be sure.

  15. One reason by Anonymous Coward · · Score: 1, Interesting

    If your windows directory was clobbered (e.g. by a virus) or corrupt (e.g. sector failre), you won't have access to this DLL.

    Besides, Knoppix *already* includes NTFS support. It works just fine (A non-techie friend's computer became non-bootable. I used Knoppix to back up what he needed on system to CD, then replaced a few critical DLLs to get things to work again).

  16. Re:MOD PARENT UP by JKR · · Score: 2, Interesting
    Partly that's because writing filesystems ain't like dusting crops, boy; even if you have the specs. For MS that means buying the IFS (installable filesystem) driver kit, for $1000, and I believe it's only available under NDA.

    I would like to see ext3 for XP, and UFS too. Windows JFFS2 drivers for removable smartmedia would be nice too, but these things are a bitch to port. Ideally, you'll have a full debug (checked) build of XP and a second XP machine to run a kernel debugger on. One mistake in IFS code and it's off to bluescreen/reboot city.

    Jon.

  17. It ain't free if it requires ms-windows by Anonymous+Bullard · · Score: 2, Interesting
    I don't do windows, but wouldn't it be preferable to put the resources towards native solutions? Also, wasn't the HPFS (OS/2) file system support part of the native NTFS project? What's become of that effort?

    If the "Captive" (?) NTFS project needs the original MS driver it might also be illegal, and plain useless when there's no ms-windows around but only data to be rescued.

    Anyways, if this project scratches someone's itches then who cares - go for it. At least one can always try pulling stuff like this under the open source skies. Try retrofitting ms-windows with non-ms-sanctioned FS support... now there's a challenge!

    --

    Should invading one's peaceful neighbours be opposed, or rewarded with trade deals?

  18. Personally by floydman · · Score: 3, Interesting

    I added NTFS readonly (which is safe) support in my kernel, and always add a small fat partition in my dual boot system, as a spool are between both, have been doing it for years, and am happy with it. But i still like that hack though, pretty neat work.

    --
    The lunatic is in my head
  19. Re:You better download this today. by Anonymous Coward · · Score: 2, Interesting
    I completely agree with you!


    Microsoft may not, though. So, a person provides a tool to grant safe access to a resource--which you own--remember, that's your data on that drive. And Microsoft has spent quite a bit of money deliberately breaking existing compatabilities. Clearly this state--incompatability--has value to them.


    It's not inconceivable that Microsoft might expend some effort to see that such a tool is not available for the public to use.


    It's kinda like the whole "fair use" issue. Fair use says functionally what you posted--what you do in your house is your business. And interested parties cannot use legal means to directly curtail your rights to fair use.


    What they can do, however, is make it technically difficult for you to exercise these rights.


    So, sure, you can read your NTFS partition in your own house. And you can do it from another OS.


    Too bad we bought off/intimidated/harassed/took out and shot the only author of the tool that allows you to do this. 'Course someone else might create such a tool, and they're free to do so. Care to try?

  20. What about NT4 for non-x86 users? by carndearg · · Score: 2, Interesting
    NT4 came in 4 flavours, i386, mips, ppc and alpha. And presumably all of these had a driver for NTFS.
    Would these drivers, assuming you have an NT4 disk gathering dust, be a solution for non x86 users?

    Not much help if you run Linux on ARM or 68k or something but there you go.

    1. Re:What about NT4 for non-x86 users? by cant_get_a_good_nick · · Score: 2, Interesting

      Which version of NTFS? I think there were some extensions thrown on it in going to NT5/NT2000. Can anyone who knows more on this verify?

      I don't think MIPS or PPC made it to NT4. Alpha died early in NT4 cycle, maybe a service pack or two. You're looking at very old technology. This still looks like x86 only.

  21. Re:First? by Anonymous Coward · · Score: 1, Interesting

    This is even better than open source. We let Microsoft foot the bill on all the standardizing and consolidation in the industry, then reap the benefits of their drivers. You may not be able to distribute ntfs.sys but who cares? who wants it? I don't. I do, however, want proprietary DX9/GL2.0 drivers for X/DRI to work now, not 3 years from now, when specs are released. I want my crap printer to work now. I want my wireless 10g card to work now.

    All of these drivers I can download for free, but they are windows only.

    What should I do? Buy better hardware that supports Open source? I can't afford it. I have el-cheapo crap hardware, with windows only drivers. Should I just use windows then?

    What abou WinModems? Even they require some microsoft emulation to work. This is just one piece of hardware that is dependent on windows. By not supporting windows in linux, linux loses a lot of device support. Due to the nature of these device's dependence on windows, linux must emulate windows somewhere.

    Windows driver emulation/loaders ARE a just cause for open source. Anything that gives linux better hardware support is good, IMO.

  22. Anonymous FTP? by mark_space2001 · · Score: 1, Interesting
    I couldn't get NFS working with Windows a while back, and Samaba was too complicated for this home user. So I just went with anonymous FTP.

    Everything on my home network is heavily firewalled, so there is no danger of intrusion. Anonymous FTP lets me browse my Linux box with Internet Explorer. It very convenient and easy to use. I can create, delete, rename, and copy with no problem. I haven't tried it yet (I don't run a gui on my Linux box) but using Mozilla from Linux to anonymous FTP on Windows should work exactly the same.

  23. Re:HPFS by Anonymous Coward · · Score: 1, Interesting

    NT was able to mount HPFS (OS/2) volumes, though I think that was dropped in 2000 or XP??

  24. What about Mac Users? by moosesocks · · Score: 4, Interesting

    When will us Mac users get NTFS support?

    I'm not sure if you realize it, but there is no easy solution for using an external hard drive over 32gb with multiple platforms.

    As of this driver, it appears that NTFS is probably the best way to do this, as it now has Linux support.

    Windows or MacOS don't support Ext3 natively, and the 3rd party drivers are slow. Fat32 has a 32gb limit. Mac HFS+ can't be read by Windows.

    How easy could it be to write an NTFS driver for OS X?

    --
    -- If you try to fail and succeed, which have you done? - Uli's moose
  25. What about Other Windows Drivers by SAJChurchey · · Score: 2, Interesting

    Does this mean that other drivers used for hardware (i.e. WinModems) might also be able to be emulated via this method?

  26. Why? by Safiire+Arrowny · · Score: 2, Interesting

    Why *is* it harder to read from an ntfs filesystem than to write to it?

    The current ntfs kernel module is able to understand the formating of ntfs in order to read it, but shouldn't that same understanding allow them to code proper "write" access as well?

    It's obviously true that it's more difficult, but why?