ntfslinux.tgz提交时间:2006-03-08 提交用户:fatb 工具分类:其它工具 运行平台:Linux 工具大小:332730 Bytes 文件MD5 :c58e02e0c16168962696e9766da2557c 工具来源:http://www.ntfs-linux.com 这回可以在linux下真正的写NTFS文件系统了,这个东西安装十分简单。 ./install.sh --iocharset=gb2312 这样就好了,他会修改fstab的,有兴趣的可以爽爽,不过最好不要用来处理关键数据,掉了东西不要K俺 :) PARAGON NTFS FOR LINUX IFS DRIVER 1: About the NTFS for Linux driver The NTFS for Linux provides the ability to access files on NTFS filesystem in Linux platforms. Historically, different operating systems support different file systems. For this reason, files for different operating systems are separated from each other, and common documents must have a duplicate in every platform. It was a large discomfort for people who used several platforms on a single computer. For instance, documents, which are created in Windows and placed on NTFS partitions, are inaccessible in Linux only because Linux does not include NTFS support. The user needs actually to duplicate the document and keep attention to synchronize periodically copies placed on different partitions. The seemingly easy action of copying files to another location becomes a nuisance when source and target locations are available only in different operating systems. NTFS for Linux solves these problems - now everyone can access NTFS partitions from Linux in a usual manner. The driver allows mounting NTFS partitions, so that programs can work transparently with these drives- browse contents, open documents, run applications, work with existing files and create new ones. 1.1 How NTFS for Linux works Modern operating systems are based on the concept of Installable File System drivers (IFS). A user simply needs to provide an operating system with the proper file system driver to work with file systems in a usual manner. NTFS for Linux includes the NTFS driver for Linux environment. After appropriate components of NTFS for Linux have been installed, the operating system is able to mount foreign file systems and work with files placed on them. 1.2 Primary features NTFS for Linux is released in the Personal and Professional versions. Both Personal and Professional versions include following features: - Supporting NTFS ver. 1.2-3.1 (it corresponds to NTFS versions provided by Windows NT 4.0, 2000 and XP) - Supporting compressed files on NTFS drives - Read-only access driver in the Personal version, full access driver in the Professional version. 2: System requirements Minimum hardware requirements: - An i568 or compatible CPU - 16MB of RAM Supported Linux versions: - Linux with kernel versions 2.2.x or 2.4.x or 2.6.x Prerequisites A develop environment is required to compile Linux driver. Please verify these tools are all functional. The easiest way is to choose the developer toolkit when installing Linux. - kernel source code or header files #rpm -qa|grep kernel-source - GNU C #gcc --version - GNU make #make --version - binutils #ld --version - modutils #insmod -V Limitations: - GNU C compiler (gcc) must have the version 2.95 or higher. - The user should login as root to install the IFS driver. - Correct operation is not guaranteed when using Linux with kernel versions 2.3.x and 2.5.x (which are known for their instability) - Correct operation is not guaranteed for customized Linux kernels 2.1 Shipment The setup files of NTFS for Linux are provided as the downloadable gzip-archive, which can be downloaded from the company site. 2.2 Components The packet includes following components: - The source files for the NTFS for Linux IFS driver. - Assistant script files, which are purposed to simplify the installation & uninstallation routines. The specific feature of the NTFS for Linux IFS driver is that it must be compiled in the user's system for correct customization. This module is the open source code with libraries. Before installing the module, one must build a driver by using the GNU development tools. 2.3 Installing NTFS for Linux IFS driver The general scheme of working with the NTFS for Linux is the following: 1. (!) Log in as root. This step is obligatory. 2. Build the IFS driver by using the gcc compiler provided by Linux (this step will make the binary module). 3. Install the IFS driver (this step will make the module available for use). 4. After building and installing, the IFS driver can be referenced as a "used filesystem driver" when mounting NTFS partitions. This action is named "activating the driver". 5. To completely remove the driver from the system, one should dismount all NTFS partitions, uninstall the IFS driver and optionally remove the binary file. The steps 1, 2 and 4 should be made only once while the step 3 is the standard way of using filesystem drivers in Linux environment. NTFS for Linux IFS driver includes a set of assistant script files for the simplification of building, installing and uninstalling procedures (steps 1, 2 and 4). Note that these assistant scripts may fail to work in customized Linux configurations. The most friendly and convenient assistant scripts are the "install.sh" and "uninstall.sh" assistant script files. The alternative is to use the special makefile together with the "make" utility. The sections below describe the installation procedure in details. 2.3.1 Unpacking setup files The setup files of the Linux-based version of "NTFS for Linux" IFS driver are provided in a shape of the .TGZ archive. The archive should be copied on a hard disk and decompressed. Unpack the archive file to this directory. The command would be the following: tar zxC /usr/tmp -f /mnt/cdrom/ntfs4linux/ntfs4linux.tgz Next, change the current directory to the "/usr/tmp": cd /usr/tmp Next actions are to build and install the IFS driver. These actions depend on which a set of assistant scripts will be used. 2.3.2 Using the INSTALL.SH assistant script The assistant script "install.sh" provides the extremely easy and flexible way to make the IFS driver, install it in the system and mount all or selective NTFS partitions, which are currently exist on local hard disks. Additionally, the script reconfigures the system to mount automatically all selected NTFS partitions at the system startup. However, the script "install.sh" requires the development tools and kernel sources must present and should stay on the default locations. The script "install.sh" allows installing the IFS driver in the unattended (automatic) or in the interactive (customable) mode. Installing in the unattended mode Simply run the "install.sh" script: ./install.sh The assistant script will automatically perform following actions: 1. detect the Linux type & kernel version 2. find kernel header files and libraries needed for building the driver 3. build the driver binary module 4. install the driver 5. detect and mount all NTFS partitions on all local hard disks 6. reconfigure the file "/etc/fstab" to automatically mount these partitions at Linux startup. Installing in the interactive mode Run the "install.sh" script with the "--interactive" parameter: ./install.sh --interactive In this case, the script allows a user: ? Selecting a Linux type. ? Choosing whether NTFS partitions should be mounted automatically or not. If the user confirms automatic mounting of NTFS partitions, all of them will be mounted to the end of this session and will be mounted automatically at system startup in future. 1. First, the script asks the user to select the Linux type. The user should enter the number of the choice. The script provides ready-to-use installation schemes for RedHat, Mandrake, SuSE, Slackware and Debian. With other Linux types, one can try these schemes to obtain positive results. 2. The script tries locating source files and development tools automatically. In case of successful locating files, the script builds and installs the IFS driver. (!) This step cannot be customized in install.sh. 3. The final stage is to find and mount NTFS partitions. The script asks a user whether the mount-at-startup is required for NTFS partitions. In case of the user confirms it, the script searches NTFS partitions on all local hard disks and acquires mounting each NTFS partition. 4. All NTFS partitions are mounted in this session and will be mounted in future sessions automatically. (!) This step cannot be customized in install.sh. Advanced use of INSTALL.SH The assistant script "install.sh" supports following parameters: install.sh --help - displays the inline help install.sh --interactive [--iocharset=<charset>] - runs the script "install.sh" in the interactive mode Parameters: --help Display the "how to use" inline help --interactive Run the script in the interactive mode. If omitted, the script runs in the unattended mode. --iocharset Select the codepage or character set, which should be applied to the mounted NTFS partition(s). INSTALL.SH defaults - The assistant script "install.sh" always names the IFS driver "NTFS for Linux" as "ufsd" (it is the abbreviation of the project name "Universal File System Driver"). - The assistant script "install.sh" always mounts NTFS partitions to directories named like "/mnt/ntfs_0", "/mnt/ntfs_1" etc. Neither of these features can be customized in the script "install.sh". 2.3.3 Using the auxiliary makefile The alternative way of installing the IFS driver is to use the special makefile together with the system utility "make". The auxiliary makefile allows building the driver, installing and uninstalling the driver, activating and deactivating the module, removing the driver and its source files from the system: Command Action make Build the binary module of the IFS driver. make install Install the driver in the system (the driver should be built first) Make load Activate the driver (the driver should be installed first) Make unload Deactivate the driver Make remove Uninstall the driver from the system (the driver must be deactivated first) make clean Remove auxiliary compilation files of the IFS driver (the driver must be uninstalled first) Building the IFS driver 1. Login as root user. 2. Substitute header files in the directories "/usr/include/linux" and "/usr/include/asm" by header files of the actual Linux kernel. For instance, the actions would be the following: - Rename the directory "/usr/include/asm". - Rename the directory "/usr/include/asm-generic". - Rename the directory "/usr/include/linux". - In the directory "/usr/include", make the symbolic link to the directory ''/usr/src/kernel????/include/asm" - In the directory "/usr/include", make the symbolic link to the directory ''/usr/src/kernel????/include/asm-generic" - In the directory "/usr/include", make the symbolic link to the directory ''/usr/src/kernel????/include/linux" In this example, the subdirectory name " kernel????" should correspond to the actual kernel version, e.g. "kernel2.4.18-3". 3. Go to the directory, where the driver source files are placed. By default, it would be the directory "/usr/tmp". 4. Go to the subdirectory "./ifslinux". 5. Execute the command "make clean". This command will remove all traces of the previous driver installations, if exists. 6. Execute the command "make". This command will build the binary module of the IFS driver. (!) No errors or "undefined symbol" messages should appear! The compiled module "ufsd.o" will be placed to the subdirectory "./objfre", ready to be installed. Installing the IFS driver 1. Login as root user. 2. Go to the directory, where the driver source files are placed. By default, it would be the directory "/usr/tmp". 3. Go to the subdirectory "./ifslinux". 4. Execute the command "make remove". This command will uninstall a previous version of the IFS driver (if exist). In case of this is the most first attempt of the driver installation, this step can be omitted. 5. Execute the command "make install". This command will install the latest version of the IFS driver. (!) No errors or "undefined symbol" messages should appear! Activating the IFS driver 1. Login as root user. 2. Go to the directory, where the driver source files are placed. By default, it would be the directory "/usr/tmp". 3. Go to the subdirectory "./ifslinux". 4. Execute the command "make load". This command will activate the IFS driver. (!) No errors or "undefined symbol" messages should appear! 5. Optionally, execute the command "lsmod" to verify the successful module loading. The "NTFS for Linux" IFS driver module is named "ufsd". An alternative way to activate the IFS driver module is to use the "insmod" command: insmod ufsd 2.4 Uninstalling "NTFS for Linux" IFS driver The "NTFS for Linux" IFS driver package provides tools for the driver uninstallation automation. The assistant script "uninstall.sh" allows completely remove the driver from the system with correct uninstalling and unmounting all NTFS partitions. The script supports the unattended and interactive operation modes. In addition, the driver's makefile allows performing separately the driver unloading, uninstallation and the complete removing. 2.4.1 Using the UNINSTALL.SH assistant script The assistant script "uninstall.sh" provides the extremely easy and flexible way to deactivate and remove the IFS driver from the system. The script performs the correct deactivation, uninstallation and the complete removing of the driver's files. The script "uninstall.sh" allows installing the IFS driver in the unattended or in the interactive mode. Uninstalling in the unattended mode Simply run the "uninstall.sh" script: ./uninstall.sh The assistant script will automatically perform following actions: 1. Unmount all currently mounted NTFS partitions. Additionally, the script removes the appropriate mount-point and deletes reference to that partition from the "fstab". (!) If some NTFS partition was in use, the script is not unmount this partition. The further script execution is aborted in this case. 2. Deactivate the the IFS driver module. (!) If the driver is still in use, the further script execution is aborted. 3. Uninstall the IFS driver. 4. Remove all binary and source files of the IFS driver. Uninstalling in the interactive mode Run the "uninstall.sh" script with the "--interactive" parameter: ./uninstall.sh --interactive In this case, the script allows a user: ?Stop the script execution after unmounting all NTFS partitions. In this case, the IFS driver will remain available and active. ?Stop the script execution before uninstalling the IFS driver. In this case, the IFS driver will remain available for future use. ?In case of the user does not stop the script execution, it completely uninstalls the driver and removes all of its files. 1. The script tries unmounting all currently mounted NTFS partitions and removing references from the "fstab" to avoid automatic mounting of this partition in future. (!) If some NTFS partition was in use, the script is not unmount this partition. The further script execution is aborted. (!) This step cannot be customized in install.sh. 2. The script asks a user to continue with the driver deactivation. If the action was confirmed, the script unloads the driver. 3. Finally, the script asks a user to continue with the driver uninstallation. If the action was confirmed, the script uninstalls the driver and removes its files from the disk. (!) This step cannot be customized in uninstall.sh. Advanced use of UNINSTALL.SH The assistant script "uninstall.sh" supports following parameters: uninstall.sh --help - displays the inline help uninstall.sh - runs the script "uninstall.sh" in the unattended mode install.sh --interactive - runs the script "uninstall.sh" in the interactive mode Parameters: --help Display the "how to use" inline help --interactive Run the script in the interactive mode. If omitted, the script runs in the unattended mode. 2.4.2 Using the auxiliary makefile The alternative way of deactivating & uninstalling the IFS driver is to use the special makefile together with the system utility "make". The auxiliary makefile allows building the driver, installing and uninstalling the driver, activating and deactivating the module, removing the driver and its source files from the system: Command Action Make Build the binary module of the IFS driver. make install Install the driver in the system (the driver should be built first) Make load Activate the driver (the driver should be installed first) Make unload Deactivate the driver Make remove Uninstall the driver from the system (the driver must be deactivated first) make clean Remove all files of the IFS driver from the disk (the driver must be uninstalled first) Deactivating the IFS driver 1. Login as root user. 2. Manually dismount all NTFS drives (use the "umount" command for this purpose). 3. Execute the command "rmmod ufsd" This command will deactivate the module and unload it from memory. (!) If the driver module remains used by the system, the message "Device or resource busy" will appear. Uninstalling the IFS driver 1. Login as root user. 2. Go to the directory, where the driver source files are placed. By default, it would be the directory "/usr/tmp". 3. Go to the subdirectory "./ifslinux". 4. Execute the command "make remove" This command will uninstall the IFS driver from the system. (!) No errors or "undefined symbol" messages should appear! 5. Execute the command "make clean" This command will remove driver's files from disk. (!) No errors or "undefined symbol" messages should appear! 2.5 Using "NTFS for Linux" IFS driver After building and installing the IFS driver, it can be automatically load at the system startup. The driver allows to mount NTFS partitions and to get a plain access to their contents. Mounting NTFS partitions To get an access to a NTFS partition, use the standard command "mount" with a file system type which is set to "ufsd". Unmounting NTFS partitions To unmount a NTFS partition, use the standard command "umount". Choosing the codepage/charset for NTFS partitions The format of filenames on NTFS partitions differs from text presentation standards used in Linux. To accommodate NTFS standards to Linux ones, character translation is required. The character translation uses "charset" or "codepage" information for correct translation non-English characters between NTFS and Linux. Unfortunately the IFS driver is unable automatically detect Linux system settings. For this reason, the user must assign character set for filenames translation manually. The standard Linux command "mount" allows choosing the character set that be used for the filenames translation, the "iocharset" parameter is used for this purpose. The assistant script "install.sh" provides the ability of defining the character set for all automatically mounted NTFS partitions, the "iocharset" parameter is used for this purpose. One should realize that character set assigned to NTFS driver should conform to the actual locale settings in Linux. Otherwise, non-English filenames on NTFS partitions will remain unreadable. Examples: 1. Mounting a NTFS partition: mkdir /mnt/test_ntfs mount -t ufsd /dev/hda6 /mnt/test_ntfs 2. Dismounting a partition: umount /mnt/test_ntfs 3. Changing access rights to "read-only": mount -t ufsd -o remount,ro /dev/hda6 /mnt/test_ntfs 4. Choosing the character set to be used with NTFS partitions, when installing the IFS driver: ./install.sh --iocharset=utf8 5. Choosing the character set to be used with NTFS, when mounting partitions manually: mount -t ufsd -o iocharset=koi8-r /dev/hdb1 /mnt/test_ntfs 3: Troubleshooting 3.1 Can't compile Linux dirver 1. Read System requirements section, make sure all tools are functional. For more information, please read kernel documents. 2. Linux kernel must be configured correctly. When I `insmod ufsd.o', there are some error messages. 3.2 ufsd.o: kernel-module version mismatch That means kernel version mismatch. 1. check kernel source version in `/usr/src/linux/include/linux/version.h' 2. check the currently running kernel version #uname -r 3. Both two version must match. 4. If not match, please reconfigure kernel. 3.3 ufsd.o: create_module: Operation not permitted That means you must have root privilege to load driver. 3.4 insmod: a module named ufsd already exists That means driver have been loaded. Ther is no need to load it again. Driver status can be found by using following command #lsmod |grep ufsd >> 下载 << |