How to e2fsck and clean umount on Belkin 3302

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


Joined: 12 Oct 2010
Posts: 2

PostPosted: Wed Oct 13, 2010 11:38    Post subject: How to e2fsck and clean umount on Belkin 3302 Reply with quote
I have a Belkin Share F7D3302 v1.
Flashed, using CFE miniserver, first with dd-wrt.v24-15407_NEWD-2_K2.6_mini_f7d3302.bin,
then with dd-wrt.v24-15407_NEWD-2_K2.6_mini_usb.bin.
Installed Optware in /opt, on an ext2 formatted USB stick.

Issue: I want to have an e2fsck on the USB drive where Optware is, before it is mounted,
and also a clean umount when rebooting from ssh.

Solution:

in webGUI:
- enabled jffs
- disabled USB automount

Installed, in /jffs, e2fsck and his libraries from http://downloads.openwrt.org/kamikaze/8.09.2/brcm47xx/packages/
[the stock whiterussian repo's version doesnt work].


created /jffs/etc/config/fsckusb0.startup :
Code:
while  echo -n `date` | grep -q 1970  ; do
sleep 1
done
/jffs/usr/sbin/e2fsck -p /dev/discs/disc0/part1
mount -o noatime /dev/discs/disc0/part1 /opt
mount -r -o bind /jffs/etc/profile /etc/profile &
/opt/etc/init.d/optS
exit

[the "grep 1970" loop is mandatory, or you'll end up having e2fsck always running at boot,
with something like "last time the disk was checked is 14683 days ago, running e2fsck now",
because of the default date (1970, start of epoch time) the router has before the ntpclient has obtained
the correct one]


created /jffs/etc/profile :
Code:
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
export LD_LIBRARY_PATH=/lib:/usr/lib:/jffs/lib:/jffs/usr/lib:/jffs/usr/local/lib:/mmc/lib:/mmc/usr/lib:/opt/lib:/opt/usr/lib
export PS1='\u@\h:\w\$ '
reboot() {
  /opt/etc/init.d/optK
  sleep 1
  umount -rl /opt
  /sbin/reboot
  }
Sponsor
Masterman
DD-WRT Guru


Joined: 24 Aug 2009
Posts: 2070
Location: South Florida

PostPosted: Wed Oct 13, 2010 12:23    Post subject: Reply with quote
You'd be better off running it in a Linux distro environment from a PC. There are tons of bootable live distro's out there that don't even require you to start X Window. Running fsck on a router with only 64MB of RAM and a 480 MHz CPU will take forever.
_________________
Optware, the Right Way
Asus RT-AC68U
Asus RT-N66U
Asus RT-N10
Asus RT-N12
Asus RT-N16 x5
Asus WL520gU
Engenious ECB350
Linksys WRT600Nv1.1
Linksys WRT610Nv1
Linksys E2000
Netgear WNDR3300
SonicWall NSA220W
SonicWall TZ215W
SonicWall TZ205W
SonicWall TZ105W
pld5yXmq
DD-WRT Novice


Joined: 12 Oct 2010
Posts: 2

PostPosted: Wed Oct 13, 2010 13:12    Post subject: Reply with quote
Masterman wrote:
You'd be better off running it in a Linux distro environment from a PC. There are tons of bootable live distro's out there that don't even require you to start X Window. Running fsck on a router with only 64MB of RAM and a 480 MHz CPU will take forever.


Of course.
Fsck'ing a 1TB disk from this router is nonsense.

But, as I said in my post, I use a [16GB] USB stick.
And that is absolutely enough for Optware, with many services and progs, to run.

On this 16GB drive, e2fsck needs less than 10 seconds to complete.
strelok-ac
DD-WRT Novice


Joined: 04 Aug 2011
Posts: 2

PostPosted: Thu Sep 08, 2011 13:06    Post subject: Re: How to e2fsck and clean umount on Belkin 3302 Reply with quote
pld5yXmq wrote:

Code:
while  echo -n `date` | grep -q 1970  ; do
sleep 1
done



also you can use "-f" key
Code:
e2fsck -yf /dev/discs/disc0/part1

And pld5yXmq's solution is not universal, becourse it cannon be used if im not plug storage at router startup.
For on storage plugin mode, we only can make startup script for waiting usb storage device... Or we have other way to do?
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