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.

Currently I have a NTFS partition that contains shared data. My rationale is, NTFS doesn't have any idea about file permissions, so I won't have any trouble using them in a multi-boot system (currently I have Gentoo and Ubuntu, and the data partition is auto-mounted on both). Now I want to get rid of the NTFS thing, if possible. So the question is, how can I use something like ext4 and setup the same thing?

Update: Sorry I should have made it clear that I only have Linux distributions, so no problem with ext4. I just want to have a partition that contains world-readable files and is automounted at boot.

share|improve this question

4 Answers 4

up vote 7 down vote accepted

NTFS does have file permissions. Either you squashed them through mount options or you used consistent user mappings or you made your files world-accessible.

If you use a filesystem whose driver doesn't support user mappings, you have several options:

  • Arrange to give corresponding users the same user IDs on all operating systems.

  • Make files world-accessible through an access control list (this requires a filesystem that supports ACLs; ext[234] do, but you may have to add the acl mount option in your /etc/fstab). Run the following commands to make a directory tree world-accessible, and to make files created there in the future world-accessible:

    setfacl -m other:rwx -d -R .
    setfacl -m other:rwx -R .
    
  • Mount the filesystem normally and provide a view of the filesystem with different ownership or permissions. This is possible with bindfs, for example:

    mount /dev/sdz99 /media/sdz99
    bindfs -u phunehehe /media/sdz99 /media/shared
    

    Or as an fstab entry:

    /dev/sdz99  /media/sdz99  auto  defaults  0 2
    bindfs#/media/sdz99  /media/shared  fuse  owner=phunehehe
    

NTFS has the advantage that it's straightforwardly sharable with Windows, it is not a requirement for Windows sharing.

share|improve this answer
    
I'm sorry I haven't been able to get back to this question. I stopped using Windows already, so I want to switch completely to ext4 and I'm afraid that would mess up file permissions when I multiboot several Linux distributions. –  phunehehe Jan 14 '11 at 8:35
    
@phunehehe: The three solutions I give work with ext4. –  Gilles Jan 14 '11 at 19:30

Use bindfs. In short it adds more owners to the same folder. It gives you more flexibility and its simple. http://ubuntuforums.org/showthread.php?t=1460472

share|improve this answer

Your choice of filesystem depends on the operating systems that will need to read and write to the filesystem.

Since Windows doesn't natively support EXT4, and there is no 3rd party product to allow Windows to write to EXT4, I would use NTFS or FAT32 if Windows is one of the operating systems you need to share access to that data.

share|improve this answer
    
Sorry for the confusion, please see my update. –  phunehehe Jan 14 '11 at 8:41

This is old, but the poster edited to say he is only running Linux OSes. Windows and NTFS is not involved. Making a common linux data partition is useful and easy. Create an ext4 partition and copy your data to it. Get the UUID of the partition with #blkid and make an entry in your /etc/fstab file using a mount point like /home/user/data. Make the same entry in each distro's /etc/fstab file and make sure the mount point exists in each /home/user directory. Mine looks like this and mounts automatically no matter which distro boots:

#Common ext4 data partition for linux only on /dev/sdc2

UUID=7e265199-8184-48a6-a975-bef99dd88fc4 /home/jasmine/data ext4 defaults,user_xattr 0 0

Some recommend using a common /home shared by all distros but this is a bad idea. Your user .config files will all be merged into the same home. This can cause conflicts or at least confusion. Better to have a separate /home in each linux OS. It will not be very big if you just use it for your .config files. Put your data unto a separate partition (or better yet a separate drive) and mount it in /home/user as suggested above.

share|improve this answer

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.