Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Cannot change folder and file permissions on NTFS drive

  1. #1

    Default Cannot change folder and file permissions on NTFS drive

    Hi. Newbie OpenSUSE 11.0.
    I installed OpenSUSE on my exWindows XP computer which I had setup to share files on a LAN that were stored on a secondary slave drive. I switched to OpenSUSE and was able (with a lot of hair pulling and tons of google searches) to configure SAMBA to continue to share the files on the LAN. My other computer on the network uses WinXP. I can now see the folder SAMBA shares with no problem on my WinXP computer.
    Issue now is that I cannot set sharing permissions on my secondary drive's folders, so I cant share it. I need read/write access on these folders. When I try to share it, it tells me I am not the owner, so I tried to change the owner via

    chown -R -v chepoxxx /windows/C

    and it tells me that the owner has been changed on all recursive folders. But when I go into Nautilus and look under the Permission Tab on properties for a folder it still shows 'root' as owner and I cant share it!
    What am I doing wrong here? I was able to share a folder and files on my '/home' folder with no problems. Does it have something to do with the drive being NTFS?
    I am just starting out with linux so please be gentle on your replies... Thanks
    -M

  2. #2
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,451

    Default Re: Cannot change folder and file permissions on NTFS drive

    You cannot use chown on Windows because it does not use the Linux permissions system. Writing to NTFS partitions is also discouraged because, unlike FAT, there is a journal which you cannot update when Windows is not running.

    To read and write to a NTFS partition, you need to change the contents of fstab.

    But it would be probably be safer to organise your files so that you need to use NTFS write access as little as possible.

  3. #3
    combatdoc NNTP User

    Default Re: Cannot change folder and file permissions on NTFS drive

    Also in general NTFS drives are mounted read-only by the system. Like john said, you can change this in fstab, but its highly discouraged.

  4. #4
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,727
    Blog Entries
    2

    Default Re: Cannot change folder and file permissions on NTFS drive

    Quote Originally Posted by chepoxxx View Post
    Hi. Newbie OpenSUSE 11.0.
    I installed OpenSUSE on my exWindows XP computer which I had setup to share files on a LAN that were stored on a secondary slave drive. I switched to OpenSUSE and was able (with a lot of hair pulling and tons of google searches) to configure SAMBA to continue to share the files on the LAN. My other computer on the network uses WinXP. I can now see the folder SAMBA shares with no problem on my WinXP computer.
    Issue now is that I cannot set sharing permissions on my secondary drive's folders, so I cant share it. I need read/write access on these folders. When I try to share it, it tells me I am not the owner, so I tried to change the owner via

    chown -R -v chepoxxx /windows/C

    and it tells me that the owner has been changed on all recursive folders. But when I go into Nautilus and look under the Permission Tab on properties for a folder it still shows 'root' as owner and I cant share it!
    What am I doing wrong here? I was able to share a folder and files on my '/home' folder with no problems. Does it have something to do with the drive being NTFS?
    I am just starting out with linux so please be gentle on your replies... Thanks
    I'm finding it hard to get my head around your setup/problem. I think you have this:
    • Machine running Suse
    • A second hdd is attached internally (i.e. not by external usb)
    • The second hdd has an NTFS partition mounted in directory "C"
    • You want to share the whole of the directory "C" via Samba
    • You are currently sharing "C" over the LAN but it is read-only and you want to be able to write too

    Is that right? If not then please correct me.
    Leap 42.3 & 15.1(Beta) &KDE
    FYIs from the days of yore

  5. #5

    Default Re: Cannot change folder and file permissions on NTFS drive

    That is exactly my setup. Just a few additional notes:

    * Computer no longer uses Windows (for good hopefuly)
    * Successfully shared /chepoxxx/home/Movies folder in network
    * Still not able to share folders in C (cannot access them through the other WinXP computer) on the network but read/write sharing on all folders in C is the goal.
    * Worried about < 4GB file restriction on FAT32 file systems

    I consider myself medium to knowledgeable computer user and really want to get into the whole linux thing. Thanks for your help.
    -M

  6. #6
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,727
    Blog Entries
    2

    Default Re: Cannot change folder and file permissions on NTFS drive

    Let's have a look at the ownerships and permissions: please open a console and enter these commands and post the dialogue back here:
    Code:
    ls -l /windows/C
    that looks at the detail of the permissions/ownership of the files
    Code:
    cat /etc/fstab | grep ntfs
    That looks at how you set up the mount
    Code:
    cat /etc/samba/smb.conf
    That looks at how you share the directory "C". It presupposes that you are not using Nautilus right-click sharing. If you are then let me know.
    Leap 42.3 & 15.1(Beta) &KDE
    FYIs from the days of yore

  7. #7

    Default Re: Cannot change folder and file permissions on NTFS drive

    Sorry about the delayed reply. I went on a family trip for the weekend.
    This is the output of the 3 terminal commands.
    Code:
    chepoxxx@chepolinux:/> ls -l /windows/C
    total 72
    drwxr-xr-x 1 root users 24576 2007-12-29 20:49 Chores Musick
    drwxr-xr-x 1 root users  4096 2008-02-18 22:40 My Documents
    drwxr-xr-x 1 root users 36864 2008-09-17 20:49 Progz
    drwxr-xr-x 1 root users  4096 2008-02-18 21:43 RECYCLER
    drwxr-xr-x 1 root users  4096 2006-12-29 21:00 System Volume Information
    drwxr-xr-x 1 root users     0 2008-06-03 08:58 $VAULT$.AVG
    chepoxxx@chepolinux:/> cat /etc/fstab | grep ntfs
    /dev/disk/by-id/scsi-SATA_HDS728080PLAT20_PFD201S2C9BUKJ-part1 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=002,locale=en_US.UTF-8 0 0
    /dev/disk/by-id/scsi-SATA_WDC_WD800BB-22FWD-WMAJ93570724-part1 /windows/D           ntfs-3g    users,gid=users,fmask=133,dmask=002,locale=en_US.UTF-8 0 0
    chepoxxx@chepolinux:/>  cat /etc/samba/smb.conf
    # smb.conf is the main Samba configuration file. You find a full commented
    # version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
    # samba-doc package is installed.
    # Date: 2008-06-06
    [global]
    	workgroup = auburn
    	netbios name = chepolinux
    	name resolver order = bcast host lmhosts wins
    	printing = cups
    	printcap name = cups
    	printcap cache time = 750
    	cups options = raw
    	map to guest = Bad User
    	include = /etc/samba/dhcp.conf
    	logon path = \\%L\profiles\.msprofile
    	logon home = \\%L\%U\.9xprofile
    	logon drive = P:
    	usershare allow guests = Yes
    	usershare max shares = 100
    	add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
    	domain logons = Yes
    	domain master = Yes
    	local master = Yes
    	os level = 65
    	preferred master = Yes
    	security = user
    
    [homes]
    	comment = Home Directories
    	valid users = %S, %D%w%S
    	browseable = Yes
    	read only = No
    	inherit acls = Yes
    [profiles]
    	comment = Network Profiles Service
    	path = %H
    	read only = No
    	store dos attributes = Yes
    	create mask = 0600
    	directory mask = 0700
    [users]
    	comment = All users
    	path = /home
    	read only = No
    	inherit acls = Yes
    	veto files = /aquota.user/groups/shares/
    [groups]
    	comment = All groups
    	path = /home/groups
    	read only = No
    	inherit acls = Yes
    [printers]
    	comment = All Printers
    	path = /var/tmp
    	printable = Yes
    	create mask = 0600
    	browseable = No
    [print$]
    	comment = Printer Drivers
    	path = /var/lib/samba/drivers
    	write list = @ntadmin root
    	force group = ntadmin
    	create mask = 0664
    	directory mask = 0775
    
    [series]
    	inherit acls = Yes
    	path = /windows/D/Series
    	read only = No
    
    [netlogon]
    	comment = Network Logon Service
    	path = /var/lib/samba/netlogon
    	write list = root
    You will notice that there are actually 2 drives "C" and "D". Both eventually want to have the same configuration so that WinXP laptop can have read/write access to both drives.
    -M

  8. #8
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,727
    Blog Entries
    2

    Default Re: Cannot change folder and file permissions on NTFS drive

    It seems to me that the drive /windows/C is not shared at all. That you can't even see it from a windows machine. Is that right?

    So to share it in a windows environment you make the Linux permissions to be rwxrwxrwx (to simulate windows) and then you share it to the world (making it accessible to "guests")

    This entry in fstab will mount the C partition in /windows/C so that it is rwrwrw and owned by a normal user:
    /dev/sda1 /windows/C ntfs-3g uid=1000,gid=100,umask=0000 0 0
    I've assumed that the C is sda1; alter if necessary. When the drive mounts it will be owned buy user 1000, probably that's you. Anyway you check the owner's name by executing this command again:
    Code:
    ls -l /windows/C
    Suppose the owner is "billybob".

    You then create a share for "C" by editing these lines into smb.conf:
    [Windows_C]
    path = /windows/C
    guest ok = yes
    read only = no
    force user = billybob
    Try that. If problems. post the smb.conf and in addition post output of these too:
    Code:
    sudo /sbin/fdisk -l
    Code:
    ls -l /windows/C
    Code:
    cat /etc/fstab | grep ntfs
    Of course, you treat "D" similarly.

    Luck
    Leap 42.3 & 15.1(Beta) &KDE
    FYIs from the days of yore

  9. #9

    Default Re: Cannot change folder and file permissions on NTFS drive

    How can I edit fstab from terminal with gedit??

  10. #10
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,727
    Blog Entries
    2

    Default Re: Cannot change folder and file permissions on NTFS drive

    Enter this incantation:
    Code:
    gnomesu gedit /etc/fstab
    Leap 42.3 & 15.1(Beta) &KDE
    FYIs from the days of yore

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •