Results 1 to 5 of 5

Thread: want to share Windows partition on Samba unable to change permissions

  1. #1
    Join Date
    Jun 2010
    Beans
    380

    want to share Windows partition on Samba unable to change permissions

    I have a windows partition which I Can easily access via nautilus gui.Without manually mounting the partition.When I click on the hard disk icon it automatically gets mounted at /media.

    Code:
     sudo fdisk -l
    
    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x711e302a
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
    /dev/sda2          206848   163839999    81816576    7  HPFS/NTFS/exFAT
    /dev/sda3       163840000   368639999   102400000    7  HPFS/NTFS/exFAT
    /dev/sda4       368640000   625139711   128249856    f  W95 Ext'd (LBA)
    /dev/sda5       368642048   625139711   128248832    7  HPFS/NTFS/exFAT
    Here is my /etc/fstab file

    Code:
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    /host/ubuntu/disks/root.disk /               ext4    loop,errors=remount-ro 0       1
    /host/ubuntu/disks/swap.disk none            swap    loop,sw         0       0
    ~
    and following are entries of smb.conf
    Code:
    [hell]
       comment = Winows files
       read only = yes
       locking = no
       browseable = yes
       path = /media/New\ Volume
       guest ok = yes
       public = yes
    The client machine tried to connect but it failed to mount the Windows partition from the server.
    Upon digging a further I noticed the permissions of volume in /media for others and group are 00
    The permissions I see are

    Code:
    deel@ubuntu:/media$ ls -l
    total 16
    drwx------ 1 deel deel 16384 2011-11-16 10:33 New Volume
    So assuming that samba client process does not have read permissions to above I tried to change the permissions at server.
    Code:
    deel@ubuntu:/media$ sudo chmod 755 New\ Volume/
    But now they did not changed
    Code:
    deel@ubuntu:/media$ ls -l  
    
    total 16
    drwx------ 1 deel deel 16384 2011-11-16 10:33 New Volume
    If you notice in above even after changing permissions the permissions have not changed. What could be the reason and how can I share the windows partition on samba server to my network?

  2. #2
    Join Date
    Oct 2011
    Beans
    822

    Re: want to share Windows partition on Samba unable to change permissions

    Just to be sure, did you install:
    sudo apt-get install ntfs-3g
    Quote Originally Posted by jamesbon View Post
    I have a windows partition which I Can easily access via nautilus gui.Without manually mounting the partition.When I click on the hard disk icon it automatically gets mounted at /media.

    Code:
     sudo fdisk -l
    
    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x711e302a
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
    /dev/sda2          206848   163839999    81816576    7  HPFS/NTFS/exFAT
    /dev/sda3       163840000   368639999   102400000    7  HPFS/NTFS/exFAT
    /dev/sda4       368640000   625139711   128249856    f  W95 Ext'd (LBA)
    /dev/sda5       368642048   625139711   128248832    7  HPFS/NTFS/exFAT
    Here is my /etc/fstab file

    Code:
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    /host/ubuntu/disks/root.disk /               ext4    loop,errors=remount-ro 0       1
    /host/ubuntu/disks/swap.disk none            swap    loop,sw         0       0
    ~
    and following are entries of smb.conf
    Code:
    [hell]
       comment = Winows files
       read only = yes
       locking = no
       browseable = yes
       path = /media/New\ Volume
       guest ok = yes
       public = yes
    The client machine tried to connect but it failed to mount the Windows partition from the server.
    Upon digging a further I noticed the permissions of volume in /media for others and group are 00
    The permissions I see are

    Code:
    deel@ubuntu:/media$ ls -l
    total 16
    drwx------ 1 deel deel 16384 2011-11-16 10:33 New Volume
    So assuming that samba client process does not have read permissions to above I tried to change the permissions at server.
    Code:
    deel@ubuntu:/media$ sudo chmod 755 New\ Volume/
    But now they did not changed
    Code:
    deel@ubuntu:/media$ ls -l  
    
    total 16
    drwx------ 1 deel deel 16384 2011-11-16 10:33 New Volume
    If you notice in above even after changing permissions the permissions have not changed. What could be the reason and how can I share the windows partition on samba server to my network?

  3. #3
    Join Date
    Jun 2010
    Beans
    380

    Re: want to share Windows partition on Samba unable to change permissions

    yes

  4. #4
    Join Date
    Dec 2009
    Beans
    5,916

    Re: want to share Windows partition on Samba unable to change permissions

    When you mount an ntfs partition from nautilus it mounts with you being the only one that can access it. That's by design. You can't do a chmod or chown on an ntfs partition since there are no linux permissions or ownership "bits" to set but there is an easy way out of this problem.

    Change this:
    [hell]
    comment = Winows files
    read only = yes
    locking = no
    browseable = yes
    path = /media/New\ Volume
    guest ok = yes
    public = yes
    To this
    [hell]
    comment = Winows files
    read only = yes
    locking = no
    browseable = yes
    path = /media/New\ Volume
    guest ok = yes
    force user = deel
    public = yes
    Then restart samba:
    Code:
    sudo service smbd restart
    The remote "guest" will be converted to "deel" for that share and therefore will have access to the directory but still be controlled by the "read only = yes" restriction in the share definition.

  5. #5
    Join Date
    Jun 2010
    Beans
    380

    Re: want to share Windows partition on Samba unable to change permissions

    Quote Originally Posted by Morbius1 View Post
    When you mount an ntfs partition from nautilus it mounts with you being the only one that can access it. That's by design. You can't do a chmod or chown on an ntfs partition since there are no linux permissions or ownership "bits" to set but there is an easy way out of this problem.
    Thanks for clearing this out.

    Quote Originally Posted by Morbius1 View Post
    The remote "guest" will be converted to "deel" for that share and therefore will have access to the directory but still be controlled by the "read only = yes" restriction in the share definition.
    This is a good suggestion.

Bookmarks

Posting Permissions

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