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."

35 of 548 comments (clear)

  1. 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 kasperd · · Score: 5, Insightful

      Surely it is illegal to copy the ntfs.sys driver and distribute it in another operating system

      I was thinking exactly the same, but there might be a way around that. Knoppix just have to contain the wrapper code, the actual .sys file can be loaded from the harddisk (if present). Systems with an NTFS formatted harddisk and no ntfs.sys file are probably rare. Problems that need to be solved are, how to verify intergrity of the ntfs.sys file you are going to load (if you care about that), 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, which is far simpler than full read-write support. Besides loading ntfs.sys would even be a user mode task, and reading NTFS from user mode is probably easier to implement than doing it from kernel mode.

      --

      Do you care about the security of your wireless mouse?
    3. Re:I'm not sure if we'll see it in knoppix by gillbates · · Score: 4, Insightful

      The only people who would need it already have it as a part of their Win2k/XP/2003 OS. Why else would anyone be using NTFS if they weren't running Windows?

      --
      The society for a thought-free internet welcomes you.
    4. 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???

    5. Re:I'm not sure if we'll see it in knoppix by mph · · Score: 5, Funny
      Everyone would use Linux if you could install it from inside Windows.
      For sufficiently small values of "everyone."
    6. Re:I'm not sure if we'll see it in knoppix by setzman · · Score: 4, Informative
      Um... I'm wondering here: How does Windows load ntfs.sys from an NTFS partition???

      Probably the same way OS/2 loaded HPFS.IFS on HPFS partitions. The boot kernel had some kind of micro-HPFS driver that allowed the system access to certain folders on the HPFS partition, allowing it to load necessary drivers.

      --
      C:\>
    7. Re:I'm not sure if we'll see it in knoppix by mystik · · Score: 5, Informative

      The same way grub or lilo loads linux from a reiserfs or ext2/3 partition --- rudimentary read-only access is coded into the bootloader.

      --
      Why aren't you encrypting your e-mail?
    8. Re:I'm not sure if we'll see it in knoppix by Nevo · · Score: 5, Informative

      NTLDR does the dirty work.

      NTLDR contains a mini-NTFS filesystem driver and mini registry parser. NTLDR reads the registry and determines all of the boot-start device drivers. NTLDR loads those drivers into RAM, then loads the kernel and the HAL.

      NTLDR then passes control of the machine to the kernel, along with a pointer to the in-RAM loaded drivers so that the kernel can start those drivers.

    9. Re:I'm not sure if we'll see it in knoppix by caseih · · Score: 5, Informative

      If you read the web page and try out the driver you'll find it does exactly this. It uses code from the ntfs project (libntfs) to grab the ntfs.sys file and copy it over to use it. Therefore no distribution of microsoft binaries is needed. If it can't find the driver on your hard drive, it can download it from microsoft.com from xp sp1 (which has some interesting legal implications).

  2. First? by Anonymous Coward · · Score: 5, Insightful

    Project includes the first open source MS-Windows kernel API for Free operating systems

    Surely that would be ReactOS, where he got a lot of the code from.

    But still, so it begind. First NDIS drivers now FS drivers. Next up it will be a GDI wrapper for X so you can use Windows binary drivers with your graphics card.

    All of this is a complete waste of time though. When did Open Source simply become a way to avoid paying for Windows?

  3. In other news... by jamonterrell · · Score: 5, Funny

    A vulnerability has been found in the latest version of knoppix. The vulnerability exploits one of several bugs found in NTFS.SYS and allows any user with access to the drive to render the system useless(moreso than simply using NTFS.SYS already does).

    --
    I can count to 1023 on my hands. Ask me about #132.
  4. You hit it... by lukewarmfusion · · Score: 5, Insightful

    right on the head. I'm still trying to make a real step into a Linux partition. I've been using Knoppix live and so far my bosses are mostly just confused. This might help me show them (and thus provide me a box to install on) how easy (and cheap!) this stuff really is.

  5. 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 homer_ca · · Score: 4, Insightful

      Sure it could work. The kernel NTFS driver is reliable enough in read-only mode. If you have NTFS partitions on your computer, you most likely have an installation of Windows where you can copy that file. It just has to search all NTFS and FAT partitions for \WINNT or \WINDOWS. This won't work if you don't dual boot and have removable media formatted with NTFS.

    2. 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.

  6. 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
  7. "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.

  8. 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.

  9. 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 ShavenYak · · Score: 5, Funny

      If it's as stable at reading/writing as Windows, then this will be a great hack.

      Man, talk about setting your expectations low....

      --

      Hey kids, there's only 5 days left 'til Yak Shaving Day!
  10. To all the "can't go in Knoppix" posters by BACbKA · · Score: 4, Insightful

    It would be perfectly legal for Knoppix to *know* that you might have an NTFS.SYS around on your computer, look around to see whether this is the case, and if it is, use your own copy NTFS.SYS.

    Of course, Knoppix will never itself be packaged with the NTFS.SYS. But if you have an NTFS partition, you have a damn good chance of having an NT around as well, with the driver right in there.

    I can only hope that MS doesn't insert some nastiness into the NTFS.SYS that would prevent it from running inside the framework described in TFA.

    HTH

    --

    VKh

  11. Re:What is this good for? by jared_hanson · · Score: 5, Insightful

    That sort of thing is exactly what this is good for. Let's say you give a Linux distro to a friend so he can try it out. This could be a Live CD or a distro that will make your system dual boot.

    In any case, your friend probably has a bunch of files on his Windows partition (likely NTFS formatted) that he wants to see if he can edit/view in Linux. If he can do what he wants, then switching to Linux becomes an option. So, with this, his NTFS partition is available and everything just works(TM). After all, your friend doesn't even know what NTFS is, but he does know when he can't get at his files.

    In short, this makes transitions to Linux much smoother. People shouldn't have to keep a copy of a file on both partitions just so its available in both environmets. It becomes a pain to figure out which document is the most recent, etc. etc. And, BTW, I'm talking about the average user who doesn't have a network drive.

    --
    -- Fighting mediocrity one bad post at a time.
  12. Re:How about the other way around by homer_ca · · Score: 5, Informative

    Merry Christmas. Here you go:

    Explore2fs

  13. 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.

  14. Another legal way to deal with the driver by unfortunateson · · Score: 5, Informative

    It would not seem unreasonable for the ntfs driver to be copied to a USB key or other media to be used at boot time.

    Optimally, like the other suggestions, this driver should be moved during config time, but I would be willing to load it my USB doohickey prior to booting Knoppix/Mandrake Live/whatevernix.

    I have valid Windows NT/2000/XP licenses on my machine, or I wouldn't have the NTFS partition to begin with. Maybe that's not a guaranteed assumption, and IANAL, but I don't think it would put too many MS lawyers on alert if it were done that way.

    Perhaps a copyright/license file stating "These files are to be used on computer systems with valid Windows NT/2000/XP licenses only." when they are copied to the USB Key.

    --
    Design for Use, not Construction!
  15. Re:How about the other way around by richie2000 · · Score: 4, Informative
    --
    Money for nothing, pix for free
  16. Re:Fsckin' Great... by blixel · · Score: 4, Informative

    How did people get around this issue before Read/Write access to NTFS? Did they have a FAT32 partition or something that both of the OS installations shared?

    Linux is my primary O/S. I only use Windows to uhh... well... I'm not sure what I use it for since I haven't booted to it in a couple of months. But I still have it on another partition.

    Anyway - I have my external Firewire drives formatted as EXT3 and I use Mount Everything to read/write to them under Windows. Not a free program though.

    This is another solution you can try for reading/writing to Linux partitions under Windows. This one IS free.

    And one final idea, also not free - and probably rendered obsolete by today's announcement of this Captive project - but it's another source never the less. This is for reading/writing to NTFS partitions under Linux.

    I'd like to give credit to the people who pointed out these links to me but it was a long time ago and I don't remember who they were.

  17. Re:usual M$ boasts are empty. by danheskett · · Score: 4, Insightful

    Such boasts are obviously proved empty by full read write access from a boot disk
    Any non encrypted filesystem would have all access controls subverted when mounted under a foreign operating system. Claiming anything else is absurdity. Do you think that ext2 holds the chmod based security when I mount it up under a box that it wasnt created under? You do realize that any user with root on any Linux box could simply reset all the attributes meant to keep users off/let them in under a different box?

    Why would you hold MS to fault for something that is unversial and by its nature fundamental?

  18. bah. i hate these. non-x86 users suffer. by Splork · · Score: 5, Insightful

    those of us on non-x86 platforms that want read/write NTFS access to external (firewire / usb2.0) drives will only suffer due to driver emulation layers like this.

    it satisfys much of the normal x86 crowd which means development of the real driver suffers.

  19. Re:OK... good by Minna+Kirai · · Score: 4, Informative
    Wine is actually fast because it ISN'T an emulator

    The oft-repeated tagline "Wine is not an emulator" is false. It would only be true if the word "emulator" meant "hardware emulator".

    It does not. Although most people think of CPU virtualization when they hear the word "emulator", that is not necessarily the case. According to dictionary definitions, WINE is emphatically an emulator.

    Here's the defintion:
    1. 3.
    2. Computer Science. To imitate the function of (another system), as by modifications to hardware or software that allow the imitating system to accept the same data, execute the same programs, and achieve the same results as the imitated system.

  20. Re:OK... good by cxreg · · Score: 4, Informative

    While its 'write-safe', the writes it can do is completely useless to most people.

    "The only supported operation is overwriting existing files, without changing the file length. No file or directory creation, deletion or renaming is possible. Note only non-resident files can be written to so you may find that some very small files (500 bytes or so) cannot be written to."

    Maybe using the windows NTFS driver this way will help provide enough debug info to complete this driver

  21. Re:OK... good by tiger99 · · Score: 5, Insightful
    Is that safe enough, or complete enough? Having had an NTFS partition badly damaged by Linux soem time ago, I don't really want to try it yet.

    I do appreciate the difficulties the kernel team have had with this, it is not their fault that they have to work with an undocumented closed-source file system.

    The strange thing about all this is that very many different OSs which have existed over the years have had some capability to read and write "foreign" file systems, either built in or as a third-party driver. Certainly it is standard with Linux, *BSD, even the hated SCO, also MAC in most of its variants, Amiga, Atari, Solaris....... Even many 8-bit computers could read a variety of foreign file systems. The one name missing is M$, absolutely none of their stuff recognises any othe OS at all. (Please correct me if I am wrong!) It is as if Bill arrogantly imagines that there are only Windoze PCs in this universe. The fact is that there are many things that can't be done under Windoze, but are relatively easy under some other OS. Maybe the reverse is true also, but I can't think of an example. It is absolutely normal in this day and age, even without open source, to need to read and write foreign file systems. The one obstacle is the Chief Hacker of Redmond, he will neither interface to other people's file systems (despite having the documentation, and most drivers under BSD licence) nor will he let anyone else do it by denying proper access to his documentation.

    One day, when the masses wake up to what they have been denied since Messy-DOS 1, he may realise that his monopolistic actions have in fact shot himself in both feet.

  22. 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
  23. Re:OK... good by 42forty-two42 · · Score: 4, Funny

    Well, that's okay, as long as we still have a recursive acronym: WINE Is Now an Emulator.