Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

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

  1. #11
    Join Date
    Jul 2011
    Beans
    13

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

    Oh, and finally, to answer your questions, I'm using 10.04 Lucid, and yes as has always been the case on my setup, /mnt/Archive is to be automatically mounted at boot via /etc/fstab

  2. #12
    Join Date
    Dec 2009
    Beans
    5,375

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

    Random thoughts in no particular order:
    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.
    If a mounted ntfs partition has that much of a performance hit on your system then bindfs may not be your best solution. Although the mechanism is slightly different bindfs is using the same method ( fuse ) to achieve a mounted ext4 partition with NTFS like immutable permissions. You can try mounting it through the terminal on a temporary basis to see if it does have an impact then abandon the idea if it does.
    I'm using 10.04 Lucid,
    If you use the setgid method:
    **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
    You will need an additional step. You need to change the default umask of your system so that non root users save with 664 permissions instead of the default 644. Edit and change the umask value in /etc/profile to: umask 002. Later versions of Ubuntu have made the default 002 so no change is required.
    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.
    Doing a chmod 777 will in fact allow anyone to read and write to the folder meaning that anyone will be able to add or delete a file. The question is what rights do you want to give users for the files themselves. If "wife" adds a file it will save as wife:wife 644. "Husband" can delete the file because of the 777 on the parent directory but he will not be able to edit the file itself.

    If you enable the setgid bit, change the group, and change the default umask then when "wife" adds a file it will save as wifelugdev 664. Both husband and wife are members of the plugdev group so both have edit access to individual files.

  3. #13
    Join Date
    Jul 2011
    Beans
    13

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

    You will need an additional step. You need to change the default umask of your system so that non root users save with 664 permissions instead of the default 644. Edit and change the umask value in /etc/profile to: umask 002. Later versions of Ubuntu have made the default 002 so no change is required.....

    ....If you enable the setgid bit, change the group, and change the default umask then when "wife" adds a file it will save as wifelugdev 664. Both husband and wife are members of the plugdev group so both have edit access to individual files.
    Great stuff Morbius1, I think your option 2 will probably work for me. These last two bits of info you've provided above seem to address my lingering concerns, but I'll ned to check tonight to confirm.

  4. #14
    Join Date
    Jul 2011
    Beans
    13

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

    By the way, can i set a umask of 002 in fstab entry for /mnt/Archive, and achieve the same result?

  5. #15
    Join Date
    Jul 2011
    Beans
    13

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

    never mind, i now realise that umask in fstab is only for filesystems that dont natively support the unix security model. I will set umask to 002 in /etc/profile and do a reboot.

  6. #16
    Join Date
    Jul 2011
    Beans
    13

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

    So, option 2 was the solution for me. Incidentally, I use /media/Archive and not /mnt/Archive not sure why I said /mnt earlier when I meant /media/. Strictly, /mnt/ is supposed to be used for permanent mounts, but using /media/ causes the mount to be shown on the desktop and in "places" in the places menu and in nautilus, as if it were a removable drive, which is the behaviour I want.

    I did the following, which I am writing out in full for the benefit of others who might want this:

    formatted and labelled the partition in gparted. I like gparted, but there are of course other ways.

    created mount point:
    Code:
     sudo mkdir /media/Archive
    set up fstab:
    Code:
     sudo gedit /etc/fstab &
    adding the line:
    Code:
     UUID=caa348d4-ec6b-45c1-8e9b-c2cc9f653cde /media/Archive  ext4    errors=remount-ro 0       2
    obviously your uuid, options and pass number will/may vary...

    Partition needs to be mounted at this point...
    Code:
    sudo mount -a
    I also removed the reserved space on this partition, as there's no need to it. I have 1% reserved on / so I dont need anything reserved on this one:
    Code:
    sudo tune2fs -m 0 /dev/sda3
    again milage varies on partition id.

    set group and sgid permissions as
    Code:
    sudo chown :plugdev /media/Archive
    Code:
    sudo chmod 2775 /media/Archive
    didnt need to add anyone to plugdev as I already did that in the past. it can be done many ways, including like so:
    Code:
    sudo gpasswd -a wife plugdev
    change the umask value in /etc/profile to: umask 002:
    Code:
     sudo gedit /etc/profile &
    in mine it was the last line, changed to:
    Code:
    umask 002
    reboot e.g.
    Code:
    sudo reboot
    Now, it turns out that even though it had no effect, linux finds a way to shoe-horn its own permissions into NTFS, so when I copied all my files from my backup usb drive (also NTFS) the files had all sorts of incorrect permissions, I suspect partially due to having been on fat32 previously (although the right group id, thanks Morbius1 )

    So I ran the following commands on my Archive partition, (and my NTFS usb drive for good measure....). The second one is because I have windows and linux executables on there and I want them set executable, and the second command also fixes the directories as they are also regarded as executable objects by linux, The IFS=$'\n'; is really important as if there are files or folders with spaces in their names things will go badly if you leave it out....

    Code:
    IFS=$'\n';  for i in `find /media/Archive/ -type f`; do chmod 664 $i ; done
    Code:
    IFS=$'\n'; for i in `find /media/Archive/ -executable`; do chmod 775 $i ; done
    Obviously, for anyone following this, change /media/Archive to whatever is correct for you...

    And that's it!

    I've been testing it between the two different user accounts, and the usid gets set according to who creates files and folders, but the gid is always plugdev and there are no access issues.

    MUCH RESPECT TO MORBIUS1 for the solution, and a tip of the hat to coffeecat for his help too.

    I hope this helps someone.

    .
    Last edited by ex-oficio; November 22nd, 2012 at 11:31 AM. Reason: forgot to say when partition needs to be mounted. fixed.

  7. #17
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

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

    I do not fully understand all of it either. But saved a few threads of users that seem to:

    user-friendly shared disk space NTFS/FAT/EXT4 - posts by Morbius1
    http://ubuntuforums.org/showthread.php?t=2086540


    Share folder among two users of same PC.- morbius1
    http://ubuntuforums.org/showthread.php?t=2033060
    http://ubuntuforums.org/showthread.php?t=1998114
    http://content.hccfl.edu/pollock/aun...ermissions.htm
    Two users to share music folder - group & permissions -BoneKracker:
    http://ubuntuforums.org/showthread.php?t=1484221
    http://ubuntuforums.org/showthread.php?t=1488065
    All users read/write shared folder - morbius1
    http://ubuntuforums.org/showthread.php?t=1727396
    See lucky's post on network based shares & setting permissions commands
    http://ubuntuforums.org/showthread.php?t=1498422
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







Page 2 of 2 FirstFirst 12

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
  •