How to get permissions for all users for new drive added to the system - 12.10
One option would be to create a group with read/write permissions on that folder and then add each one of the users to that group.
First, you need to create a new group:
groupadd my_media_group
Then change the permissions of your files. Supposing /dev/sdd1
is mounted in /media/nick/Media Store
sudo chgrp /media/nick/Media\ Store my_media_group
sudo chmod -R 2770 /media/nick/Media Store
The first command will change the group of that folder. The second will set rwx permissions to owner and group (770) and make new created files have the group of the parent folder (2). If you already have files in that folder, it may be needed to change their group also (it can be made with chgrp -R
)
Lastly, for each one of the users in the system add it to that group:
sudo usermod -a -G my_media_group <username>
I haven't tried this, and it may not be the best way to do it, but if it doesn't work you should be able to go back using chgrp
and chmod
.
Hope this helps.
Related videos on Youtube
mutineer
Updated on September 18, 2022Comments
-
mutineer almost 2 years
I've added a new disk with a single ext4 partition and I want to use this as a shared multimedia drive
/dev/sdd1
for all users and occasional samba users. It seems to work ok while I am logged in as root, but I can't seem to add rwx permissions for others. I've used nautilus under gksu to change the properties (permissions tab) for the Media Store folder in media/nick but it seems to make no difference on permissions for other users.Do I have to log into each of those other users, mount the drive with the super user permissions, then change the mount permissions for each users mount point folder? That seems a lot of work to do for each user, especially if it is not permanent. I guess there are lines I should be adding to fstab....
..but to be honest, as a newbie, I've got lost and would appreciate your pointers on a simple how-to guide.
My mount output is below... probably in a mess...
/dev/sdc1 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755) gvfsd-fuse on /run/user/nick/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=nick) /dev/sde1 on /media/nick/Elements type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) /dev/sdc2 on /media/gill/XPMedia type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) /dev/sdb1 on /media/nick/MultiMedia type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) /dev/sda1 on /media/nick/System type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) gvfsd-fuse on /run/user/gill/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=gill) /dev/sdd1 on /media/nick/Media Store type ext4 (rw,nosuid,nodev,uhelper=udisks2)
And here is my Fstab:
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sdd1 during installation UUID=bafb49a7-48da-4ec0-9ce2-639d831591d9 / ext4 errors=remount-ro 0 1 # swap was on /dev/sdd5 during installation UUID=58d2c95e-afaf-4adb-9c46-ae0f05af056c none swap sw 0 0 /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
There is no floppy in the system anymore, so I guess I could delete that without problems.
Thanks,
Nick
-
Sanam Patel over 11 yearsIs reformatting to NTFS an option? That's what I did as it seemed to be the simplest answer.
-
-
mutineer over 11 yearsMany thanks both. I get it now I think. I'll have a try. Regards, Nick