LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Mount Windows Share on RHEL4 (https://www.linuxquestions.org/questions/linux-networking-3/mount-windows-share-on-rhel4-573099/)

blizunt7 07-29-2007 01:22 AM

Mount Windows Share on RHEL4
 
Hey all,
I know this is a bad subject for a linux forum, but im looking to mount a windows folder from my LAN onto my Linux machine.

I have set to share a folder on my Windows Box. And I ran "findsmb" on my enterprise 4 machine. It found nothing.

Basically im just looking to share certain folders FROM windows TO linux.

THanks so much!

Lenard 07-29-2007 05:59 AM

That's because RHEL does not support for some of the older smb utils any more, one as to install rpm packages built from the samba.org source for in order to use the findsmb utility. You should use the IP address of the Windows shares for mounting, you can get this information from the Windows system(s) by typing: ipconfig /all

Remember to use cifs instead of smbfs when mounting also;
Example:
Code:

mount -t cifs //192.168.1.10/D /mnt/Desktop -o credentials=/etc/cifs.txt -rw

blizunt7 07-29-2007 12:03 PM

Hey,
I have the 2.6.9-42 kernel. Do i still need CIFS?

I have not heard much about it, and google doesn't seem to know that much either.

DO i need to open firewall rules on the windows box?
when i ran the mount command, it asked for a password. I tried all my passwords, as the remote user and as the admin user. Neither worked.

Thanks for the help

odcheck 07-29-2007 12:37 PM

You've got RHEL4 so thats so nice.
As Lenard said you'll need CIFS.

so for example you have a share on windows called test and you use easy filesharing.
The ip of the windows system is 192.168.1.1
then you can do this on your linux rhel4 in order to mount it.

Quote:

Create a Mountpoint
mkdir /mnt/winshare

then do a
mount -t cifs //192.168.1.1/test /mnt/winshare
to see the windows shares you can issue the command
Quote:

smbclient -L 192.168.1.1
you'll be asked for a password (just press enter)
If you don't have simple fileshare enabled on your windows system you'll have to mount like
Quote:

mount -t cifs //192.168.1.1/test /mnt/winshare -o username=yourusername on windows,password=his password
more details man mount.cifs

blizunt7 07-29-2007 01:35 PM

WOW, FANTASTIC
I had to do the following:

Code:

mount -t cifs //IP/share /mnt/point -o username=user
and that mounted it.
However it asked for the password the username, which is fine now. However how can i automake this in /etc/fstab and make it so I dont need the password??


Thanks so much

blizunt7 07-29-2007 03:56 PM

For those interested i found the solution to mount in /etc/fstab.

Add password file (anywhere really). I add in /etc/samba/smbpasswd (even though samba has nothing to do with cifs.

Code:

username=user
password=pass

then mount via the following:

Code:

$mount -t cifs //domain/share /mount/point -o credentials=/etc/samba/smbpasswd
:)

Lenard 07-29-2007 08:42 PM

And the entry in the /etc/fstab file follows like the examples given already;

//domain/share /mount/point cifs rw,credentials=/etc/samba/smbpasswd 0 0

odcheck 07-30-2007 12:55 AM

Quote:

Originally Posted by Lenard
And the entry in the /etc/fstab file follows like the examples given already;

//domain/share /mount/point cifs rw,credentials=/etc/samba/smbpasswd 0 0



domain...
? better use the host name instead and if dns or the host file isn't setup correct use the IP.

BTW - Don't put the credentials file in a home dir cause it isn't accessible at this time when the fstab is issued.

andy1974 08-03-2007 08:54 AM

and what happens if the share is unavable during the linux machine reboot? if the line is added in the fstab? the linux machine will halt boot correct?

somewhere, not sure where. I read a way to set it up where the shared drive is only mounted on demand. or somthing like that.

for example

if you have a linux machine that does a backup at 12 midnight and uses kbackup to do it, when it starts the backup it issues the mount then unmount when done.


am I off base?? sounds nice, but cant find where I read that.

my only concern is the fact that if the share is an external Hard drive on the windows network and the drive isnt attached or its turned off, and fstab dont see it during boot then it would be a pain to get the linux machine to boot. correct?

rossonieri#1 08-03-2007 07:40 PM

Quote:

Originally Posted by blizunt7
Add password file (anywhere really). I add in /etc/samba/smbpasswd (even though samba has nothing to do with cifs.

well - AFAIK, Common Internet File System/CIFS is SAMBA.

why you can mount remote share in /etc/fstab --> it because you already have access from SAMBA : mount -t cifs remember?

cheers :)

Lenard 08-04-2007 07:12 AM

Errr..........credentials=/etc/samba/smbpasswd is simply a path (/etc/samba) to a file named (in this case) smbpasswd which reads like;

username=fred
password=mypassword

andy1974 08-05-2007 10:20 AM

ok i got the share to mount with this

mount -t cifs //192.168.1.10/maxtor /mnt/winshare

but like what was stated before i need to hit enter because it asks for a pass, there is not pass so i hit enter and it mounts. (great)

but i want to use fwbackup to run at 2am and i want to set it to mount the drive before it starts backing up and unmount when it is finished,
when i tryed the code below and after i made the smbpasswd file it gives me a ton of option that i am not sure of...also i nothed that when i use

umount -t cifs //192.168.1.10/maxtor /mnt/winshare
to unmount the share ...it wont unmount i can still see it in the /mnt/winshare


Quote:

//domain/share /mount/point cifs rw,credentials=/etc/samba/smbpasswd 0 0

Lenard 08-05-2007 06:16 PM

Errr.....no! it is not: umount -t cifs //192.168.1.10/maxtor /mnt/winshare

The proper command is something like: umount /mnt/winshare


All times are GMT -5. The time now is 10:49 PM.