LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't get mount to work in /etc/init.d/rc.local or fstab (https://www.linuxquestions.org/questions/linux-newbie-8/cant-get-mount-to-work-in-etc-init-d-rc-local-or-fstab-819151/)

Bozrdang 07-10-2010 09:53 PM

Can't get mount to work in /etc/init.d/rc.local or fstab
 
I'm running XBMC media center which is built on Ubuntu and I'm trying to mount a network share, but I can't seem to automate it. If I manually run:

Code:

mount -t cifs -o file_mode=0777,dir_mode=0777 //192.168.1.20/disk7/xbmc_thumbs/Thumbnails  /home/kevin/.xbmc/userdata/Thumbnails
The mount is created and everything works fine. But obviously the mount eill be lost on the next boot. A few months back, when I was running a previous version of XBMC and first instructed on how to do this, I was told to put that command in /etc/init.d/rc.local so the mount would automatically be created at boot. I did and it worked.

The other day I upgraded to a new XBMC build (which is built on the newer Lucid Ubuntu) and while the same command creates the mount, putting it in /etc/init.d/rc.local does not create it on boot. Someone suggested the fstab was the better place to create the mount. So I inserted the following in /etc/fstab:

Code:

//192.168.1.20/disk7/XBMC_thumbs/Thumbnails    /home/kevin/.xbmc/userdata/Thumbnails  cifs    file_mode=0777,dir_mode=0777 0 0
That doesn't work either. What am I doing wrong and how can I get this mount auto-created on boot?

smoker 07-11-2010 06:06 AM

When booting, fstab is read before the network is up. You can't mount a network share until the network is working, so you have to delay the mounting using _netdev
See this post.

Bozrdang 07-11-2010 12:40 PM

That didn't work either. Here is my fstab after adding _netdev (it's the last line):

Code:

kevin@XBMCLive:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    nodev,noexec,nosuid 0      0
# / was on /dev/sda1 during installation
UUID=7b446e3a-7a26-4a0d-bd96-d350956cb05e /              ext4    errors=remount-ro 0      1
# swap was on /dev/sda5 during installation
UUID=213a9296-5449-4f28-a912-704e5999b504 none            swap    sw              0      0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0      0
# Mount for central thumbnail cache for XBMC
//192.168.1.20/disk7/xmbc_thumbs/Thumbnails  /home/kevin/.xbmc/userdata/Thumbnails  cifs  _netdev,file_mode=0777,dir_mode=0777 0 0


Bozrdang 07-15-2010 07:37 PM

Nobody has any other ideas on this?

schneidz 09-01-2010 10:09 AM

um, for my xbmc-live i put this in /etc/rc.local
Code:

sshfs schneidz@192.168.1.25:/media/win/stuff /home/xbmc/hyper &


All times are GMT -5. The time now is 10:06 AM.