Forum
fstab mount on reboot not working - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: fstab mount on reboot not working (/thread-1970.html)

Pages: 1 2


fstab mount on reboot not working - stumax - 5th Jan, 2014 06:28 AM

Hi,

I'm trying to configure Transmission to download to a drive connected to my router as a NAS.

The router is a Huawei HG533 , it has some basic samba config available you can create user accounts and set them as read only or read/write also set the root folder for the user ... There's no options for a guest account or much else.

So after much reading and playing about I have the set up half working. (users and passwords have been ****'d out for obvious reasons)

To get the drive mounted manually this works, although it does prompt for a password afterwards -
Code:
sudo mount -t cifs //192.168.1.1/router /mnt/router -o user=******

So I added this to fstab to match the above
Code:
//192.168.1.1/router /mnt/router cifs username=******,password=****** 0  0

I had a few problems getting the drive to mount under xbian, one thing I have found is that it appears that you MUST include the domain parameter in the fstab file..

I have added this to /etc/fstab

Code:
//192.168.1.1/router /mnt/router cifs username=******,password=******,domain=WORKGROUP 0 0

Then I run -
Code:
sudo mount -a

It mounts fine , but on reboot it doesn't mount at all !

Anyone know of a fix for this ?

Thanks,
Stu


RE: fstab mount on reboot not working - mk01 - 7th Jan, 2014 07:45 PM

@stumax

edit /etc/init/xbian-net.conf and take this first lines:

Code:
#!upstart

start on ………….
stop on started xbian-net and (net-device-up and (started gssd and started idmapd or started statd) or xbian-nowait)

change to:
("………" just means whatever is there, keep "start on" as is - important is change "stop on …." to "stop on started xbian-net")

Code:
#!upstart

start on ………….
stop on started xbian-net

report back.


RE: fstab mount on reboot not working - stumax - 7th Jan, 2014 08:11 PM

Thanks mk01, I'll give this a try this evening and let you know how I get on !
Stu


RE: fstab mount on reboot not working - stumax - 8th Jan, 2014 07:40 AM

Hi mk01,

Unfortunatlely it didn't do the trick Sad

So the first few lines of xbian-net.conf looks like so, is this what you meant ?

Code:
#!upstart

nice -4

start on mountall
task

in fstab I have -
Code:
//192.168.1.1/router /mnt/router cifs username=******,password=******,domain=WORKGROUP 0 0

Thanks,
sTu


RE: fstab mount on reboot not working - mk01 - 8th Jan, 2014 08:55 AM

realized just now, updated the post

how I wrote it at first will not change the logic (to start and then stop). now should be ok.


RE: fstab mount on reboot not working - stumax - 8th Jan, 2014 11:47 PM

Hi mk01,

OK so now I have -

Code:
#!upstart

nice -4

start on mountall
stop on started xbian-net

Same result on boot i'm afraid (not mounting)!

Thanks,
Stu


RE: fstab mount on reboot not working - mk01 - 9th Jan, 2014 04:24 AM

ok, can you post to pastebin:

Code:
cat /run/upstart-ev.log

tail /var/log/upstart/xbian-net.log

also what happens if you do from command line:
Code:
sudo mount -avs -t cifs



RE: fstab mount on reboot not working - Enferax - 9th Jan, 2014 05:02 AM

Hi there,

my results: pastebin

Just for your info, the harddrives weren't in any form of sleep state so this doesn't seem to be a problem.


RE: fstab mount on reboot not working - mk01 - 9th Jan, 2014 05:09 AM

ok, got the point

change "stop on started xbian"

to

Code:
stop on started xbian-net and (net-device-up IFACE!=lo or xbian-nowait)



RE: fstab mount on reboot not working - Enferax - 9th Jan, 2014 07:49 PM

Hi mk01,

seems like it's still not working. I get the same errors on nzbget.

Here's the logs from the three commands. pastebin


RE: fstab mount on reboot not working - mk01 - 9th Jan, 2014 08:20 PM

can you please post your xbian-update version ? i will check the source as original B2 was a bit different than i'm testing on.

and yes, the mount.nfs output "nothing was mounted" is confusing, but it because current "new" linux implementation joined nfs4 and nfs2/3 under one helper so as you use mount -a -t nfs it actually runs two programs, one for nfs4 and second for nfs2/3 . of course one will report failure, second one will succeeded . people programming it should be sometimes think rather twice (btw: me too Smile) )

or maybe to speed this up - can you replace your /etc/init/xbian-net.conf with this content?

Code:
#!upstart

start on started xbian-run
stop on started xbian-net and (net-device-up IFACE!=lo or xbian-nowait)

nice -6

pre-start script
    splash --msgtxt="configuring network..." --percentage
    net="$(printf "%b" "$(ip a | grep "state UP" | awk -F': ' '{print $2}')\n$(ifquery -la | grep -vw lo)\neth0" | sort | uniq)"
    for i in $net; do start -q network-interface INTERFACE=$i IFACE=$i || :; done
end script

post-stop script
    timeout 20 sh -c "while true; do timeout -k 15 -s 9 10 mount -avs -t nfs4,nfs,cifs -o wsize=65536,rsize=262144 && break; done"
    [ $? -ne 124 ] || mount -aFs -t nfs4,nfs,cifs &
    exit 0
end script



RE: fstab mount on reboot not working - Enferax - 9th Jan, 2014 08:39 PM

Looks like editing it broke my setup. At least it doesn't come up again. Have to investigate further by the time i get home.


RE: fstab mount on reboot not working - mk01 - 9th Jan, 2014 08:58 PM

ok now I have the feeling we are hitting two problems one maybe solved masked by the other.
can you refer to this post ?

and the linked link http://forum.xbian.org/thread-1770-post-19570.html#pid19570

(if you have "nfs" type in fstab, the new joined mount helper is trying nfs4 first. unfortunately under some conditions can't fallback correctly. according to the last changes in man pages around nfs, stating the vers= is highly recommended).


RE: fstab mount on reboot not working - stumax - 10th Jan, 2014 01:12 AM

Thanks for the updates .. I won't get chance to test this until tomorrow evening. I'll let you know how I get on!

Cheers,
Stu


RE: fstab mount on reboot not working - Enferax - 10th Jan, 2014 03:34 AM

So finnaly got my fingers on the box.

Adding vers=3 to the options in the fstab finally worked.

If I would have started xbian while watching the output on the screen and comparing it to the logs on the nas would have showed me 2 things:

1. Xbian isn't going through its "normal" routine. It stops at the login prompt only to start xbmc after the internal timer counted down
2. There was no attempt to mount an nfs share in the logs of the nas

Btw, I am back to the "old" Version of the xbian-net.conf


Thanks for your help and your hard work for xbian.