Optware screwed up after update. Please help

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
xakep
DD-WRT User


Joined: 23 Jun 2008
Posts: 71
Location: Brooklyn, NY

PostPosted: Mon Apr 21, 2014 9:13    Post subject: Optware screwed up after update. Please help Reply with quote
21676 to 23838

Hi guys I had my DDWRT with optware setup on my 3700v1 for years now, I just had to update and like always here it is ... problems. Can you please check it out I am sure it's nothing. It looks like now guys instead of /mnt/sda_part1/ mounting points new DDWRT use something like /tmp/mnt/sda1/ and obviously nothing works now. I'll paste my USB mounting code and my start up code. Can you please look at at and if possible tell me what I need to fix there. I really hope I don't have to go in to actual "system" to fix my problem.

Here are readings from Services --> USB

Code:

--- /dev/sda
Block device, size 931.5 GiB (1000204886016 bytes)
DOS/MBR partition map
Partition 1: 512 MiB (536870912 bytes, 1048576 sectors from 2048)
Type 0x83 (Linux)
Ext2 file system
Volume name "Optware"
UUID 6E79590F-CE06-4B29-A92C-180540F61019 (DCE, v4)
Volume size 512 MiB (536870912 bytes, 131072 blocks of 4 KiB)
Partition 2: 64 MiB (67108864 bytes, 131072 sectors from 1050624)
Type 0x82 (Linux swap / Solaris)
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian
Swap size 63.99 MiB (67100672 bytes, 16382 pages of 4 KiB)
Partition 3: 128 MiB (134217728 bytes, 262144 sectors from 1181696)
Type 0x83 (Linux)
Ext2 file system
Volume name "Shared"
UUID 02CFCEEF-225C-43A1-A332-11DB0F29AC13 (DCE, v4)
Volume size 128 MiB (134217728 bytes, 131072 blocks of 1 KiB)
Partition 4: 930.8 GiB (999465639936 bytes, 1952081328 sectors from 1443840)
Type 0x83 (Linux)
Ext2 file system
Volume name "Data"
UUID 6B3DC694-E8F9-43E1-8464-2C05CE98C827 (DCE, v4)
Volume size 930.8 GiB (999465639936 bytes, 244010166 blocks of 4 KiB)
/dev/sda mounted to /opt

--- /dev/sda1
Block device, size 512 MiB (536870912 bytes)
Ext2 file system
Volume name "Optware"
UUID 6E79590F-CE06-4B29-A92C-180540F61019 (DCE, v4)
Volume size 512 MiB (536870912 bytes, 131072 blocks of 4 KiB)
/dev/sda1 mounted to /opt

--- /dev/sda2
Block device, size 64 MiB (67108864 bytes)
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian
Swap size 63.99 MiB (67100672 bytes, 16382 pages of 4 KiB)
/dev/sda2 mounted to swap

--- /dev/sda3
Block device, size 128 MiB (134217728 bytes)
Ext2 file system
Volume name "Shared"
UUID 02CFCEEF-225C-43A1-A332-11DB0F29AC13 (DCE, v4)
Volume size 128 MiB (134217728 bytes, 131072 blocks of 1 KiB)
/dev/sda3 mounted to /tmp/mnt/sda3

--- /dev/sda4
Block device, size 930.8 GiB (999465639936 bytes)
Ext2 file system
Volume name "Data"
UUID 6B3DC694-E8F9-43E1-8464-2C05CE98C827 (DCE, v4)
Volume size 930.8 GiB (999465639936 bytes, 244010166 blocks of 4 KiB)
/dev/sda4 mounted to /tmp/mnt/sda4


And here is my current startup code

Code:

#!/bin/sh

sleep 10
if [ -f /mnt/sda_part1/optware.enable ]; then
mount -o bind /mnt/sda_part1/etc /etc
mount -o bind /mnt/sda_part1/root /tmp/root
mount -o bind /mnt/sda_part1/opt /opt
else
exit
fi

if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
else
exit
fi


I see mounting points are now different but also I just looked on my old optware installation and I see some things in /etc/opkg.conf that may be need editing but I am sure I'll manage, but again if possible can you provide correct startup code so at list my optware installation is not proken and I See nice color letters in SSH root@WNDR3700

Thank you VERY much guys. Also if it's impossible to fix and I do need to reinstall optware and wipe router I even ready to do this but I need updated tutorial on how to install Optware on new DDWRT with updated mount structure.

Thank you once again.

_________________
=================================
|We Have What it Takes ...I think.|
=================================
Sponsor
farrukh
DD-WRT Novice


Joined: 31 Dec 2013
Posts: 41

PostPosted: Mon Apr 21, 2014 17:09    Post subject: Reply with quote
Yes mount paths have changed in recent builds. Opkg.conf doesn't matter. Just modify the paths in startup code to:

Code:
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/root /tmp/root
mount -o bind /tmp/mnt/sda1/opt /opt


Also don't forget to copy and overwrite files from /etc to /tmp/mnt/sda1/etc. Otherwise the webgui will look messed up.
xakep
DD-WRT User


Joined: 23 Jun 2008
Posts: 71
Location: Brooklyn, NY

PostPosted: Tue Apr 22, 2014 6:32    Post subject: Reply with quote
Thank you ery much for your help yet I knew it's couldn't be that easy. After changing 3 lines and reboot GUI intact even without copy /etc directory and opkg command still not valid and root@WNDR3700 not colored means optware not working correctly Sad

Any other ideas ? I mean I am willing to reinstall optware if new tutorial is available cause all I See are for like 2 year old builds that no longer work.

Code:

root@WNDR3700:~# opkg update
-sh: opkg: not found
root@WNDR3700:~#

_________________
=================================
|We Have What it Takes ...I think.|
=================================
farrukh
DD-WRT Novice


Joined: 31 Dec 2013
Posts: 41

PostPosted: Tue Apr 22, 2014 6:55    Post subject: Reply with quote
You also need to change the path on first line

Code:
if [ -f /mnt/sda_part1/optware.enable ]; then

to
Code:
if [ -f /tmp/mnt/sda1/optware.enable ]; then


Here is your final startup code:

Code:
#!/bin/sh

sleep 10
if [ -f /tmp/mnt/sda1/optware.enable ]; then
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/root /tmp/root
mount -o bind /tmp/mnt/sda1/opt /opt
else
exit
fi

if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
else
exit
fi
xakep
DD-WRT User


Joined: 23 Jun 2008
Posts: 71
Location: Brooklyn, NY

PostPosted: Tue Apr 22, 2014 7:39    Post subject: Reply with quote
yeah I cought that almost immidiatly as well, nothing works you see here is the problem let's look at the code.

Very first line it's looking for optware.enable file in /mnt/sda1/ but for some reason /sda1/ is not mounted at all, here is the df -h command reply.

Code:

root@WNDR3700:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    5.5M      5.5M         0 100% /
/dev/root                 5.5M      5.5M         0 100% /
/dev/sda3               124.0M      1.5M    121.2M   1% /tmp/mnt/sda3
/dev/sda1               503.9M     31.5M    467.3M   6% /opt
/dev/sda4               916.2G    799.3G    107.6G  88% /tmp/mnt/sda4
/dev/sda4               916.2G    799.3G    107.6G  88% /tmp/proftpd/users/xakep/FTP
root@WNDR3700:~#


So if there is no such mount point optware.enable will not be mound.

Okay well I decided to do this.


Code:

mkdir /tmp/mnt/sda1
mount /dev/sda1 /tmp/mnt/sda1


and sure thing I see sda1 volume not mounted in to proper /mnt/sda1/

Code:

root@WNDR3700:~# mkdir /tmp/mnt/sda1
root@WNDR3700:~# mount /dev/sda1 /tmp/mnt/sda1
root@WNDR3700:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    5.5M      5.5M         0 100% /
/dev/root                 5.5M      5.5M         0 100% /
/dev/sda3               124.0M      1.5M    121.2M   1% /tmp/mnt/sda3
/dev/sda1               503.9M     31.5M    467.3M   6% /opt
/dev/sda4               916.2G    799.3G    107.6G  88% /tmp/mnt/sda4
/dev/sda4               916.2G    799.3G    107.6G  88% /tmp/proftpd/users/xakep/FTP
/dev/sda1               503.9M     31.5M    467.3M   6% /tmp/mnt/sda1
root@WNDR3700:~#


So now with sda1 in there I did "RUN COMMAND" with start up code ......annnnd nothing.

Code:

root@WNDR3700:~# opkg update
-sh: opkg: not found
root@WNDR3700:~#


Only one thing may be I can't run start up command like this or something I don't know all I know I simply can't understand what is the problem, I don't hove enough knowlege on this and trust me I looked. I love this stuff and I want to learn but I simply don't have resources. I don't see a single tutorial on how to do this that is CURRENT i see hundreds of topics but all of them are old and they wont work because DDWRT mounting system has changed and I think it's more than just /mnt/sda1_part1/ to /mnt/sda1/ otherwise it would of worked. I am really stressed out can't I con't figure this out.

Also now I am looking at how DDWRT mounting my Hard drive and it's VERY interesting.

I have 1 TB drive with 4 partitions. I used this guide to make it:

http://www.dd-wrt.com/wiki/index.php/How_to_-_Format_and_Partition_External_Storage_Device

So:

Partition 1 is 512MB and I called it OPTWARE
Partition 2 is 64MN and I called it SWAP
Partition 3 is 128MB and I called is SHARED
Partition 4 is 930GB and I called it DATA

And DDWRT I see have 2 mounting points for /opt one from /dev/sda and another from /dev/sda1 both with /opt mounts

Again may be it's nothing but that's all I See. And I don't understand why there are no /mnt/sda1/ mounting points .... I am very confused. I clearly need help.

Put it this way I guess I can go back to 21676 but come on what is this ? I mean this is over 2 years old build. I think I'll be forced to do this if I am not up and running soon.

_________________
=================================
|We Have What it Takes ...I think.|
=================================
farrukh
DD-WRT Novice


Joined: 31 Dec 2013
Posts: 41

PostPosted: Tue Apr 22, 2014 8:17    Post subject: Reply with quote
xakep wrote:
yeah I cought that almost immidiatly as well, nothing works you see here is the problem let's look at the code.

Very first line it's looking for optware.enable file in /mnt/sda1/ but for some reason /sda1/ is not mounted at all, here is the df -h command reply.

Code:

root@WNDR3700:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    5.5M      5.5M         0 100% /
/dev/root                 5.5M      5.5M         0 100% /
/dev/sda3               124.0M      1.5M    121.2M   1% /tmp/mnt/sda3
/dev/sda1               503.9M     31.5M    467.3M   6% /opt
/dev/sda4               916.2G    799.3G    107.6G  88% /tmp/mnt/sda4
/dev/sda4               916.2G    799.3G    107.6G  88% /tmp/proftpd/users/xakep/FTP
root@WNDR3700:~#

[/code]


That is because sda1 partition is labeled "optware" so dd-wrt is auto mounting it as /opt which is stopping it from getting mounted as /tmp/mnt/sda1.

For a quick trick, Try changing the label on the first partition on your HDD from "optware" to something like "DDDoctware" using a PC.

And then connect the HDD back to DD-WRT router and reboot it and let us know. I think this will do it for you.
xakep
DD-WRT User


Joined: 23 Jun 2008
Posts: 71
Location: Brooklyn, NY

PostPosted: Tue Apr 22, 2014 21:56    Post subject: Reply with quote
YOU GOTTA BE KIDDING ME !

It worked. I see colored letters and ....

Code:

root@WNDR3700 ~ $ opkg update
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/snapshots.
root@WNDR3700 ~ $


and

Code:

root@WNDR3700 ~ $ df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    5.5M      5.5M         0 100% /
/dev/root                 5.5M      5.5M         0 100% /
/dev/sda1               503.9M     31.9M    466.9M   6% /tmp/mnt/sda1
/dev/sda3               124.0M      1.5M    121.2M   1% /tmp/mnt/sda3
/dev/sda4               916.2G    799.3G    107.6G  88% /tmp/mnt/sda4
/dev/sda4               916.2G    799.3G    107.6G  88% /tmp/proftpd/users/xakep                                                                 /FTP
/dev/sda1               503.9M     31.9M    466.9M   6% /etc
/dev/sda1               503.9M     31.9M    466.9M   6% /tmp/root
/dev/sda1               503.9M     31.9M    466.9M   6% /opt
root@WNDR3700 ~ $


Thank you very much I KNEW this was something so simple and totally stupid, I mean come on it wasn't working because of partition Label. I mean come on what is this. Anyhow I am glad it works. I do see what you mean my GUI all screwed up, what I have to do to fix it again ?

And Once again thanks a lot for helping.

_________________
=================================
|We Have What it Takes ...I think.|
=================================
xakep
DD-WRT User


Joined: 23 Jun 2008
Posts: 71
Location: Brooklyn, NY

PostPosted: Tue Apr 22, 2014 23:11    Post subject: Reply with quote
I tried to copy using WinSCP /etc folder in / "root" to desktop on PC and from PC same /etc folder to /mnt/sda1/ and .... I think files are identical and I Still have corruption in Web GUI. I bet it's another simple fix but may be I am doing something wrong right now.

UPDATE:

I did exactly same this but without HDD plugged in. (First part copying /etc to PC)

Then I restarted router with HDD plugged in and I do see files are different. I moved new /etc files to /mnt/sda1/ restarted router and, it got better I do see options and buttons but GUI is not right I mean it looks like 1995 Netscape surfing Very Happy I think I am closer but not quite. Rest optware and stuff still works no problem.

I'll wait for you, don't want to mess something up. And actually now I am thinking about full 30 30 30 wipe and using old method to install optware but using new startup code .... anyhow I'll wait for you.

UPDATE 2: I Used files from /etc folder that I took while GUI was okay without Hard drive plugged in and I moved them to /etc that in ROOT and not in mnt/sda1 with HDD PLUGGED IN because etc from root being mounted as sda1 so basically it's same files. and it works now. So all I had to do is unplug HDD , same /etc folder to PC , plug in Hard drive back reboot router and copy /etc from my pc back to router root. Oh boi. Anyhow this was nothing compare to Label mismatch of partition .... BTW I got it labelled as you told me DDD .....etc Very Happy I'll keep it that way.

_________________
=================================
|We Have What it Takes ...I think.|
=================================
farrukh
DD-WRT Novice


Joined: 31 Dec 2013
Posts: 41

PostPosted: Fri Apr 25, 2014 8:38    Post subject: Reply with quote
Enjoy !

Next time whenever you upgrade to a new build, just use following command using using ssh/telnet to copy /etc/:

cp -a /etc/* /tmp/mnt/sda1/etc/

Ideally, do it before you load optware (startup commands in webgui)
routvol
DD-WRT User


Joined: 02 Feb 2009
Posts: 87

PostPosted: Mon May 05, 2014 19:40    Post subject: Reply with quote
farrukh wrote:
You also need to change the path on first line

Code:
if [ -f /mnt/sda_part1/optware.enable ]; then

to
Code:
if [ -f /tmp/mnt/sda1/optware.enable ]; then


Here is your final startup code:

Code:
#!/bin/sh

sleep 10
if [ -f /tmp/mnt/sda1/optware.enable ]; then
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/root /tmp/root
mount -o bind /tmp/mnt/sda1/opt /opt
else
exit
fi

if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
else
exit
fi


thx farrukh working fine on 23919.

_________________
my dd-wrt configuration:
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=682296
xakep
DD-WRT User


Joined: 23 Jun 2008
Posts: 71
Location: Brooklyn, NY

PostPosted: Thu Jun 19, 2014 2:01    Post subject: Reply with quote
Oh boy ......again, updated to 24160 and AGAIN I See mounting changes .... I mean come on. Developers have ACTUAL reason behind that or what cause why would you change how system mount USB drives and partitions ? Nothing changed on my side yet optware no longer works because DDWRT no longer mount my partitions correctly, in matter effect it see only 1 partition out of 4, at list it mount only 1.

Here what I See now.

Code:

Disk Info
--- /dev/sda3
Block device, size 128 MiB (134217728 bytes)
Ext2 file system
Volume name "Shared"
UUID 02CFCEEF-225C-43A1-A332-11DB0F29AC13 (DCE, v4)
Volume size 128 MiB (134217728 bytes, 131072 blocks of 1 KiB)
/dev/sda3 mounted to /tmp/mnt/sda3


that's it ..... no opt,swap or data partitions .... only this shared ....

Like like time it's totally possible that they change the way system mount partitions based on partition name ....so ....last time I had problem and all I had to do is rename my opt partition from opt to some other words without opt in it ..and it worked ... what's going on now ? I really hope guy who helped me before still here.

Update:

Really strange things are happening.

I restarted router looked on mounting points and I See totally diffirent stuff. It looks like opt is propertly mounted as sda1 BUT to same /opt I see now my data partition is mounted .....yeah something is def wrong here.

Two things if possible. DDWRT CLEARLY look at partition names for mount suggestions so with that is there a "proper" way of naming partitions ? I want /opt in sda1 swap in sda2 shared in sda3 and main storage partition is sda4.

And another thing I see we all doing auto mount here, may be it's better just to manually mount all partitions ? I mean is it possible to include in startup code to mount partition in the way I need like I described before and then start usual optware code ?

Thank you guys !

here is what I have now just after restart:
Code:

Disk Info
--- /dev/sda
Block device, size 931.5 GiB (1000204886016 bytes)
DOS/MBR partition map
Partition 1: 512 MiB (536870912 bytes, 1048576 sectors from 2048)
Type 0x83 (Linux)
Ext2 file system
Volume name "Optware"
UUID 6E79590F-CE06-4B29-A92C-180540F61019 (DCE, v4)
Volume size 512 MiB (536870912 bytes, 131072 blocks of 4 KiB)
Partition 2: 64 MiB (67108864 bytes, 131072 sectors from 1050624)
Type 0x82 (Linux swap / Solaris)
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian
Swap size 63.99 MiB (67100672 bytes, 16382 pages of 4 KiB)
Partition 3: 128 MiB (134217728 bytes, 262144 sectors from 1181696)
Type 0x83 (Linux)
Ext2 file system
Volume name "Shared"
UUID 02CFCEEF-225C-43A1-A332-11DB0F29AC13 (DCE, v4)
Volume size 128 MiB (134217728 bytes, 131072 blocks of 1 KiB)
Partition 4: 930.8 GiB (999465639936 bytes, 1952081328 sectors from 1443840)
Type 0x83 (Linux)
Ext2 file system
Volume name "Data"
UUID 6B3DC694-E8F9-43E1-8464-2C05CE98C827 (DCE, v4)
Volume size 930.8 GiB (999465639936 bytes, 244010166 blocks of 4 KiB)
/dev/sda mounted to /opt

--- /dev/sda1
Block device, size 512 MiB (536870912 bytes)
Ext2 file system
Volume name "Optware"
UUID 6E79590F-CE06-4B29-A92C-180540F61019 (DCE, v4)
Volume size 512 MiB (536870912 bytes, 131072 blocks of 4 KiB)
/dev/sda1 mounted to /opt

--- /dev/sda2
Block device, size 64 MiB (67108864 bytes)
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian
Swap size 63.99 MiB (67100672 bytes, 16382 pages of 4 KiB)
/dev/sda2 mounted to swap

_________________
=================================
|We Have What it Takes ...I think.|
=================================
tsdwrt
DD-WRT Novice


Joined: 01 Apr 2014
Posts: 3

PostPosted: Tue Jun 24, 2014 8:51    Post subject: Reply with quote
Your sda1 partition is still labeled "Optware" so dd-wrt is auto mounting it as /opt. Do not use "Optware", "optware", "opt" ... as label for partition in order to be mounted as /tmp/mnt/sda1.
xakep
DD-WRT User


Joined: 23 Jun 2008
Posts: 71
Location: Brooklyn, NY

PostPosted: Wed Jun 25, 2014 4:12    Post subject: Reply with quote
Thank you for reply, yeah this is after I tried everything including rename and stuff. Basically everytime I reboot router it mount partition diffirent way, after about 10 restarts I managed to get sda1 working so optware is just fine ...no sda4 (my main data partition) but I did manual mount so for now It's working but again. Does anyone know what is going on with this mounting diffirently on each reboot thing ? Or it's just me ?

Here is what I have now:

Code:

Disk Info
--- /dev/sda1
Block device, size 512 MiB (536870912 bytes)
Ext2 file system
Volume name "sda1"
UUID 6E79590F-CE06-4B29-A92C-180540F61019 (DCE, v4)
Volume size 512 MiB (536870912 bytes, 131072 blocks of 4 KiB)
/dev/sda1 mounted to /tmp/mnt/sda1

--- /dev/sda2
Block device, size 64 MiB (67108864 bytes)
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian
Swap size 63.99 MiB (67100672 bytes, 16382 pages of 4 KiB)
/dev/sda2 mounted to swap

--- /dev/sda3
Block device, size 128 MiB (134217728 bytes)
Ext2 file system
Volume name "sda3_shared"
UUID 02CFCEEF-225C-43A1-A332-11DB0F29AC13 (DCE, v4)
Volume size 128 MiB (134217728 bytes, 131072 blocks of 1 KiB)
/dev/sda3 mounted to /tmp/mnt/sda3


No sda4 but it's okay and I labeled partition 1 as sda1 .. I tried different names .. it didn't help btw Optware or OPT or ...whatever. So SDA! works for me.

Also, I have another thing I tried after this post that for some reason DID NOT work. I tried to disable auto mount and tied to create new folder and mount manually sda1 in to it. I couldn't. Not sure why but I managed to create folder in /tmp/mnt/sda1 and mount /dev/sda1 but nothing worked. Anyone know what is going on ?

I made separate post about it.
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=901919#901919

_________________
=================================
|We Have What it Takes ...I think.|
=================================
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC 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 cannot attach files in this forum
You cannot download files in this forum