Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to Mount a Remote NTFS Share for Read/Write under Linux Post 302212088 by shew01 on Sunday 6th of July 2008 09:20:29 AM
Old 07-06-2008
I found the answers, and I thought I would post them for anyone else who has had the same problem.

To dismount a temporarily mounted device:

Code:
umount /mnt/ntfs

To configure an NTFS share for write and automount:

Code:
    # Log onto the Linux computer with the root account

    # Create a credential file to hold the Windows username and password

    vi .base_linux

    cat vi .base_linux

+++ Begin screen output +++
username=my_nt_username
password=my_nt_password
--- End screen output ---

    chmod 600 .base_linux

    ls -l .base_linux

+++ Begin screen output +++
-rw------- 1 root root 35 Jul  5 23:59 .base_linux
--- End screen output ---

    # Determine the uid and gid of the account that will own the directory after it is mounted

    id my_linux_username

+++ Begin screen output +++
uid=500(my_linux_username) gid=500(my_linux_username) groups=500(my_linux_username)
--- End screen output ---

    # Edit the fstab file (note that uid 500 points to the my_linux_username Linux account)

    vi /etc/fstab

        (Add a line for //base/linux; see output from "cat /etc/fstab" below)

    cat /etc/fstab

+++ Begin screen output +++
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                   swap    defaults        0 0
//base/linux            /mnt/base_linux         cifs    auto,credentials=/root/.base_linux,uid=500,gid=500,file_mode=0777,dir_mode=0777 0 0
--- End screen output ---

    # Display the mounted devices

    mount

+++ Begin screen output +++
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
--- End screen output ---

    # Reload the fstab file

    mount -a

    # Display the mounted devices

    mount

+++ Begin screen output +++
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
//base/linux on /mnt/base_linux type cifs (rw,mand)
--- End screen output ---

    ls -l /mnt/base_linux

+++ Begin screen output +++
total 0
drwxrwxrwx 1 my_linux_username my_linux_username        0 Mar  4 22:10 db11g
-rwxrwxrwx 1 my_linux_username my_linux_username 89712640 Mar  4 22:02 oracle.tar
--- End screen output ---

    reboot

    # (Log onto the Linux machine with the root account)

    ls -l /mnt/base_linux

+++ Begin screen output +++
total 0
drwxrwxrwx 1 my_linux_username my_linux_username        0 Mar  4 22:10 db11g
-rwxrwxrwx 1 my_linux_username my_linux_username 89712640 Mar  4 22:02 oracle.tar
--- End screen output ---

    # Log onto the non-privileged Linux account

    su - my_linux_username

    # Display a directory of the files on the NTFS share

    ls -l /mnt/base_linux

+++ Begin screen output +++
total 0
drwxrwxrwx 1 my_linux_username my_linux_username        0 Mar  4 22:10 db11g
-rwxrwxrwx 1 my_linux_username my_linux_username 89712640 Mar  4 22:02 oracle.tar
--- End screen output ---

    # Write to the NTFS share

    touch /mnt/base_linux/temp.tmp

    # Display a directory of the files on the NTFS share--the write was a success

    ls -l /mnt/base_linux

+++ Begin screen output +++
total 0
drwxrwxrwx 1 my_linux_username my_linux_username        0 Mar  4 22:10 db11g
-rwxrwxrwx 1 my_linux_username my_linux_username 89712640 Mar  4 22:02 oracle.tar
-rwxrwxrwx 1 my_linux_username my_linux_username        0 Jul  6 00:21 temp.tmp
--- End screen output ---

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Pb for mount a ntfs fs type

Hie , I have a distrib Red Hat with a kernel-2.4.9-31 . I can't mount a ntfs fs with command : #mount -t ntfs /dev/hda1 /windows mount: fs type ntfs not supported by kernel Why doesn't my kernel support a type ntfs ? How can I mount this FS ? Merci d'avance.. (1 Reply)
Discussion started by: Romeo_91
1 Replies

2. Linux

Mount W2K share on Redhat Linux

How do I mount a Windows 2K share on Redhat Linux? I tried this: mount -t smbfs -o username=administrator,password=mypassword //machine/share But it just returns the help for the mount command:( (3 Replies)
Discussion started by: Spetnik
3 Replies

3. UNIX for Dummies Questions & Answers

How do i access (mount, read & write) a floppy disk from the console, not being root?

welll, the title quite explains what i want to do thanks for your time! (4 Replies)
Discussion started by: kfaday
4 Replies

4. UNIX for Advanced & Expert Users

Mount Linux share onto Sco 5.0.6

I've got a Sco 5.0.6 box and an Ubuntu box on my network. i want to backup certain directories onto a share on the Ubuntu box. how do i mount a linux share onto the Sco box? (1 Reply)
Discussion started by: sall
1 Replies

5. Linux

Mount ntfs in linux

How Can I mount Windows NTFS Partation in to Linux ? (4 Replies)
Discussion started by: Amit Deore
4 Replies

6. IP Networking

Can't see home folder on one NFS mount but can in another mount on another share

Hello, I have a few Ubuntu 9.10 laptops I'm trying to learn NFS sharing with. I am just experimenting on this right now, so no harsh words about the security of what I'm playing with, please ;) Below are the configs /etc/exports on host /home/woodnt/Homeschool... (2 Replies)
Discussion started by: Narnie
2 Replies

7. Red Hat

unable to mount windows share on linux 5.1

Hi, I am using redhat linux 5.1 - 64bit, using command mount -t cifs //192.192.192.192/SW/Ex /192.192.192.192 -o username=test I am getting below error. mount: block device //192.192.192.192/SW/Ex is write-protected, mounting read-only mount: cannot mount block device... (3 Replies)
Discussion started by: manoj.solaris
3 Replies

8. Red Hat

NFS mount read and write

Dear all, I have a server A and Client B. I am mounting a folder which is Server A using read and write options in client B. I have put entries in /etc/exports file as /mnt1/load *(rw,sync) In the client i cannot create any new file or delete any file eventhough it is read... (3 Replies)
Discussion started by: jegaraman
3 Replies

9. Windows & DOS: Issues & Discussions

Share NTFS for Backups

Hi, I would like to assign a 10TB LUN to multiple windows servers. On the LUN will be a folder assigned to each server to place its backup. Is there any change of data corruption with this setup. Thanks. (2 Replies)
Discussion started by: Mack1982
2 Replies

10. Shell Programming and Scripting

Script to mount nas-share using generated credentials (mount EC 13,32)

Heyas At home i have 1 nas with 3 shares, of which i used to mount 2 of them using a script with hardcoded password and username in it. EDIT: Turns out, its not the script, but 'how i access' the nas share.. (-o user=XY,password=... VS. -o credentials=...). Figured about credential files,... (0 Replies)
Discussion started by: sea
0 Replies
All times are GMT -4. The time now is 04:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy