Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm having some doubts about how to install and allow linux to correctly read/write to a NTFS formated harddrive used as backup of various machines (windows included, that's how I need NTFS).

For now I've read some pages and I have the feeling I need someone else's guidance, from who already did this step-by-step, to not ruin things here.

What I need is to be able to save a linux file, with its chown and chmod settings, to a NTFS filesystem, and be able to retrieve this information back.

What I have today is a NTFS that saves all files with the owner:group of who mounted the volume, and permissions rwxrwxrwx for all.

I read this article but it is too much information and I could not understand some things when trying to actually implement:

  • Is it stable in the current version?
  • Do UBUNTU 10.04 have all things needed already? Or do I need to install anything?
  • What is the relation of POSIX ACL to this? Do I need install anything regarding this or just ntfs-3g will do?
  • Where are UBUNTU packages to run with apt-get?
  • If I map the users (with usermap) can bring the HardDrive to another computer with different users, will I be able to read them? (Under linux/windows)?

    For one thing I noticed, usermap was not ready to use. So I download and compiled (but not installed because I was afraid to mess things here), the last version of ntfs-3g. In the README file it says:

    TESTING WITHOUT INSTALLING

    Newer versions of ntfs-3g can be tested without installing anything and without disturbing an existing installation. Just configure and make as shown previously. This will create the scripts ntfs-3g and lowntfs-3g in the src directory, which you may activate for testing :

        ./configure
        make
    

    then, as root : src/ntfs-3g [-o mount-options] /dev/sda1 /mnt/windows

    And, to end the test, unmount the usual way : umount /dev/sda1

    But it tells nothing about the mount-options that I need to use to have full backups (full == backuping/restoring files, owners, groups and permissions).

This faq says:

Why have chmod and chown no effect?

By default files on NTFS are owned by root with full access to everyone. To get standard per-file protection you should mount with the "permissions" option. Moreover, if you want the permissions to be interoperable with a specific Windows configuration, you have to map the users.

Also, I did used the ntfs-3g.usermap /dev/sdb2 tools to create the map file and got this result:

# Generated by usermap for Linux, v 1.1.4
:carl:S-1-5-21-889330461-3416208041-4118870141-511
:default:S-1-5-21-2592120051-4195220491-4132615201-511
carl:carl:S-1-5-21-889330462-3416208046-4118870148-1000

Now this default was mapped because I wrote "default" to one file that was under the default user during the inquiring. I'm not sure if I did that right. I don't care for any users but carl (and root for that matter), and for any other groups but users. I saw the FAQ telling me to answer the group with the username. Isn't it the case to tell the group as "users"? And how can I check, booting windows, if this mapping is correct?

Summary:

  1. I need rsync to save linux files and windows files from various computers, to a NTFS external USB HD, without losing file permissions.
  2. I don't know how to install and run the driver ntfs-3g to allow chown, chmod and anything else that is needed to make that possible. What options, and where?
  3. All computers have carl username, but that doesn't guarantee that their SID, UID or GID are the same.
  4. The environment is composed of 18 "documents" folders, 6 of them linux, 6 of them win7, 6 of them virtualbox win XP. All of them will be a single "documents" folder into the NTFS external hard drive.

Reference:

  • I also read this forum, and maybe it is useful to someone trying to help me here.
  • Also thought of these other three solutions, making the filesystem ext. But the external HD may be used in windows boxes I could not install or have write to install drivers. So it needs to be readable easily by any windows and NTFS is the standard.

All my google searches was too much technical to follow.

share|improve this question
3  
This is not a tutorial-on-demand site, it is a QnA site. You should probably break this down into several questions and take it step by step. Also I think your summary is probably verbose enough to grasp the whole problem without all the other details. The less people have to work to understand what you are asking the more likely they are to jot down an answer. –  Caleb Apr 21 '11 at 7:43
    
Ok, thanks for the edition. –  Dr Beco Apr 21 '11 at 7:50
    
see also a similar question/goal: unix.stackexchange.com/questions/31022/… –  imz -- Ivan Zakharyaschev Jul 3 '13 at 18:51

1 Answer 1

up vote 8 down vote accepted

You can use ntfs-3g, but make sure you place the mappings file in the right place. Once you do that you should see file ownerships in ../User/name match the unix user.

However, if you just want to use it as backup you should probably just save a big tarball onto the ntfs location. If you also want random access you can place an ext2 image file and loop mount it. That will save you from a lot of these headaches.

Ok, assuming you will mount NTFS under /ntfs

run ntfs-3g.usermap /dev/sdb1 (or whatever your ntfs partition is). Answer the questions. Then mkdir /ntfs/.NTFS-3G. Then cp UserMapping /ntfs/.NTFS-3G/UserMapping. Now put an entry in /etc/fstab:

/dev/sdb1 /ntfs ntfs-3g defaults 0 0

Then mount /ntfs. The command ls -l /ntfs/Users/Carl should show your Linux user as the owner of files there.

share|improve this answer
2  
+1 for using tarballs. –  Caleb Apr 21 '11 at 7:44
    
Thanks Keith, but just "you can use ntfs-3g" will actually not help too much. You say it is stable, so I can use it without concerns? That is good. One doubt down. But now: how to do it is the question! :) About the ext2 image file, I can't mount it under windows, so that is not possible. Also, I can't create a tarball under windows without installing software. The backup is not only from linux to HD, but also from windows to HD. –  Dr Beco Apr 21 '11 at 7:47
    
@caleb I don't have the conditions to create tarballs under windows without installing some "tar" file. Remember, I'm not using only linux, but booting linux and windows, bringing the external USB HD with me, some places saving info, other places just using the info. I would use info also in computers that is not even mine, like for presentation, class teaching, etc. So, I need plain NTFS. Thanks –  Dr Beco Apr 21 '11 at 7:49
    
@Drbeco hm, I use ntfs-3g and haven't had any problems with it (once I figured out the mappings file). I guess it's still not clear to me what you are trying to do. Do you also need Windows to access your Linux backup files? –  Keith Apr 21 '11 at 7:51
1  
They are just files, I would not categorize them as being linux files or windows files. They are my projects, source codes (portable codes that compile and run in both SO), presentations, etc. So, yes, I need them to be available under both SO. Kind of trick, isn't it? What I don't know is how to enable linux to use correclty NTFS. –  Dr Beco Apr 21 '11 at 7:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.