LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't create files in windows partition. (https://www.linuxquestions.org/questions/linux-newbie-8/cant-create-files-in-windows-partition-784788/)

korbes 01-26-2010 03:48 AM

can't create files in windows partition.
 
Hi,
I have Suse 11.2 installed. In Dolphin file manager I can see read files in my windows partition.
But I cant create or delete any of these files as a user.
I opened Dolphin as root and changed the permission rights of this windows folder so that all groups and users can view and Modify content. But when I try to create something I get the message access denied, "check your permission rights".
What am I doing wrong?
And how can I change these permission right for my user in console mode?
Maybe that will work?
Thanks in advance.

vrmartin2 01-26-2010 05:24 AM

What type of file system is your windows partition? If it's NTFS, it will be read-only.

r3sistance 01-26-2010 05:52 AM

I suspect you do not have the fuse ntfs-3g drivers what are required for writing to an NTFS partition. These drivers should be available off of rpmforge but I am not certain about how their installation goes on Suse.

i92guboj 01-26-2010 08:23 AM

Please, open a terminal, type this command and paste the output here:

Code:

mount
This will tell us what type of partition you are using, and whether it's mounted via fuse (and hence using ntfs-3g) or the regular in-kernel ntfs driver. It's the first step before proceeding any further.

korbes 01-26-2010 08:24 AM

OK,
Now I have installed ntfs-3g and in 'system info' I can see that the filesystem of my windows partitions are called now "ntfs-3g".
but I still can't write to them?
Do I have to still activate ntfs-3g or something?
please help.

korbes 01-26-2010 08:26 AM

Quote:

Originally Posted by i92guboj (Post 3840978)
Please, open a terminal, type this command and paste the output here:

Code:

mount
This will tell us what type of partition you are using, and whether it's mounted via fuse (and hence using ntfs-3g) or the regular in-kernel ntfs driver. It's the first step before proceeding any further.

Ok this is the outcome of the command 'mount':
Code:

korbes@linux-b8pz:~> mount
/dev/sda6 on / type ext4 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda7 on /home type ext4 (rw,acl,user_xattr)
/dev/sda1 on /windows/C type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sda2 on /windows/D type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sdb1 on /windows/E type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
/dev/sdb1 on /mnt/windows type fuseblk (rw,allow_other,blksize=4096)
korbes@linux-b8pz:~>


i92guboj 01-26-2010 08:29 AM

Code:

/dev/sda1 on /windows/C type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sda2 on /windows/D type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sdb1 on /windows/E type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)

This means that now your drives are using ntfs-3g, and they are mounted with the "rw" option (read/write), so they should be writable. Did you try to "touch" a new file as root on the said drives? For example:

Code:

touch /windows/C/foo
Should create an empty file called "foo" inside /windows/C/. Do it as the root user, so you can make sure that it's not a permissions issue, and see if it works.

ongte 01-26-2010 08:53 AM

Not familiar with Suse, so I'm not sure what default_permissions means. But this definitely is a permission problem. Can you show us your fstab?
Quote:

# cat /etc/fstab
You might need to specify a umask here.

Also might help showing us the permission in the Windows partition.
Quote:

# ls -l /windows/C

vrmartin2 01-26-2010 08:56 AM

And normally I would not be trying to write to the root of any file system. I'd try writing to some sub directory.

ALSO: ls -ld /windows/C would be helpful too. That would show the permissions on the top level directory (what I'm calling the root of the file system).

i92guboj 01-26-2010 09:11 AM

Quote:

Originally Posted by ongte (Post 3841003)
Not familiar with Suse, so I'm not sure what default_permissions means.

Well, the distro is nothing to do here. The mount options relate only to either the mount command itself or the chosen driver. In this case, this is ntfs-3g specific, so it's the ntfs-3g man page what you need to look at.

Setting an umask might help, setting the UID and GID as mount options might as well. I have not that much experience with Windows stuff these days so I can't really be sure.


Quote:

Originally Posted by vrmartin2 (Post 3841009)
And normally I would not be trying to write to the root of any file system. I'd try writing to some sub directory.

Any particular reason? The root directory is not special in this regard, as long as you don't go randomly overwriting system files without any care.

Quote:

ALSO: ls -ld /windows/C would be helpful too. That would show the permissions on the top level directory (what I'm calling the root of the file system).
Note however that permissions might be completely emulated at mount time. At least this is what VFAT does (the FAT fs can't store the permissions, simple as that), I am not sure at all how ntfs-3g handles the things though I know that NTFS can handle ownerships and permissions. Reading this might help with this issue:

http://pagesperso-orange.fr/b.andre/permissions.html

The key point is to understand how this works in conjunction with umask, gid and uid.

vrmartin2 01-26-2010 09:50 AM

The root directory in all systems should be treated as special, meiner Meinung nach (imho). I don't like anyone but root to write to the top most directories of a partition and when I create immediate sub dirs I create them with root and then assign them to some standard user. And in windows in particular, over the years, they have tried to make the root directory special (especially the C drive) to avoid attacks. It's good practice, and I'd be surprised if the windows system isn't trying to enforce extra restrictions on the top level directory.

vrmartin2 01-26-2010 09:51 AM

AND YES: VFAT is another story. It's wide open, but not NTFS.

jschiwal 01-26-2010 09:57 AM

You can configure how your NTFS partitions are mounted in YaST2's Disk module.

You can also edit your /etc/fstab file and add the "uid=<yourusername>,gid=<yourusername>". Also use the "dmask=" option and "fmask=" option to control the permissions.

Here is an example:
Code:

/dev/disk/by-id/ata-TOSHIBA_MK2049GSY_48CYT01OT-part1 /windows/C          ntfs-3g    users,noauto,uid=korbis,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
Because the NTFS filesystem doesn't use Linux permissions, you need to determine that when you mount it. All files and all directories will have the same permissions after mounting.

slightlystoopid 01-26-2010 10:10 AM

setting uid and umask appropriately is essential to mount rw on ntfs.

My fstab entry looks like this:

Code:

UUID=62AC6C71AC6C41A1 /home/jschmidt/windows ntfs user,noauto,allow_other,uid=1000,gid=100,umask=22,noatime 0 2
aside: I've yet to get user mount privileges working on an ntfs-3g device, but once it's sudo mounted, you can certainly write so long as uid and umask are correct.

EDIT: jschiwal beat me :(

vrmartin2 01-26-2010 01:40 PM

Samba
 
And if this happens to be a network drive (it's more likely something on your local system), Samba is much easier than all of this.

korbes 01-27-2010 12:55 AM

Ok thank you all guys for your reply. I think it is a permission problem too cause as root I am able to write to /windows/E.

Quote:

Originally Posted by ongte (Post 3841003)
Not familiar with Suse, so I'm not sure what default_permissions means. But this definitely is a permission problem. Can you show us your fstab?

You might need to specify a umask here.

Also might help showing us the permission in the Windows partition.

this is the outcome of my fstab:
Code:

korbes@linux-b8pz:~> cat /etc/fstab
/dev/disk/by-id/ata-MAXTOR_STMkorbes@linux-b8pz:~> cat /etc/fstab
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part5 swap                swap      defaults              0 0
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part6 /                    ext4      acl,user_xattr        1 1
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part7 /home                ext4      acl,user_xattr        1 2
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part1 /windows/C          ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part2 /windows/D          ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-Hitachi_HDP725050GLA360_GEA534RJ02RLDA-part1 /windows/E          ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                /proc                proc      defaults              0 0
sysfs                /sys                sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts              /dev/pts            devpts    mode=0620,gid=5      0 0
korbes@linux-b8pz:~>
380215AS_5QZ65BWL-part5 swap                swap      defaults              0 0
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part6 /                    ext4      acl,user_xattr        1 1
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part7 /home                ext4      acl,user_xattr        1 2
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part1 /windows/C          ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-MAXTOR_STM380215AS_5QZ65BWL-part2 /windows/D          ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-Hitachi_HDP725050GLA360_GEA534RJ02RLDA-part1 /windows/E          ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                /proc                proc      defaults              0 0
sysfs                /sys                sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts              /dev/pts            devpts    mode=0620,gid=5      0 0
korbes@linux-b8pz:~>

and this is the outcome of the permissions for windows/E:

Code:

korbes@linux-b8pz:~> ls -l /windows/E
total 112
drwxr-xr-x 1 root users  4096 2009-10-27 09:04 Backup PSP!!!
drwxr-xr-x 1 root users  4096 2010-01-18 05:37 Docs
drwxr-xr-x 1 root users 12288 2010-01-09 11:53 Films
-rw-r--r-- 1 root users    0 2010-01-27 07:41 foo
drwxr-xr-x 1 root users  4096 2009-11-17 10:54 Foto's
drwxr-xr-x 1 root users  4096 2009-11-26 10:13 Games
drwxr-xr-x 1 root users    0 2009-11-22 15:58 Linux
drwxr-xr-x 1 root users    0 2009-10-18 13:49 MSOCache
drwxr-xr-x 1 root users 65536 2010-01-09 11:16 Muziek
drwxr-xr-x 1 root users  8192 2009-12-26 11:20 Progjes
drwxr-xr-x 1 root users  4096 2010-01-18 15:18 $RECYCLE.BIN
drwxr-xr-x 1 root users    0 2009-03-10 15:11 Recycled
drwxr-xr-x 1 root users    0 2009-03-10 15:11 RECYCLER
drwxr-xr-x 1 root users  4096 2009-03-10 15:15 System Volume Information
drwxr-xr-x 1 root users  4096 2010-01-11 00:50 TEMP
korbes@linux-b8pz:~>

And remember guys I'm a newbie so I don't really understand uid and gid:
So please tell me what to do from here on?

jschiwal 01-27-2010 09:01 AM

You can either add a "uid=<your_username>" option to change the owner of the mounted filesystem allowing you full access. Or you can change the value of the 2nd digit in the fmask and dmask options.
"fmask=113,dmask=002"

vrmartin2 01-27-2010 10:39 AM

Masking
 
Here are some places you can get more info about "masking" (umask, fmask, etc):

http://www.cyberciti.biz/tips/unders...lue-usage.html

http://bodhizazen.net/Tutorials/Understandingfstab.pdf


All times are GMT -5. The time now is 11:28 PM.