Optware on CIFS - Partition in a file (loop device)

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
newsboost
DD-WRT User


Joined: 05 Jul 2018
Posts: 83

PostPosted: Mon Aug 13, 2018 10:42    Post subject: Optware on CIFS - Partition in a file (loop device) Reply with quote
Hi all,

For several hours this week, I've been trying to mount a loop device/file, but I cannot succeed. I've googled and searched, but most of the information about this topic is really old. The motivation is that I prefer to have /opt as a loop device, mounted over network (to my NAS), as I think it's more stable than a USB and when I take backups of the NAS I have the router /opt-partition as well. My config:

Router: Netgear R7000
Firmware: DD-WRT v3.0-r36440M kongac (07/30/1Cool
Kernel: Linux 4.4.145 #588 SMP Mon Jul 30 22:02:17 CEST 2018 armv7l
Reset: I did "erase nvram && reboot"

So basically I'm following the guide here:
https://wiki.dd-wrt.com/wiki/index.php/Optware#Optware_on_CIFS_-_Partition_in_a_file - however it looks like it hasn't been updated since 2010. I have a startup-script that works under /jffs which does:
Code:
mount.cifs  //machine/Netgear_R7000_DDWRT /mnt/smbshare/ -o user=user,password=pass

So there's my CIFS-share. Within /mnt/smbshare I have an ext4-file/loop device, but I cannot mount it:
Code:
mount -t ext4 opt_ext4.fs /mnt/opt/
mount: can't setup loop device: No such file or directory
Here's something from 2008: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=43508&sid=1ce767a08302fa6d615b97b28ae4e88e, it says I have to install ipkg. But I want to mount the loop device before installing opkg/optware/entware so I can keep everything under /opt instead of using the router's limited flash memory. I tried insmod loop.ko and other things (e.g.
https://oxavelar.wordpress.com/2013/12/27/mounting-ext4-partitions-in-dd-wrt/), but with no luck, I couldn't insmod those modules and thought it was a bit unsafe to download *.ko-files from the internet, at least without asking here first for advice. I cannot understand if I'm really forced to use a USB (I hope not) instead of network+loop device? Enabling the USB-stuff from the web-if doesn't seem to make a difference...

I hope somebody knows the answer and why it keeps saying "mount: can't setup loop device", I would be grateful for that, thanks!
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Mon Aug 13, 2018 12:28    Post subject: Reply with quote
I have no experience with this, so maybe not very helpfull, but there is a wiki about Samba: https://wiki.dd-wrt.com/wiki/index.php/Samba_filesystem

Furthermore optware is replaced by entware.
Kong has a special command "bootstrap" to get it
So if you want to get entware you can do the follwowing from CLI (I am no expert on Entware) :
Code:
bootstrap
opkg update
opkg upgrade

to list the packages:
Code:
opkg list


Depending on the packages do not forget to initializes the packages, put the follwing code in Administration/Commands save as startup:
Code:
sleep 10
/opt/etc/init.d/rc.unslung start


Sorry i can not help you any further

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
newsboost
DD-WRT User


Joined: 05 Jul 2018
Posts: 83

PostPosted: Mon Aug 13, 2018 12:50    Post subject: Reply with quote
egc wrote:
I have no experience with this, so maybe not very helpfull, but there is a wiki about Samba: https://wiki.dd-wrt.com/wiki/index.php/Samba_filesystem

Furthermore optware is replaced by entware.
Kong has a special command "bootstrap" to get it
Well, Samba/CIFS is not the problem. I've already mounted the SMB/CIFS share inside /mnt/smbshare. I know about "bootstrap", but I do not want to install it directly on the CIFS-mount. I prefer creating a loop device (ext3/ext4) and mounting that as /opt. Once this works, I'll install opkg/entware inside /opt. But it doesn't work. And that is the problem (the error: "mount: can't setup loop device: No such file or directory" - why?)...

It didn't help what you wrote, I think you maybe didn't see that mounting the loop-device (I prefer ext3/ext4) is what failed, for an unknown reason - and this is what I'm asking to get help/advice on... But thanks anyway (I suppose you tried to help, your comments wasn't just exactly what I needed help for, but thanks anyway for your interest)...
Beerman58
DD-WRT Novice


Joined: 10 Feb 2019
Posts: 1

PostPosted: Sun Feb 10, 2019 5:34    Post subject: Reply with quote
I am currently in the same place you are, Newsboost! ...combing through ancient posts trying to get my Linksys E2500 "off the ground" so to speak, with a first-time install of optware that I'm trying place on my Windows 10 CIFS share. (optware/entware/pimpware, whatever package manager I can get working in this starving desert of a build environment!)

Did you ever get this figured out?



After starting with DD-WRT, I actually ended up flashing to Tomato by Shibby for unrelated reasons. But this stuff we are doing should mostly be generic/low-level enough to be pretty much exactly the same between the two highly-related Linux builds.

Likewise, in response to when you said:
Quote:
I tried insmod loop.ko and other things (e.g.
https://oxavelar.wordpress.com/2013/12/27/mounting-ext4-partitions-in-dd-wrt/), but with no luck, I couldn't insmod those modules and thought it was a bit unsafe to download *.ko-files from the internet

...I thought I'd point you to an excellent trusted *.ko file source over at Shibby's place, which I just now found:
http://tomato.groov.pl/download/
Basic instructions, just find a build that is most like your router hardware/build (my E2500 runs "K26"; kernel 2.6??) and snag the extras*.tar.gz like extras-mips1.tar.gz or extras-mips2.tar.gz. Unzip them to find a treasure trove of ready-to-install *.ko modules.



My own planned path forward (in case anyone is reading is interested) is to copy the loop.ko and ext3.ko I just found (per the above) to my CIFS share within Windows 10, insmod the *.ko modules from the router-mounted CIFS share (which I previously got worked out yesterday) via telnet/SSH, then continue with the loop device as instructed here (...um, from 2007... yikes!). Fingers crossed!!!
newsboost
DD-WRT User


Joined: 05 Jul 2018
Posts: 83

PostPosted: Sun Feb 10, 2019 13:40    Post subject: Reply with quote
Beerman58 wrote:
I am currently in the same place you are, Newsboost! ...combing through ancient posts trying to get my Linksys E2500 "off the ground" so to speak, with a first-time install of optware that I'm trying place on my Windows 10 CIFS share. (optware/entware/pimpware, whatever package manager I can get working in this starving desert of a build environment!)

Did you ever get this figured out?
No, I gave up and began spending my time on something else. But I'm still very interested, so I hope someone soon comes up with a working solution. I used AsusWRT earlier and there it works. I'm/I was very surprised to see that this doesn't work on ddwrt...

Beerman58 wrote:
After starting with DD-WRT, I actually ended up flashing to Tomato by Shibby for unrelated reasons. But this stuff we are doing should mostly be generic/low-level enough to be pretty much exactly the same between the two highly-related Linux builds.
Agreed, should be the same. So, does it work with tomatousb? I didn't try that... It works on asuswrt, FYI...

Beerman58 wrote:
Likewise, in response to when you said:
Quote:
I tried insmod loop.ko and other things (e.g.
https://oxavelar.wordpress.com/2013/12/27/mounting-ext4-partitions-in-dd-wrt/), but with no luck, I couldn't insmod those modules and thought it was a bit unsafe to download *.ko-files from the internet

...I thought I'd point you to an excellent trusted *.ko file source over at Shibby's place, which I just now found:
http://tomato.groov.pl/download/
Basic instructions, just find a build that is most like your router hardware/build (my E2500 runs "K26"; kernel 2.6??) and snag the extras*.tar.gz like extras-mips1.tar.gz or extras-mips2.tar.gz. Unzip them to find a treasure trove of ready-to-install *.ko modules.
So this works? Or not (based on the below, I have the impression you haven't finished testing it, but I'm a bit unsure)? I have the netgear R7000-router and bought it because I thought pretty much *anything* would work on that with ddwrt, but apparently not...

Beerman58 wrote:
My own planned path forward (in case anyone is reading is interested) is to copy the loop.ko and ext3.ko I just found (per the above) to my CIFS share within Windows 10, insmod the *.ko modules from the router-mounted CIFS share (which I previously got worked out yesterday) via telnet/SSH, then continue with the loop device as instructed here (...um, from 2007... yikes!). Fingers crossed!!!
I don't think you need that, the size of the *.ko-files are pretty small I think. So I think you can store them inside /jffs, which can hold a small amount of space for e.g. config-files. The link you showed also uses "insmod /jffs/lib/modules/2.4.30/loop.o
insmod /jffs/lib/modules/2.4.30/ext2.o" - so this is where I would store them. I spend a lot of hours, it's so frustrating that nobody knows the answer or can help with an explanation for getting it to work or maybe reason for why it doesn't work. I ended up thinking that I needed to learn to recompile a kernel and put that on the router, ensuring that these modules are available and works with the running kernel... Please update this thread, if you find a working solution!
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum