[SOLVED] Mounting: no such device
Re: [SOLVED] Mounting: no such device
I don`t know what is the reason. I just guess. Here is no checks is network up or not. As wifi require some time, then at the moment tv gets dhcp and wifi connection our scripts are finished with their job.
Seting IP manually saves few seconds and perhaps we`re lucky enough?
Telnet starts very early - it is almost first service. Don`t know why does it work but samba not. Need to troubleshoot and check. step by step.
Actually telnet starts on TV`s 23 port and it doesn`t need any IP for it. You need have network to connect, but not vice versa. If here is no network on TV, telnet service still runs and as soon you connect cable you can use telnet.
Am i wrong? Can be, but hope not.
Seting IP manually saves few seconds and perhaps we`re lucky enough?
Telnet starts very early - it is almost first service. Don`t know why does it work but samba not. Need to troubleshoot and check. step by step.
Actually telnet starts on TV`s 23 port and it doesn`t need any IP for it. You need have network to connect, but not vice versa. If here is no network on TV, telnet service still runs and as soon you connect cable you can use telnet.
Am i wrong? Can be, but hope not.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]
DO NOT EVER INSTALL FIRMWARE UPGRADE
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]
DO NOT EVER INSTALL FIRMWARE UPGRADE
Re: [SOLVED] Mounting: no such device
Yes you are right, telnet server can start without network. Ok then I don't know but would like to know what part of samba.init needs the network so that manual mounts will work later, when the network definitely is up.
Anyway, this discussion made me go back to my C series, which used to use the wifi dongle that now is on my E series. The C series used wired, dhcp. I updated samba.init as my NAS details changed and it works automatically! So no longer need the manual macro on the C series!
Tomorrow, on the E series, I'll test the fixed IP and if that doesn't work I'll test wired. But it doesn't matter if neither test works as a manual telnet macro will be fine.
So just to end now and be very clear. A BIG THANK YOU to you juuso. You helped me get samba on E series, and automatic samba on C series. The day ends well.
Anyway, this discussion made me go back to my C series, which used to use the wifi dongle that now is on my E series. The C series used wired, dhcp. I updated samba.init as my NAS details changed and it works automatically! So no longer need the manual macro on the C series!
Tomorrow, on the E series, I'll test the fixed IP and if that doesn't work I'll test wired. But it doesn't matter if neither test works as a manual telnet macro will be fine.
So just to end now and be very clear. A BIG THANK YOU to you juuso. You helped me get samba on E series, and automatic samba on C series. The day ends well.
Re: [SOLVED] Mounting: no such device
You can add function like this:
to wait network up to 30 sec (or how long do you want)
Like here:
Code: Select all
wait_network ()
{
#Wait for network
x=1
y=30 #seconds to wait
while [ $x -le $y ]; do
if [ "$(route -n | grep -c UG)" -lt 1 ] ; then # you can use here ping to your router or NAS
sleep 1
x=$(( $x + 1 ))
echo "SamyGO: wait for network: $x"
else
echo "SamyGO: network OK"
break
fi
done
}
Like here:
SpoilerShow
Code: Select all
#!/bin/sh
#
# ? Copyright 1996-2010, ZsoltTech.Com
# by Ser Lev Arris <arris@ZsoltTech.Com>
#
# donated for the SamyGo Project
# http://samygo.sourceforge.net/
#
# Version: SamyGO svn $Id: 04_04_samba.init 1069 2011-01-03 16:47:24Z arris69 $
#
. /dtv/SGO.env
# sleep 9
##### CHANGE MEEEEE !!!!! ######
USER=""
PASSWD=""
PERM="rw" # can be ro or rw
##### CHANGE MEEEEE END ######
[ -e /mtd_rwarea/smb_userdata ] && source /mtd_rwarea/smb_userdata
[ -z $USER ] && exit 1 #comment this out if no user
[ -z $PASSWD ] && exit 1 #comment this out if no password or empty
DEST_DIR=$MOUNT_PATH/smb
SERVER=""
# SERVER="10.0.0.1" # if you want a fixed server
SHARES=""
FR_NAME="Samba Server"
# M_OPTS="rw,user=${USER},password=${PASSWD}"
M_OPTS="$PERM,user=${USER},password=${PASSWD},codepage=cp1250,iocharset=utf8"
SERVERS="Don't set me!!"
do_mount()
{
# $(echo -e "[sdh]\nVendor : CifsMount\nProduct : $FR_NAME\n\
#Serial : Q80VQLFH\nDevpath : 8\nLun : 0\nMountDir : $DEST_DIR\nFileSystem : vfat\n" >> /dtv/usb/log)
for i in $S_MOUNTS ; do
i="$(echo -n $i | sed -e 's/SGOspace/ /g')"
M_POINT="$DEST_DIR/$1/$(echo -n $i | sed -e "s/\\\$/_/g")"
mkdir -p "$M_POINT"
if [ `cat /proc/mounts | grep -c "$M_POINT"` -lt "1" ] ; then
/bin/busybox mount -o "${M_OPTS}" -t cifs "//$1/$i" "$M_POINT"
else
echo "$M_POINT is mounted!"
fi
done
}
get_shares()
{
echo "Search Shares"
for i in $SERVERS ; do
echo "on: $i"
S_MOUNTS=$(smbclient -s "$SYSROOT/etc/samba/smb.conf" -U ${USER}%${PASSWD} \
-g -L $i | grep "Disk|" | grep -v "\\$" | grep -v " Service" | sed -r 's/.*\|(.*)\|.*/\1/' | sed -r 's/ /SGOspace/g')
# -g -L $i | grep "Disk|" | grep -v "\\$" | grep -v " Service" | cut -d "|" -f2)
[ -n "$S_MOUNTS" ] && do_mount $i
done
}
get_servers()
{
if [ -z "$SERVER" ] ; then
# SERVERS=$(cat /proc/net/arp | grep -v "IP address" | cut -d " " -f1)
SERVERS=$(cat /proc/net/arp | grep -v "IP address" | sed 's/^\(\w*.\w*.\w*.\w*\) *.*/\1/')
else
SERVERS=$SERVER
fi
}
wait_network ()
{
#Wait for network
x=1
y=30 #seconds to wait
while [ $x -le $y ]; do
if [ "$(route -n | grep -c UG)" -lt 1 ] ; then
sleep 1
x=$(( $x + 1 ))
echo "SamyGO: wait for network: $x"
else
echo "SamyGO: network OK"
break
fi
done
}
case $1 in
start)
insmod $MOD_DIR/kernel/fs/cifs/cifs.ko
mkdir -p "$DEST_DIR"
wait_network # needed for wireless connection
get_servers
get_shares
;;
stop)
# may can fail if device access the mount from content library
# for i in $(cat /proc/mounts | grep cifs | cut -d " " -f2) ; do
for i in $(cat /proc/mounts | grep cifs | grep "$DEST_DIR" | sed 's/^\(.*\) \(.*\) cifs .*/\2/') ; do
i="$(echo -n $i | sed -r 's/\\040/ /g')"
/bin/busybox umount "$i"
done
;;
status)
/bin/mount | grep "$DEST_DIR"
;;
*)
echo "Usage: $0 {start|stop}" 1>&2
exit 0
;;
esac
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]
DO NOT EVER INSTALL FIRMWARE UPGRADE
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]
DO NOT EVER INSTALL FIRMWARE UPGRADE
Re: [SOLVED] Mounting: no such device
Ok, perhaps I am answering my own question partly here.
I went through samba.init (and remember I don't need any servers or shares searching as I manually mount).
I could not find anything that needs the network except:
insmod $MOD_DIR/kernel/fs/cifs/cifs.ko
which I do not know what it does, or if it needs the network. I'm guessing the mount command needs this to work. But does this need the network to execute???
Later I see: mkdir -p "$DEST_DIR"
And this smb directory IS created on the virtual USB so samba.init IS executing.
So now off to google cifs.ko.
But if that line needs the network to execute else it does 'work' then yes, it could be a lack of network that stops my mounts. And explains why, if I run samba.init again after the network is up, the mount command works.
I went through samba.init (and remember I don't need any servers or shares searching as I manually mount).
I could not find anything that needs the network except:
insmod $MOD_DIR/kernel/fs/cifs/cifs.ko
which I do not know what it does, or if it needs the network. I'm guessing the mount command needs this to work. But does this need the network to execute???
Later I see: mkdir -p "$DEST_DIR"
And this smb directory IS created on the virtual USB so samba.init IS executing.
So now off to google cifs.ko.
But if that line needs the network to execute else it does 'work' then yes, it could be a lack of network that stops my mounts. And explains why, if I run samba.init again after the network is up, the mount command works.
Re: [SOLVED] Mounting: no such device
Stop confusing yourself. Check my suggestion first.
network is needed by functions get_servers and get_shares where they search for network computers and shares. cifs.ko is module for kernel. Discussion this kind is obsolete off topic here, you can inform you about networking services on google.
network is needed by functions get_servers and get_shares where they search for network computers and shares. cifs.ko is module for kernel. Discussion this kind is obsolete off topic here, you can inform you about networking services on google.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]
DO NOT EVER INSTALL FIRMWARE UPGRADE
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]
DO NOT EVER INSTALL FIRMWARE UPGRADE
Re: [SOLVED] Mounting: no such device
You misunderstand me. I don't need get servers or get shares for a manual mount! That's not my problem.
This is not off topic. If cifs.ko needs the network up to load properly then if the network is not up it will not load.
Then later when I try to manually mount using -t cifs of course it won't work. Cifs.ko is not loaded!
When I then run samba.init again, this time cifs.ko gets loaded and the manual mount works.
I only noticed this because I manually mount but for people who JUST use the samba.init file they would never notice. They would have empty smb directory for ever because their network didn't start in time. Seems very on topic.
So can you confirm if cifs.ko needs a network up to load?
This is not off topic. If cifs.ko needs the network up to load properly then if the network is not up it will not load.
Then later when I try to manually mount using -t cifs of course it won't work. Cifs.ko is not loaded!
When I then run samba.init again, this time cifs.ko gets loaded and the manual mount works.
I only noticed this because I manually mount but for people who JUST use the samba.init file they would never notice. They would have empty smb directory for ever because their network didn't start in time. Seems very on topic.
So can you confirm if cifs.ko needs a network up to load?
Re: [SOLVED] Mounting: no such device
Ok easy to test my theory.
Tomorrow when I start the TV and telnet in I can run lsmod and see if cifs is loaded.
If no then that explains why mount doesn't work.
If yes, then...don't know but I don't think it will be yes.
Tomorrow when I start the TV and telnet in I can run lsmod and see if cifs is loaded.
If no then that explains why mount doesn't work.
If yes, then...don't know but I don't think it will be yes.
Re: [SOLVED] Mounting: no such device
I couldn't wait to test. Went to bedroom, started TV, waited for virtual USB.
I telnet in (network working).
Ran lsmod
NO cifs module loaded.
Ran samba.init again
Ran lsmod
YES cifs module loaded
So finally the real answer to my original topic question is that manual mounts do not work because cifs.ko is not loading (probably because network is not up).
So even if I set samba.init with servers and shares it still would not work!
Running lsmod might be a simple but useful debugging idea for all people on this forum who get empty smb folder (not just waiting for many minutes).
If they don't see cifs.ko loaded they can wait for ever. It won't be their widget or their samba.init but could just be a slower network start up.
I love lsmod now and I hope this helps others.
I telnet in (network working).
Ran lsmod
NO cifs module loaded.
Ran samba.init again
Ran lsmod
YES cifs module loaded
So finally the real answer to my original topic question is that manual mounts do not work because cifs.ko is not loading (probably because network is not up).
So even if I set samba.init with servers and shares it still would not work!
Running lsmod might be a simple but useful debugging idea for all people on this forum who get empty smb folder (not just waiting for many minutes).
If they don't see cifs.ko loaded they can wait for ever. It won't be their widget or their samba.init but could just be a slower network start up.
I love lsmod now and I hope this helps others.
Re: [SOLVED] Mounting: no such device
You`re right saying that no mount if no module loading, but you`re wrong saying that network is needed to load module. For me it is important why module does not load for first try, because network is not needed at all to load kernel modules. As insurance you could add
to your script.
Like here:
Code: Select all
if [ `lsmod | grep -c "cifs"` -lt "1" ] ; then
insmod $MOD_DIR/kernel/fs/cifs/cifs.ko || echo "loading cifs.ko failed" >> $LOGFILE
fi
Like here:
SpoilerShow
Code: Select all
#!/bin/sh
#
# ? Copyright 1996-2010, ZsoltTech.Com
# by Ser Lev Arris <arris@ZsoltTech.Com>
#
# donated for the SamyGo Project
# http://samygo.sourceforge.net/
#
# Version: SamyGO svn $Id: 04_04_samba.init 1069 2011-01-03 16:47:24Z arris69 $
#
. /dtv/SGO.env
# sleep 9
##### CHANGE MEEEEE !!!!! ######
USER=""
PASSWD=""
PERM="rw" # can be ro or rw
##### CHANGE MEEEEE END ######
insmod $MOD_DIR/kernel/fs/cifs/cifs.ko
[ -e /mtd_rwarea/smb_userdata ] && source /mtd_rwarea/smb_userdata
[ -z $USER ] && exit 1 #comment this out if no user
[ -z $PASSWD ] && exit 1 #comment this out if no password or empty
DEST_DIR=$MOUNT_PATH/smb
SERVER=""
# SERVER="10.0.0.1" # if you want a fixed server
SHARES=""
FR_NAME="Samba Server"
# M_OPTS="rw,user=${USER},password=${PASSWD}"
M_OPTS="$PERM,user=${USER},password=${PASSWD},codepage=cp1250,iocharset=utf8"
SERVERS="Don't set me!!"
do_mount()
{
# $(echo -e "[sdh]\nVendor : CifsMount\nProduct : $FR_NAME\n\
#Serial : Q80VQLFH\nDevpath : 8\nLun : 0\nMountDir : $DEST_DIR\nFileSystem : vfat\n" >> /dtv/usb/log)
for i in $S_MOUNTS ; do
i="$(echo -n $i | sed -e 's/SGOspace/ /g')"
M_POINT="$DEST_DIR/$1/$(echo -n $i | sed -e "s/\\\$/_/g")"
mkdir -p "$M_POINT"
if [ `cat /proc/mounts | grep -c "$M_POINT"` -lt "1" ] ; then
/bin/busybox mount -o "${M_OPTS}" -t cifs "//$1/$i" "$M_POINT"
else
echo "$M_POINT is mounted!"
fi
done
}
get_shares()
{
echo "Search Shares"
for i in $SERVERS ; do
echo "on: $i"
S_MOUNTS=$(smbclient -s "$SYSROOT/etc/samba/smb.conf" -U ${USER}%${PASSWD} \
-g -L $i | grep "Disk|" | grep -v "\\$" | grep -v " Service" | sed -r 's/.*\|(.*)\|.*/\1/' | sed -r 's/ /SGOspace/g')
# -g -L $i | grep "Disk|" | grep -v "\\$" | grep -v " Service" | cut -d "|" -f2)
[ -n "$S_MOUNTS" ] && do_mount $i
done
}
get_servers()
{
if [ -z "$SERVER" ] ; then
# SERVERS=$(cat /proc/net/arp | grep -v "IP address" | cut -d " " -f1)
SERVERS=$(cat /proc/net/arp | grep -v "IP address" | sed 's/^\(\w*.\w*.\w*.\w*\) *.*/\1/')
else
SERVERS=$SERVER
fi
}
wait_network ()
{
#Wait for network
x=1
y=30 #seconds to wait
while [ $x -le $y ]; do
if [ "$(route -n | grep -c UG)" -lt 1 ] ; then
sleep 1
x=$(( $x + 1 ))
echo "SamyGO: wait for network: $x"
else
echo "SamyGO: network OK"
break
fi
done
}
case $1 in
start)
if [ `lsmod | grep -c "cifs"` -lt "1" ] ; then
insmod $MOD_DIR/kernel/fs/cifs/cifs.ko || echo "loading cifs.ko failed" >> $LOGFILE
fi
mkdir -p "$DEST_DIR"
wait_network # needed for wireless connection
get_servers
get_shares
;;
stop)
# may can fail if device access the mount from content library
# for i in $(cat /proc/mounts | grep cifs | cut -d " " -f2) ; do
for i in $(cat /proc/mounts | grep cifs | grep "$DEST_DIR" | sed 's/^\(.*\) \(.*\) cifs .*/\2/') ; do
i="$(echo -n $i | sed -r 's/\\040/ /g')"
/bin/busybox umount "$i"
done
;;
status)
/bin/mount | grep "$DEST_DIR"
;;
*)
echo "Usage: $0 {start|stop}" 1>&2
exit 0
;;
esac
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]
DO NOT EVER INSTALL FIRMWARE UPGRADE
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]
DO NOT EVER INSTALL FIRMWARE UPGRADE
Re: [SOLVED] Mounting: no such device
I rechecked and I was premature to say smb dir is created.
So no cifs.ko loaded, no mkdir smb
What could both these commands to not happen?
samba.init not executed at startup?
Case statement not executed?
But after telneting the same script executes fine.
mystery....
So no cifs.ko loaded, no mkdir smb
What could both these commands to not happen?
samba.init not executed at startup?
Case statement not executed?
But after telneting the same script executes fine.
mystery....