Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: help with user-friendly shared disk space NTFS/FAT/EXT4

  1. #1
    Join Date
    Jul 2011
    Beans
    13

    help with user-friendly shared disk space NTFS/FAT/EXT4

    Hi all.

    For years I have had 3 partitions on my laptop:

    / : ext4 (was once ext3)
    swap : swap
    /mnt/Archive : fat32

    This has worked like a charm for me and my good lady wife who also used the same laptop. In particular, this thread is about thew /mnt/Archive partition.

    I originally had windows (Vista... ugh) as well, and at the time NTFS was a bit shaky in linux, hence I used fat32 as a go-between partition. I no longer have or use windows, but the partition is now a shared space for both users.

    In essence I dont want to use a windows filesystem on there anymore, and especially not FAT32 as it is not very forgiving in the event of errors and it dopesnt support files bigger than 4gb, which the Mrs keeps forgetting...

    We share it for things like downloads, music library, Photos etc. I categorically DO NOT want any permissions to deal with on this partition. Unix style pernissions work fabulously for the / partiton (and by extension, for our home directories), but are an irritation at best for this shared partition, where security is not required.

    I have experimented with ext4, as this is what I have for the root partition, and it is notably faster than using fat32 or NTFS. However, mounting this with the same options as the / partition results in access problems between the two users (me and wife) on the system. If i create files and folders, she cant get into them and vice versa. I understand that there may be ways to deal with this using umasks, users, groups, etc but I am not sure how to. For me its just an annoyance as I have to keep recursively using chmod/chown as root to sort things out. For the wife its a deal breaker as she doesnt understand unix permissions, and in my view she shouldn't have to in this situation.

    We just want to use the drive as if it were a big usb flash drive, as we always have. Currently, I have the drive formatted as NTFS, as a compromise which gives better data integrity than fat32, but avoids the file/folder permissions/ownership issues that come with using a linuix-native filesystem.

    The ideal would be to use ext4, but have all existing and future files handled with owner and permissions as root:root 777 like it does with NTFS or FAT.

    Can anyone help me achieve this? Or is my current NTFS setup the best way to achieve this. I already know it's the easiest compromise....

    I have been googling all morning and all I can find is threads on interoperability with windows (which I dont need) or between different distros that use different usid numbering (which I dont need) The issue is 1 distro, 1 disk, 1 laptop, 2 users.

    the following are NOT solutions:

    *any solution requiring user action on an ongoing basis to manage file/folder access and ownership.
    * any solution which involves me creating special users or groups that are not already on my system. root:root 777 is fine.
    * any "solution" along the lines of "why are you trying to do that? You should do it this way" or "what you are trying to do is wrong" etc. If you have such an opinion, please offer alternatives AFTER a solution has been found. Please consider the fact that I am trying to do this for good reasons, which have hopefully been explained.

    A Big Thankyou in advance for any help I recieve.

    partiton, permission, access, mounting, filesystem

  2. #2
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    Quote Originally Posted by ex-oficio View Post
    I have to keep recursively using chmod/chown as root to sort things out.
    I'm surprised you had to do that more than once, but anyway...

    It seems to be a little known thing that you can can chown and chmod an empty filesystem by chowning and chmodding the mountpoint while it is mounted. The mountpoint itself doesn't get changed - the fileystem does. So - create your ext4 filesystem and then mount it. Don't try to copy any files onto it with root privileges. Let's assume the mountpoint is /media/mountpoint - change as necessary. Then:

    Code:
    sudo chown yourusername:yourusername /media/mountpoint
    sudo chmod 777 /media/mountpoint
    In fact if you and your wife are working from the same Ubuntu account, and therefore have the same UID:GID, you can safely omit the chmod. If you have separate accounts and therefore different UIDs, you will need the chmod. After you run those commands, you can do drag and drop copies just as you did with the FAT32 partition, and you can make folders as needed without root privileges.

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  3. #3
    Join Date
    Jan 2012
    Location
    Kerry/Dublin
    Beans
    109

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    I'd echo the above.

    As far as filesystems go, I'm a massive btrfs fan, but I don't think that you'd see the benefits of it on that partition.
    xfs is a good filesystem for large files and lots of small files, but has been known to be a bit shaky on bad disks. I've also had a few computers refuse to boot after a bad shutdown with xfs. It's a really easy fix(boot a live cd, mount partition, umount, shutdown), but it's irritating when it happens.
    jfs and reiserfs are also pretty nice filesystems. I personally use reiserfs on a partition where I have hundreds of thousands on tiny files, and it uses only 1/4 of the space that xfs took on the same partition, and 3/4 of the space ext2 took.
    I've never really used jfs, but I've heard good things, so it might be worth looking into.

  4. #4
    Join Date
    Jul 2011
    Beans
    13

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    Hi, thanks for the reply coffeecat, but unfortunately it doesnt help.

    when I experimented with ext4, I chmodded the mount point to 777 (didnt change the owner from root, as it doesnt effect who owns subsequent files and folders) so there was no isue with access to the partion at the top level. So ok that's easily fixed.

    To clarify, we are using seperate accounts. If we were sharing, there would be no issue at all, but because we use two different accounts, the problems come when we start putting files and folders in the partition. we start running into problems with file access, in a way that just doesn't/can't happen when the partition is NTFS.

    running chmod will fix access for whats there NOW, but as we add file and folders the problem comes back. I can fix it, but what I'm saying is I dont need this posix security and I want to do away with it on this partition.

    NTFS is one solution, but I hoped I could use a fastrer native FS without getting all the encumberance of difference owners/permissions.

    I hope that clarifies my problem.

    I just want to filesystem to behave like a fat32 flash drive, but without actually BEING FAT32 or NTFS.

    I can't be the only one wanting to do this.... surely?

  5. #5
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    Quote Originally Posted by ex-oficio View Post
    To clarify, we are using seperate accounts. If we were sharing, there would be no issue at all, but because we use two different accounts, the problems come when we start putting files and folders in the partition. we start running into problems with file access, in a way that just doesn't/can't happen when the partition is NTFS.
    I'll assume you want to be able to access each other's files. Some married couples don't! Try this then. Create a new usergroup, say "shared", and assign both your user accounts to the new usergroup. Now:

    Code:
    sudo chown root:shared /media/mountpoint
    sudo chmod 777 /media/mountpoint
    I must admit I haven't tried this since I'm the only one using my computer, but I'm fairly confident this will work since whether you or your wife create folder or files, they will be owned by a usergroup you both belong to.

    By the way, if you're using a recent version of Ubuntu, and you want to use a GUI tool to create a new usergroup and the rest, don't use the default "User Accounts" utility. It's - ahem - lacking in functionality. Install the package gnome-system-tools and then open the utility "Users and Groups". You'll find that somewhat more usable.

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  6. #6
    Join Date
    Jul 2011
    Beans
    13

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    Coffeecat,

    that sounds promising.

    yes, our home folders which are on the / ext4 partition are ... ahem.. private, as you say, but as you co0rrectly deduce, we want the shared partition to totally open, read/write etc on all current and future files and folders without having to manually correct/alter permissions ever. Like it would be if we permanently had a fat32 usb flash drive stuck in the side of the laptop.

    So with your suggestion, if I reformat /mnt/Archive to ext4, two questions follow:

    !) could I chown the /mnt/Archive (when it's mounted) to nobody:nobody, instead of creating a new user or group?

    2) will these be "sticky" in the sense that if user "bob" (with default group "bob") enters that directory and creates a file or folder will it have ownership bob:nobody or bob:bob ? if the latter, I'm back to square one.

    how would the suid option (in /etc/fstab) affect this? do I need to use a customised umask to ensure that both users will always be able to traverse the whole tree or delete/create/modify any file or fiolder with impunity irrespective of who created specific files and folders (strictly within the /mnt/Archive) partition?

    I really appreciate the help.

  7. #7
    Join Date
    Dec 2009
    Beans
    5,388

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    You have 3 ( at least ) options:

    **1** Leave it as NTFS since it does exactly what you want. You will get teased by the penguinistas in the playground but they will end up working for you when they grow up so ...

    **2** You can use the classic method around this.

    [1] Change the group of the ext4 partition to plugdev ( already exists on your system ):
    Code:
    sudo chown :plugdev /mnt/Archive
    [2] Set the setgid bit of that mountpoint so that any new file inherits that group:
    Code:
    sudo chmod 2775 /mnt/Archive
    You didn't tell us what version of Ubuntu you are using so you may have to add your wife to the plugdev group:
    Code:
    sudo gpasswd -a wife plugdev
    **3** You can use use bindfs that will create a "view" of that partition that will make it look a lot like an ntfs partition.

    [1] Install bindfs:
    Code:
     sudo apt-get install bindfs
    [2] To see how this will work you can temporarily create this view:
    Code:
    sudo bindfs -o perms=0666:+X /mnt/Archive /mnt/Archive
    That looks a little funny but what you are doing is mounting /mnt/Achive to itself with a view determined by the bindfs command. All old and any new files added while this view is in effect will have read / write permissions to everyone.

    Note: to undo this view unmount it:
    Code:
    sudo umount /mnt/Archive
    If that does what you want it to do then add the line without sudo to /etc/rc.local before the "exit 0" line:
    Code:
    bindfs -o perms=0666:+X /mnt/Archive /mnt/Archive
    Note: There may be a timing issue with using rc.local where the bindfs command is executed before the partition itself is mounted. If that happens then the best solution is to create an upstart job which I can help you with if there is an issue with using rc.local.

    EDIT: Don't know why but I should have added that /mnt/Archive has to be auto-mounted first by adding the appropriate line in /etc/fstab in order for bindfs to do it's thing. You didn't mention if you are or are planning to have this partition mounted at boot but it is a requirement.
    Last edited by Morbius1; November 21st, 2012 at 02:10 PM.

  8. #8
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    Quote Originally Posted by ex-oficio View Post

    !) could I chown the /mnt/Archive (when it's mounted) to nobody:nobody, instead of creating a new user or group?
    Interesting idea. I assume you mean user = nobody and group = nogroup, so it would be nobody:nogroup. Tbh, I don't know. Try chowning to nobody:nogroup and chmod 777 and see if it works. Let us know!

    I have to go out shortly for a few hours, but I'll come back to the other points later. Or I'm sure someone else will have commented before then.

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  9. #9
    Join Date
    Dec 2009
    Beans
    5,388

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    I'm going to be in and out of the forums the rest of the day so for completeness sake if you go the bindfs route I'll show you how I set up an upstart job to implement bindfs:

    [1] Create an upstart file:
    Code:
    gksu gedit /etc/init/bindfs-mounts.conf
    [2] Add this content:
    Code:
    # Create a common directory using bindfs
    description "Shared Directory"
    
    start on stopped mountall
    
    script
     bindfs -o perms=0666:+X /mnt/Archive /mnt/Archive
    end script
    "start on stopped mountall" will insure that the bindfs command is executed only after everything else has been mounted at boot.

  10. #10
    Join Date
    Jul 2011
    Beans
    13

    Re: help with user-friendly shared disk space NTFS/FAT/EXT4

    Morbius1 and Coffeecat,

    Thanks for your suggestions, and the effort and time you've put into providing them.

    As Morbius1 points out, NTFS does exactly what I want already, with the two big caveats that A) I dont trust it like I trust ext4, and B) the fiddling I've already done shows that ext4 is considerably faster, while NTFS and FAT were not only slower, but required a lot more cpu usage when reading/writing, and this matters to me, especially when I'm out on battery power. I dont know if this is because the implementations are less efficient or if the filesystem is iherently less efficient, but either way I want to save time and battery juice.

    I think you've both given me enough to occupy the whole of tonight and I'll report back to you what worked for me, or if indeed I ended up staying with NTFS (I hope not).

    I want to go with whatever option gives me the desired effect with the minimum change to the system, partly because I just think this should be easier. I bet it's stuff like this that puts off newcomers to the linux world. I can't help but feel there should be a "nosecurity" option that can be placed on the appropriate line for the partition in /etc/fstab/, which basically makes the kernel treat any partition in the same way as it treats NTFS/VFAT. I'm surprised at the absence of a "standard" simple way to acheive this, but thats another matter for now....

    Anyway, people, I don't know where in the world you are, but here in the UK its 13:50 and I'm supposed to be hard at work, so I'll be reporting back and hopefully marking this thread solved although not for at least 8 hours I expect...

    Cheers for now.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •