LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   I can write to Windows partitions only as root (https://www.linuxquestions.org/questions/linux-software-2/i-can-write-to-windows-partitions-only-as-root-380769/)

zahadumy 11-07-2005 09:15 AM

I can write to Windows partitions only as root
 
When I work in linux, i have a few directories where i usually write, so I would like to have write permissions only in those directories. So, I thought to change the group ownership of those directories to wheel (wheel includes my user) and give write permissions to all users in wheel. Can you tell me if this is possible? Because I get this message:
Code:

[root@localhost Linux]# ls -l
total 4
drwxr-xr-x  4 root root 4096 Nov  7 16:46 lab
[root@localhost Linux]# chgrp wheel lab/
chgrp: changing group of `lab/': Operation not permitted


eantoranz 11-07-2005 09:25 AM

You have to set a different umask for the mount point of the partition.

okmyx 11-07-2005 09:25 AM

If your Windows partiton is NTFS formatted then currently there isn't a safe way of writing to it anyway for root or any user.
(unless they've made some leaps and bounds in this area since i last checked)

eantoranz 11-07-2005 09:26 AM

Oh... and as okmyx said, it can be a little tricky to write on NTFS partition... vfat are OK.

zahadumy 11-07-2005 12:27 PM

How do I set the umask?
 
My partition is FAT32, i know it's not good to write on NTFS partitions. So the problem is the umask. How do I set a different umask?
Code:

[root@localhost ~]# umask -S
u=rwx,g=rx,o=rx

Thank you.

eantoranz 11-07-2005 12:33 PM

it's something you set either on the mount command (in case you are mounting manually) or set on /etc/fstab for that given mount point.

Check the mount options for vfat and fat partitions on the man page:
Code:

man mount

zahadumy 11-07-2005 01:35 PM

Thank you. It was really nice from you, other people would answer "RTFM". :)

eantoranz 11-07-2005 02:27 PM

Hey... we've been through this as well. ;-)

jschiwal 11-07-2005 02:36 PM

Just so that it is clear. The group ownership for a fat32 partiiton is set when the partition is mounted. In other words, not just the umask. Also, consider using the fmask and dmask parameters instead. This allows you to not allow execution of files, but be able to enter directories. The e"x"ecution bit is different for directories. You could also use the "uid=" option, to make yourself the owner of the partition (once it is mounted).

exvor 11-07-2005 06:16 PM

The linux 2.6 kernel series has stabel NTFS write support.


Because of the permissions in NTFS even if you mount it as read write you still may not be able to write to it. <-- i have had this issue before.

to be able to mount any parttion as a user then you need to change some options in your fstab.


NTFS has its own permissions that im not sure if linux can modify. I have always just moved things from and to that kind of parttion with root and never tried to change permissions for a folder so that a user could use it but im sure it would need to be done in windows not in linux for it to work. Of course im probably wrong but im not 100% sure if NTFS permissions are build into the driver in linux.

zahadumy 11-08-2005 04:53 PM

My /etc/fstab looks like this:
Code:

[root@localhost ~]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 /                      ext3    defaults        1 1
LABEL=/boot            /boot                  ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs  defaults        0 0
none                    /proc                  proc    defaults        0 0
none                    /sys                    sysfs  defaults        0 0
/dev/VolGroup00/LogVol01 swap                  swap    defaults        0 0
/dev/sda5              /mnt/D                  auto    defaults        0 0
/dev/sda6              /mnt/E                  auto    defaults        0 0
/dev/sda7              /mnt/F                  auto    defaults        0 0
/dev/sda8              /mnt/G                  auto    defaults        0 0
/dev/sda9              /mnt/H                  auto    defaults        0 0
/dev/hdb                /media/cdrecorder      auto    pamconsole,fscontext=system_u: object_r:removable_t,ro,exec,noauto,managed 0 0
/dev/fd0                /media/floppy          auto    pamconsole,fscontext=system_u: object_r:removable_t,exec,noauto,managed 0 0

Can you tell me what options do I need to add here in order to be able to write on a partition? In fact, i need write permissions only in one directory on a partition, but I think this doesn't matter... Of course, i would like to have permissions to write only on my user, not for everyone. Thank you.

Back_to_Linux 11-08-2005 05:03 PM

put "umask=YOURMASK", on the target line

eantoranz 11-08-2005 07:00 PM

for instance:
Code:

/dev/sda5              /mnt/D                  vfat    umask=0        0 0
That will give every item in that mount point (and below, of course) 777 permission.

Back_to_Linux 11-09-2005 02:14 PM

modify it lyke your want.
each partitioin can be mount everywhere you want, with the rigth you want to attribute them.


All times are GMT -5. The time now is 01:43 PM.