Find the answer to your Linux question:
Results 1 to 8 of 8
hello everyone, can anyone tell me the command to permanent mount aa windows directory into linux for using samba....
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    1

    permanent mounting of windows directory into linux

    hello everyone,
    can anyone tell me the command to permanent mount aa windows directory into linux for using samba.

  2. #2
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    In this case it's not a command, it's an entry in /etc/fstab. The details of the entry are specific to the partition and filesystem type. Your best bet would be to read up on fstab (either man fstab or googling) or to post more details of your case here. Whatever you do, make sure you backup /etc/fstab first!

  3. #3
    Just Joined! ultimatelinux's Avatar
    Join Date
    Mar 2010
    Posts
    36
    what should i add in /etc/fstab to mount my drive automatically.
    I've a drive with NTFS partitioning
    let that be /dev/sda0'
    what should i add?

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Quote Originally Posted by ultimatelinux
    what should i add in /etc/fstab to mount my drive automatically.
    I've a drive with NTFS partitioning
    let that be /dev/sda0'
    what should i add?
    Let say /dev/sda1 is NTFS Partition. Create a mount point ( folder ) for it, /media/sda1 and add this code in /etc/fstab
    Code:
    /dev/sda1  /media/sda1  ntfs-3g  defaults,umask=0 0 0
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,229
    /dev/sda1 /media/sda1 ntfs-3g defaults,umask=0 0 0
    Hi! I would like to also take this opportunity to ask something personally since this might also bring further clarifications to the original poster's concern...

    /dev/sda1 Object to mount
    /media/sda1 Destination of mount
    ntfs-3g To be able to read NTFS

    defaults,umask=0 0 0 Is this always the case or would this vary? I mean would these values be the same everytime I add a partition so it mounts automatically?

    ex.
    /dev/sda3 /media/Storage Bin Ext 3 defaults,umask=0 0 0

    Assuming I'm trying to mount a Linux Partition

    Thank you!
    nujinini
    Linux User #489667

  6. #6
    Just Joined!
    Join Date
    Nov 2006
    Location
    INDIA, New Delhi
    Posts
    27
    Quote Originally Posted by nujinini View Post
    Hi! I would like to also take this opportunity to ask something personally since this might also bring further clarifications to the original poster's concern...

    /dev/sda1 Object to mount
    /media/sda1 Destination of mount
    ntfs-3g To be able to read NTFS

    defaults,umask=0 0 0 Is this always the case or would this vary? I mean would these values be the same everytime I add a partition so it mounts automatically?

    ex.
    /dev/sda3 /media/Storage Bin Ext 3 defaults,umask=0 0 0

    Assuming I'm trying to mount a Linux Partition

    Thank you!
    Yes that's depend on your or your organization user's requirement say if you take the example of Devil Casper he mentioned below line for mounting ntfs filesystem partition in linux server

    /dev/sda1 /media/sda1 ntfs-3g defaults,umask=0 0 0
    In above Quote word umask=0 means allows any permissions. This does not actually set permissions just allows permissions to be set of files in this filesystem. Generally I have seen this umask parameter added with windows partitions like NTFS as in Devil's example. But in ext3 or ext 2 scenarion you don't need to add umask you can simply add the below line as per your scenario

    /dev/sda3 /media/Storage_Bin ext 3 defaults 0 0

    And if you want to set the permision in ext3 filesystem either you can use chmod command or you can use setfacl and also have to put acl word in /etc/fstab in the place of umask word as shown above.

    For more information how to manage filesystem and mounting foreign filesystems I recommend you to refer man pages of your distro. or you may also refer your disto. guide which should available on it's offical website.

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Filesystem permissions are different in NTFS and Linux based filesystems like ext3 or ext4.
    umask=0 set permission for every user in NTFS but it doesn't work for Linux based filesystems. You have to manage ownership and groups for that.

    For ext3 partition :
    Code:
    /dev/sda1  /media/sda1  ext3   defaults 0  0
    Only root user will have write permission in /media/sda1 but if you wan't to allow access to other users too, either change ownership of /media/sda1 or manage group.
    Code:
    chown -R /media/sda1  user_id:group_id
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,229
    Thanks DC & CJ!
    nujinini
    Linux User #489667

Posting Permissions

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