LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-07-2005, 09:15 AM   #1
zahadumy
Member
 
Registered: May 2005
Location: Cluj, Romania
Distribution: Fedora Core 6
Posts: 226

Rep: Reputation: 31
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
 
Old 11-07-2005, 09:25 AM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
You have to set a different umask for the mount point of the partition.
 
Old 11-07-2005, 09:25 AM   #3
okmyx
Member
 
Registered: May 2004
Location: Cornwall, UK
Distribution: Ubuntu 8.04
Posts: 464

Rep: Reputation: 31
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)
 
Old 11-07-2005, 09:26 AM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Oh... and as okmyx said, it can be a little tricky to write on NTFS partition... vfat are OK.
 
Old 11-07-2005, 12:27 PM   #5
zahadumy
Member
 
Registered: May 2005
Location: Cluj, Romania
Distribution: Fedora Core 6
Posts: 226

Original Poster
Rep: Reputation: 31
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.
 
Old 11-07-2005, 12:33 PM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
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
 
Old 11-07-2005, 01:35 PM   #7
zahadumy
Member
 
Registered: May 2005
Location: Cluj, Romania
Distribution: Fedora Core 6
Posts: 226

Original Poster
Rep: Reputation: 31
Thank you. It was really nice from you, other people would answer "RTFM".
 
Old 11-07-2005, 02:27 PM   #8
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Hey... we've been through this as well. ;-)
 
Old 11-07-2005, 02:36 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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).

Last edited by jschiwal; 11-07-2005 at 02:38 PM.
 
Old 11-07-2005, 06:16 PM   #10
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
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.
 
Old 11-08-2005, 04:53 PM   #11
zahadumy
Member
 
Registered: May 2005
Location: Cluj, Romania
Distribution: Fedora Core 6
Posts: 226

Original Poster
Rep: Reputation: 31
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.

Last edited by zahadumy; 11-08-2005 at 04:56 PM.
 
Old 11-08-2005, 05:03 PM   #12
Back_to_Linux
Member
 
Registered: Sep 2005
Location: PARIS
Distribution: Mandriva 10.0 Communoty
Posts: 117

Rep: Reputation: 15
put "umask=YOURMASK", on the target line
 
Old 11-08-2005, 07:00 PM   #13
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
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.
 
Old 11-09-2005, 02:14 PM   #14
Back_to_Linux
Member
 
Registered: Sep 2005
Location: PARIS
Distribution: Mandriva 10.0 Communoty
Posts: 117

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Let users write to windows partitions hobz Linux - General 4 05-29-2005 02:02 PM
Allowing normal users read-write access to Windows partitions Aphex_Twin2 Slackware 5 05-23-2005 09:22 AM
Can't write on my VFat32 windows partitions JeTa Linux - General 7 02-12-2005 12:18 PM
windows partitions write enable from suse 9.0 ciclotomico Linux - Newbie 2 04-27-2004 12:25 PM
Can Linux write to NTFS windows partitions? Stevetgn Linux - General 12 02-04-2004 05:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration