Automount Windows server folders in openSUSE 11.4 client

On 07/20/2011 09:57 PM, DenverD wrote:
> On 07/20/2011 06:15 PM, Vahis wrote:
>
>

> http://waxborg.servepics.com
>

>
> wow! nice site!! so nice i followed your link earlier today and glanced
> at what popped up and it was SO professional i though it was a
> commercial web site (selling really neat trash cans)…and, i promptly
> ‘reported’ your sig as violating the T&Cs (no ads)…
>
> so, i say sorry to the mod(s) whose time i wasted as i praise your web
> design ability!!
>

What can I say :slight_smile:
Just another site made with WordPress.

But there are some notes I’ve made about doing openSUSE stuff, they come
out handy now and then.

Vahis

http://waxborg.servepics.com
openSUSE 11.2 (x86_64) 2.6.31.14-0.8-default “Evergreen” main host
openSUSE 11.4 (x86_64) 2.6.37.6-0.5-desktop in VirtualBox
openSUSE 11.4 (i586) 2.6.39.2-36-desktop “Tumbleweed” in EeePC 900

by Deano_ferrari
Code:

//192.168.18.112/sharename /path/to/mount/ cifs username=Yesitsme,password=WannaGetFired,_netdev 0 0

You can use the server's name in place of the IP address if preferred.

BTW, for security reasons, it is generally preferred to hide the username

and password credentials within a read-only file, and use this form instead

Code:

//192.168.18.112/sharename /path/to/mount/ cifs credentials=/root/etc/.credentials,_netdev,uid=client_user,gid=users   0 0

with the necessary credentials in a text file

<<the IP, server name, username, & password are all fake, but using them removes ambiguity from Linux speak>>

Code:

username=Yesitsme
password=Wanngetfirect

So I opened terminal in SU

mkdir -p /mnt/windows/

closed terminal, opened kwrite and wrote

#username & password for server acceess
username=Yesitsme
password=WannGetFired

saved it as credentials-back.txt, opened file manager in SU mode. copied it to /etc, renamed file to .credentials & closed file manager.

opened terminal in SU, opened kwrite /etc/fstab

added line at bottom

/dev/disk/by-id/ata-WDC_WD3200KS-00PFB0_WD-WCAPD2785035-part6 swap swap defaults 0 0
/dev/disk/by-id/ata-WDC_WD3200KS-00PFB0_WD-WCAPD2785035-part7 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-WDC_WD3200KS-00PFB0_WD-WCAPD2785035-part8 /home ext4 acl,user_xattr 1 2
/dev/disk/by-id/ata-WDC_WD3200KS-00PFB0_WD-WCAPD2785035-part2 /windows/C ntfs-3g defaults,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-WDC_WD3200KS-00PFB0_WD-WCAPD2785035-part3 /windows/D ntfs-3g defaults,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-WDC_WD3200KS-00PFB0_WD-WCAPD2785035-part5 /windows/E ntfs-3g defaults,locale=en_US.UTF-8 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
//192.168.18.112/realserver_netbios /root/mnt/windows/realserver_netbios cifs credentials=/root/etc/.credentials,_netdev,uid=client_user,gid=users 0 0

rebooted opened file manager saw in mounted drives //realserver_netbios/192.168.18.112

could not get access, so I opened fstab and changed it to

//192.168.18.112/realserver_netbios /mnt/windows/realserver_netbios cifs credentials=/etc/.credentials,_netdev,uid=client_user,gid=users 0 0

still couldn’t get access. Tried with

//192.168.18.112/realserver_netbios /root/mnt/windows/realserver_netbios cifs username=Yesitsme,password=WannaGetFired,_netdev 0 0

then

//192.168.18.112/realserver_netbios /mnt/windows/realserver_netbios cifs username=Yesitsme,password=WannaGetFired,_netdev 0 0

<<< One more time, IP, Net_BIOS, SHARE, USERNAME, & PASSWORD…are fake >>>

So if anyone out there can see why I am not getting access, I would really appreciate the help.

AFTER THAT

We can all go see someones website which does look really good, but posting congratulatory remarks as well as comments on geopolitics, immigration, human migration, history, economics is not appropriate for a forum for technical issues related to openSUSE.

One last time…

If anyone out there can see why I am not getting access, I would really appreciate the help. I would even appreciate it if DenverD were to put down what he was smoking, swallowing, or drinking long enough to provide a viable solution to my issue. Though this might be asking too much.

On 07/21/2011 06:16 AM, China Jobs wrote:
>
> by Deano_ferrari
> Code:
>
> //192.168.18.112/sharename /path/to/mount/ cifs
> username=Yesitsme,password=WannaGetFired,_netdev 0 0
>
> You can use the server’s name in place of the IP address if
> preferred.
>
> BTW, for security reasons, it is generally preferred to hide the
> username
> and password credentials within a read-only file, and use this form
> instead
>
> Code:
>
> //192.168.18.112/sharename /path/to/mount/ cifs
> credentials=/root/etc/.credentials,_netdev,uid=client_user,gid=users 0
> 0

The last line there is awkard
It reads credentials=/root/etc/.credentials

etc is not under /root
It is under /

So it should read credentials=/etc/.credentials

> One last time…
>
> If anyone out there can see why I am not getting access, I would really
> appreciate the help. I would even appreciate it if DenverD were to put
> down what he was smoking, swallowing, or drinking long enough to
> provide a viable solution to my issue. Though this might be asking too
> much.
>
>
I hope this is really the last time, too :slight_smile:

Now,
First:

Do you get access via filemanager with address (example):

smb://192.168.0.99/data5/downloads

This will ask for the samba user password

Once you see the contents of the remote directory we know we’re there,
that’s the path on the remote server.
Copy/paste that to avoid typos.

Make sure you have the mount point for the share in your local system.
If it’s /mnt/something,
then use /mnt/something

NOT /root/mnt/something

If your credentials file is
/etc/.credentials
THEN USE IT

DO NOT USE
/root/etc/credentials

Once you have sorted out what the real paths there are you can put
everything in /etc/fstab (in one line)

//192.168.0.99/data5 /data5/downloads cifs
credentials=/etc/.credentials,_netdev 0 0

Vahis

http://waxborg.servepics.com
openSUSE 11.2 (x86_64) 2.6.31.14-0.8-default “Evergreen” main host
openSUSE 11.4 (x86_64) 2.6.37.6-0.5-desktop in VirtualBox
openSUSE 11.4 (i586) 2.6.39.2-36-desktop “Tumbleweed” in EeePC 900

Did you see post #19 by Vahis? That explains why your first 2 fstab entry versions will not work. You’ve got a lot of learning to do by the looks… :slight_smile:
A good way to check if your fstab mounts are working is to see what is mounted as root

fdisk -l

You could also try this from a terminal as root to start with, then again as user

mount -t cifs -o username=Yesitsme,password=WannaGetFired //192.168.18.112/realserver_netbios /mnt/windows/

BTW, comment out your fstab entry while trying the latter.

Edit: I see Vahis has kindly replied to you again. Read carefully. Try mounting casually with a filemanager as her suggests. Its another good approach that I frequently use.

On 07/21/2011 08:36 AM, deano ferrari wrote:
>
> Did you see post #19 by Vahis? That explains why your first 2 fstab
> entry versions will not work. You’ve got a lot of learning to do by the
> looks… :slight_smile:
> A good way to check if your fstab mounts are working is to see what is
> mounted as root
>
> Code:
> --------------------
> fdisk -l
> --------------------

That would not show samba or nfs mounts, just the local ones i.e. devices,

but command:

mount

will show everything that is mounted.

Vahis

http://waxborg.servepics.com
openSUSE 11.2 (x86_64) 2.6.31.14-0.8-default “Evergreen” main host
openSUSE 11.4 (x86_64) 2.6.37.6-0.5-desktop in VirtualBox
openSUSE 11.4 (i586) 2.6.39.2-36-desktop “Tumbleweed” in EeePC 900

That would not show samba or nfs mounts, just the local ones i.e. devices,

but command:

mount

will show everything that is mounted.

Sorry, my mistake. I meant ‘mount’ to list mounted filesystems. (Of course, ‘fdisk’ will only show the local volume partitions available - mounted and unmounted)

On 07/21/2011 05:16 AM, China Jobs wrote:
>
> I would even appreciate it if DenverD were to put down what he was
> smoking, swallowing, or drinking long enough to provide a viable
> solution to my issue. Though this might be asking too much.

well, it wouldn’t be too much but i’ve already written in this thread:

do hope you get the answer, i can’t help on that at all…sorry (working
with Windows is not my ‘thing’…i do read some of the posts trying to
learn something, sometimes…and saw you declaration on being American,
and just wondered which)

and, btw i don’t smoke anything at all, nor swallow anything which might
impair my ability to operate either heavy equipment or a tiny keyboard…

well, i do occasionally have a glass (rarely two) of a fine wine or
premium lager with a good meal…but, unlike my younger dayz i tend to
pretty careful with the firewater also.


DD
Caveat-Hardware-Software
openSUSE®, the “German Engineered Automobiles” of operating systems!

I have been using calc to work out the lines to add in fstab. So far nothing I have tried seems to work.

>Do you get access via filemanager with address (example):

>smb://192.168.0.99/data5/downloads

Yes I do.

smb://server/yesitsme
smb://server/yesitsme/music
smb://server/yesitsme/fluffy_bunnies_with_belt_fed_shotguns

>This will ask for the samba user password

not just once, but twice

This has me annoyed. Why am I being asked twice and is this what is keeping me from my fluffy_bunnies_with_belt_fed_shotguns files.

On 07/22/2011 07:56 AM, China Jobs wrote:
>
> I have been using calc to work out the lines to add in fstab. So far
> nothing I have tried seems to work.

Calc? What is it? A calculator?

Just use an editor, like kwrite or something on what you got.

I’m using vim myself (CLI)

>
>> Do you get access via filemanager with address (example):
>
>> smb://192.168.0.99/data5/downloads
>
> Yes I do.
>
> smb://server/yesitsme
> smb://server/yesitsme/music
> smb://server/yesitsme/fluffy_bunnies_with_belt_fed_shotguns

OK. The remote directories are accessible.
>
>> This will ask for the samba user password
>
> not just once, but twice

So you connect to
smb://server/yesitsme

and get the prompt, you give the password and it comes back to ask and
you type it again?
>
> This has me annoyed. Why am I being asked twice and is this what is
> keeping me from my fluffy_bunnies_with_belt_fed_shotguns files.

I don’t understand.

It’s a sub directory of smb://server/yesitsme, right?

If you go to smb://server/yesitsme
you should be able to browse also the sub directories in the file manager.

Can you not do that?

Vahis

http://waxborg.servepics.com
openSUSE 11.2 (x86_64) 2.6.31.14-0.8-default “Evergreen” main host
openSUSE 11.4 (x86_64) 2.6.37.6-0.5-desktop in VirtualBox
openSUSE 11.4 (i586) 2.6.39.2-36-desktop “Tumbleweed” in EeePC 900

>>
>> I have been using calc to work out the lines to add in fstab. So far
>> nothing I have tried seems to work.

>Calc? What is it? A calculator?

>Just use an editor, like kwrite or something on what you got.

>I’m using vim myself (CLI)

openOffice/LibreOffice calc … excel for openOffice/LibreOffice

>and get the prompt, you give the password and it comes back to ask and
>you type it again?

Confirmed, I get asked twice for name & password

>If you go to smb://server/yesitsme
>you should be able to browse also the sub directories in the file manager.

Confirmed,

have 3 just to try and hit one.

server
SERVER
Server

On 07/22/2011 10:26 AM, China Jobs wrote:
>
>>>
>>> I have been using calc to work out the lines to add in fstab. So far
>>> nothing I have tried seems to work.
>
>> Calc? What is it? A calculator?
>
>> Just use an editor, like kwrite or something on what you got.
>
>> I’m using vim myself (CLI)
>
> openOffice/LibreOffice calc … excel for openOffice/LibreOffice

Oh. It’s a spreadsheet program. It’s not for this.
Where did you get this idea?
Use a text editor.
> …
>
>> and get the prompt, you give the password and it comes back to ask and
>> you type it again?
>
> Confirmed, I get asked twice for name& password
>
>> If you go to smb://server/yesitsme
>> you should be able to browse also the sub directories in the file
> manager.
>
> Confirmed,
>
> have 3 just to try and hit one.
>
> server
> SERVER
> Server
>
I don’t understand.
Those are different things, *nix is case sensitive.

Password is probably required twice because you are making two different
connections.

Please try to keep this as simple as possible.

Test one connection.

Your aim obviously is to get smb://server/yesitsme mounted in your file
system. Let’s keep that only in focus for now.

Remove the lines you have played with from /etc/fstab.
Reboot. Hope you still can after messing around with /etc/fstab.

Then

1.Open file manager and go to
smb://server/yesitsme

2.Browse around.
3.Copy files around.

4.Tell me what you get.

Vahis

http://waxborg.servepics.com
openSUSE 11.2 (x86_64) 2.6.31.14-0.8-default “Evergreen” main host
openSUSE 11.4 (x86_64) 2.6.37.6-0.5-desktop in VirtualBox
openSUSE 11.4 (i586) 2.6.39.2-36-desktop “Tumbleweed” in EeePC 900

On 07/22/2011 11:05 AM, Vahis wrote:
> On 07/22/2011 10:26 AM, China Jobs wrote:
>>
>>>>
>>>> I have been using calc to work out the lines to add in fstab.

<snip>
> Oh. It’s a spreadsheet program. It’s not for this.
> Where did you get this idea?
> Use a text editor.

Another word of warning:

/etc/fstab needs to be edited as root.

It’s very unwise to use any complex GUI stuff like LibreOffice as root.

If it must be GUI, command something like

kdesu kwrite /etc/fstab

That’s if you use KDE desktop.

Best thing is to use a text editor like vim whenever you edit some root
stuff.

Vahis

http://waxborg.servepics.com
openSUSE 11.2 (x86_64) 2.6.31.14-0.8-default “Evergreen” main host
openSUSE 11.4 (x86_64) 2.6.37.6-0.5-desktop in VirtualBox
openSUSE 11.4 (i586) 2.6.39.3-37-desktop “Tumbleweed” in EeePC 900

Vahis,

When editing fstab, I open terminal with superuser, so yes I edit it in root.

Before I “fix” anything, I back up whatever I intend to edit or inadvertently kill. Sometimes in 3 or 4 places. Flash sticks, D drive, on the server, as a text file .txt and or as a word doc, or whatever.

I hate to be in a situation where I have to reinstall because I decided to delete one single character, so back up before “fixing it”.

I use the spreadsheet, 1) to keep track of what I tried, and didn’t succeed on. 2) There are different possible ways to connect.

//192.168.18.112/share
//server/share

So I keep track of all the possible ways I could connect, which right now mean, which way is going to work first.

I would rather just get a permanent connection to the server only. Figuring that once I get that, I can have applications that need, to connect with applications in other folders on the server quietly connecting. This may or may not be a fantasy, but it’s a thought.

When editing of course I use a text editor. Kwrite was default in KDE so I use it. It’s not a particularly well rounded editor, but it was the default and I read in Swerdna & others, kwrite /etc/fstab so its kwrite/fstab…

I also loaded Kate. I like it better. However, it still doesn’t impress me that much that I would write anything with it. When messaging here, I write in a word processor, as I never won at the spelling contests and since living in China, I have seen far too much Chinglish to find it entertaining.

On 07/23/2011 08:36 PM, China Jobs wrote:
>
> 2) There are different possible ways to connect.
>
> //192.168.18.112/share
> //server/share

Those are both possible.
The first is by IP, the second is by name.
We’ll come back to that later.

Earlier I asked:

> If you go to smb://server/yesitsme
> >you should be able to browse also the sub directories in the file
manager.

And you replied:

Confirmed

So we can go on from there.

I’m assuming here now that the following addresses are actually the same
one directory in your server:

//192.168.18.112/share
//server/share
smb://server/yesitsme

Let’s keep it that way and only use

smb://192.168.18.112/share

as we talk about it, OK? You can go there with file manager?

>
> So I keep track of all the possible ways I could connect, which right
> now mean, which way is going to work first.

Don’t try different stuff. Let’s focus on

smb://192.168.18.112/share

>
> I would rather just get a permanent connection to the server only.

You will, within short, just follow with me precisely.

> Figuring that once I get that, I can have applications that need, to
> connect with applications in other folders on the server quietly
> connecting. This may or may not be a fantasy, but it’s a thought.

It’s not phantasy, it’s simple.
>
> When editing of course I use a text editor. Kwrite was default in KDE
> so I use it.

That’s fine. When you edit /etc/fstab you open konsole and type

kdesu kwrite /etc/fstab

You give root password and you’re in business.
>
> I also loaded Kate. I like it better.

That’s just fine, too. Let’s use kwrite for now.

> When
> messaging here, I write in a word processor, as I never won at the
> spelling contests and since living in China, I have seen far too much
> Chinglish to find it entertaining.

Whatever. An editor is an editor. Or a word processor it you like.

Anyways, let’s try this now:

You can connect via file manager to

smb://192.168.18.112/share

Are we cool so far?

Then:

Make a directory in your /home like

/testdir

The full path to that is then:
/home/you/testdir

Then:

You make a file /etc/.credentials.
Command:

kdesu kwrite /etc/.credentials

type there:

username=yourname
password=yourpw

Use the real ones there and save the file.

Then you open /etc/fstab:

kdesu kwrite /etc/fstab

and make a (one) line there at the bottom:

//192.168.18.112/share /home/you/testdir cifs
credentials=/etc/.credentials,_netdev 0 0

Then, as root:

mount -a

What do you get after all this?

Then, in file manager, go to home/testdir
What can you see?

Go through these steps, note any problems and come back, OK?

Vahis

http://waxborg.servepics.com
openSUSE 11.2 (x86_64) 2.6.31.14-0.8-default “Evergreen” main host
openSUSE 11.4 (x86_64) 2.6.37.6-0.5-desktop in VirtualBox
openSUSE 11.4 (i586) 2.6.39.3-37-desktop “Tumbleweed” in EeePC 900

/etc/fstab

//192.168.18.119/Newtgingrich //smb://192.168.18.119/Newtgingrich/republicans/1d10ts cifs credentials=/root/etc/.creds,_netdev 0 0

/etc/.creds

username=Newtgingrich
password=Gurs9sa

mount -a

solutions:~ # mount -a
Couldn’t chdir to //smb://192.168.18.119/Newtgingrich/republicans/1d10ts: No such file or directory

Konqueror

/smb:/192.168.18.119/Newtgingrich/republicans/1d10ts

Dolphin

smb://Newtgingrich@crussell-server/Newtgingrich/4prezadent/1d10ts/