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
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
Random thoughts in no particular order:
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.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 you use the setgid method:I'm using 10.04 Lucid,
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.**2** You can use the classic method around this.
[1] Change the group of the ext4 partition to plugdev ( already exists on your system ):
[2] Set the setgid bit of that mountpoint so that any new file inherits that group:Code:sudo chown :plugdev /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 chmod 2775 /mnt/Archive
Code:sudo gpasswd -a wife plugdev
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.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.
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.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.
By the way, can i set a umask of 002 in fstab entry for /mnt/Archive, and achieve the same result?
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.
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:
set up fstab:Code:sudo mkdir /media/Archive
adding the line:Code:sudo gedit /etc/fstab &
obviously your uuid, options and pass number will/may vary...Code:UUID=caa348d4-ec6b-45c1-8e9b-c2cc9f653cde /media/Archive ext4 errors=remount-ro 0 2
Partition needs to be mounted at this point...
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 mount -a
again milage varies on partition id.Code:sudo tune2fs -m 0 /dev/sda3
set group and sgid permissions as
Code:sudo chown :plugdev /media/Archivedidnt 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 chmod 2775 /media/Archive
change the umask value in /etc/profile to: umask 002:Code:sudo gpasswd -a wife plugdev
in mine it was the last line, changed to:Code:sudo gedit /etc/profile &
reboot e.g.Code:umask 002
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 Morbius1Code:sudo reboot)
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 ; doneObviously, for anyone following this, change /media/Archive to whatever is correct for you...Code:IFS=$'\n'; for i in `find /media/Archive/ -executable`; do chmod 775 $i ; done
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.
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
Oldfred on vacation with no real computer access. (when you are retired is it still a vacation?)
May 23 thru June 5. For info on UEFI boot install & repair:
http://ubuntuforums.org/showthread.php?t=2147295
Bookmarks