LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-02-2008, 02:52 PM   #1
Rostfrei
Member
 
Registered: Aug 2005
Location: Slovenia
Distribution: Fedora, Ubuntu
Posts: 69

Rep: Reputation: 15
Problem with mounting CIFS from /etc/fstab


Hello!

I have the following entry in the /etc/fstab, because I want to automatically mount windows share at boot:

Code:
//ubunturouter/download /home/someuser/mnt/download        cifs    defaults,rw,user=someuser,pass=somepass,uid=someuser,gid=somegroup 0       0
I have the problem that it doesn't mount at boot time. Why not? Doesn't entries in fstab get mounted at boot automatically?

If I execute the command

Code:
sudo mount mnt/download/
from the shell, cifs is mounted without any problems.

Regards,
 
Old 06-02-2008, 03:54 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Maybe the startup routine executes mount -a before Samba is started. Check the system log using dmesg.
 
Old 06-02-2008, 03:55 PM   #3
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,476

Rep: Reputation: 156Reputation: 156
Your problem probably has to do with the order that partitions are mounted in /etc/fstab. Could you post your entire /etc/fstab.

--------------------
Steve Stites
 
Old 06-02-2008, 04:12 PM   #4
Rostfrei
Member
 
Registered: Aug 2005
Location: Slovenia
Distribution: Fedora, Ubuntu
Posts: 69

Original Poster
Rep: Reputation: 15
My entire /etc/fstab

Code:
>cat /etc/fstab 
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sdb1
UUID=2917508b-9ade-4cec-ba03-4a62bae5322c /               ext3    defaults,errors=remount-ro 0       1
# /dev/sdb3
UUID=51f1e66e-e6e6-4258-b7aa-d955ce47b5bc /home           ext3    defaults        0       2
# /dev/sda1
UUID=4224E4D124E4C8CD /media/sda1     ntfs    defaults,umask=007,gid=46 0       1
# /dev/sda2
UUID=44E0A41FE0A41966 /media/sda2     ntfs    defaults,umask=007,gid=46 0       1
# /dev/sdc1
UUID=0CE4D607E4D5F2C6 /media/sdc1     ntfs    defaults,umask=007,gid=46 0       1
# /dev/sdb2
UUID=b31e235a-1cca-499a-983d-49975327ac19 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec 0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec 0       0
//ubunturouter/download /home/bob/mnt/download        cifs    defaults,rw,user=bob,pass=xxxxx,uid=bob,gid=bob
I added the following line to the /etc/rc.local and now it works

Code:
>cat /etc/rc.local 
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.


# Mount all mounts that are not already mounted at boot process (CIFS mounts)
mount -a

exit 0
But I don't like it as it is just a fix for something that should already work.

I checked dmesg log, but I just don't see anything suspicious.
 
Old 06-02-2008, 04:51 PM   #5
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,476

Rep: Reputation: 156Reputation: 156
You are mounting the partitions in the wrong order. You are mounting /home on pass 2 and you are mounting /home/someuser/mnt/download on pass 0. When you try to mount /home/someuser/mnt/download /home has not been mounted yet so it is impossible to mount /home/someuser/mnt/download.

mount -a works because at that point /home has already been mounted and /home/someuser/mnt/download can be mounted.

Add a pass number of 3 to the /home/bob/mnt/download and it should work without needing the mount -a

//ubunturouter/download /home/bob/mnt/download cifs defaults,rw,user=bob,pass=xxxxx,uid=bob,gid=bob 1 3

----------------------
Steve Stites

Last edited by jailbait; 06-02-2008 at 04:52 PM.
 
Old 06-03-2008, 01:00 PM   #6
Rostfrei
Member
 
Registered: Aug 2005
Location: Slovenia
Distribution: Fedora, Ubuntu
Posts: 69

Original Poster
Rep: Reputation: 15
I tried your suggestion, but it does not have any effect at all. It still doesn't mount at boot.

I also don't understand about "passing order" at boot time you were talking about. A fstab manual says

Quote:
The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is
returned and dump will assume that the filesystem does not need to be dumped.

The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a
fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the
same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not
need to be checked.
So I don't see any meaning of last two fields used in boot order. One is used by dump and the other by fsck utility which just checks the disk integrity.

Regards,
 
Old 06-03-2008, 02:47 PM   #7
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,476

Rep: Reputation: 156Reputation: 156
Quote:
Originally Posted by Rostfrei View Post

I tried your suggestion, but it does not have any effect at all. It still doesn't mount at boot.

I also don't understand about "passing order" at boot time you were talking about. A fstab manual says



So I don't see any meaning of last two fields used in boot order. One is used by dump and the other by fsck utility which just checks the disk integrity.

Regards,
Mount tries to mount every entry in fstab simultaneously. That won't work when the mounts are dependent on each other. So the last number groups mounts into the order in which to mount. You need to mount /, /home, and /home/bob/mnt/download in that order. Your original fstab said to mount / and /home/bob/mnt/download simultaneously and then mount /home later. By changing the /home/bob/mnt/download to pass 3 then you should mount /, /home, and /home/bob/mnt/download in that order.

That was definitely a problem with your fstab. If fstab still doesn't work then there must be some additional problem that I don't see.

-----------------------
Steve Stites
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cifs in fstab and lethargic shutdown/reboot litlmary Linux - Networking 3 02-10-2010 02:32 AM
Fedora 7 and using cifs in fstab? powellbob424 Linux - General 11 06-16-2007 08:20 PM
cifs mount in fstab help nitrohuffer2001 Linux - Software 1 04-22-2007 05:09 PM
Mounting windows share via cifs (fstab entry) - error 13 opening credentials file O(V)eGA_l2el) Linux - Networking 2 12-05-2006 11:22 AM
CIFS Mounting Problem victorhe Linux - Networking 0 03-29-2004 12:49 PM


All times are GMT -5. The time now is 12:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration