Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux drive mapping?

Status
Not open for further replies.

andnos

Technical User
Nov 21, 2005
48
US
Ok, I'm only starting out with linux, so don't laugh if this is like "super easy". But is there a function in linux, that is like mapping a network drive as a local drive in windows?

Thanks,

Andy
 
look into 'mount', eg :

# make your directory to mount onto
mkdir /my_remote_dir

# mount it via (for example, nfs)
mount -t nfs serverIP:/server_mount_point /my_remote_dir

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
The command you are looking for is 'mount'. However, linux has no conception of a drive letter; you mount them to a directory. You also need the appropriate networking file system either built into the kernel or available as a module.

As an example, to mount a Windows share:
Code:
mkdir /mnt/winshare
mount -t smbfs //192.168.1.100/myshare /mnt/winshare -o username=myusername

It will then ask your for your password. Then the share should be available and you can change into it like a normal directory and your files should be available.

This is a simplistic example though.
 
Thanks for quick responses,


danomac, once it does ask me for the password, will it store the password for future use? or will I have to renter the password after reboot?

Is there a way to the system to remember the password so I wouldn't have to reenter it all the time?
 
In that case you would have to reenter the password after the next reboot. It is possible however to set up a credentials file and put a line in your /etc/fstab that will not ask you for the password, and just automatically mount at boot.
 
Is there a way to do this in xwindows? or is the prompt the only way to go?

Thanks,

AN
 
Depends on the desktop/file browser you use.

If you use KDE, you can use this in the location bar in Konqueror:

Code:
smb://x.x.x.x/share

And it should connect. I haven't used it, so I don't know if it will ask you for a username/password or remember it if you do enter it.
 
The method using x might depend on which distro & window manager that you're using. danomac's method above should work across the board, but some distro's might have something special included.
 
slackware 10.2 KDE is what is running on the machine
 
You're "starting out" with Linux, and running Slackware? Slackware is good, but it's really for experts. You'll save yourself a whole lot of grief if you go for one of the more novice-friendly distros like Ubuntu, Suse, etc.
 
I sort of inherited this version set up..... and I was told that if I ran the other versions I wouldn't learn much of linux.

 
That's fair enough advice, but you're being thrown in the deep end. With Slackware, you'll have to do enormous amounts of reading, experimentation and frustration to handle the most minor configuration changes on your system. It's like having to build your own car as part of learning to drive. With Ubuntu/Suse/etc you have GUI programs to do most of the work for you. OK, they don't force you to learn much, but at least they get you off the ground and put you in a position to explore the system at your own pace at a later stage.
 
Right, slackware will cause you to learn a lot about linux. Which means the answer to your question, was the first 2 responses by sedj & danomac
 
You could put the following script in the login user's

.bashrc file


mount -t smbpasswd -o ip=x.x.x.x,username=yourvalidaccount,password=validpassword //windozbox/share //mnt/mywindozshare


This script will re-mount the windoz share at login time.


QatQat

Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top