0 u( d" [3 ]1 A5 |
telnet 192.168.1.1
2 q' {' w" l' B4 o/ E& broot
) e6 i% v' d) cadminHW; i7 H- A7 w& U2 u$ p8 O
su
% n/ Q$ X% a! i7 Z+ oshell" R( Q. u4 Z) i8 [2 x
cd /mnt/ (进入/mnt 目录)1 }' W7 [: _, ]- L% w k
cp -r jffs2 /mnt/usb1_1/ (备份整个文件夹到U盘)
0 I: O! L' P3 o
2 M! F* Z6 G8 h! B0 }& W4、恢复 jffs2文件夹 :
4 T5 b5 d8 i9 q+ `
% B. f# g! J+ T# m" H7 O将备份文件夹复制到U盘,U盘插入光猫后面的USB口: g0 Y$ N7 y) T& ^
* x- H) b4 E+ ]+ w# w
telnet 192.168.1.1
1 X; C- ~1 U6 @# s6 F: {root8 P1 s- |% t* E2 Q
adminHW
, A- R9 g* Y" G/ |; Y% P) Dsu- U. [7 `+ N6 u& f8 [
shell* T0 h( Z! N5 D0 Y, o, r) f
cd /mnt/usb1_1/
0 {0 a, r3 k$ t- Ucp -r jffs2 /mnt/ (复制jffs2文件夹到mnt目录下,替换原jffs2文件夹)
! T& q/ T9 {: P, Kreboot
: [' a3 w, j1 `3 g- S( E; a9 @% J# E2 h, O: S( L7 I1 J
(PS:删除jffs2文件夹所有文件:rm -rf /mnt/jffs2/* 删除jffs2文件夹内所有文件和文件夹:rm -rf * )
S7 r( {7 @% f' W" o0 j
& E' Y! |+ }/ d3 N! U二、TFTP软件备份恢复方法
% b, G+ ~ Y& w* Q/ k% o1 a7 G `9 r) q
注意:用此方法备份恢复比较繁琐,不建议用此方法!!!
: p# V# v/ p6 l' `7 N) `, W7 r$ i8 @3 Q8 w
首先要打开TFTP软件,并设置好工作目录。
! K8 z! l1 f8 i6 Q! j* [: W" O" t0 J: f
1、备份分区( i! c; v% \1 P9 R) d, B
% o8 I( f. R) F6 f0 ctelnet 192.168.1.1
( }+ t3 [+ x$ D' H6 E$ `. j* Oroot) x' N- Z+ X" ^ p) c
adminHW
) H' l! }) k* n* xsu
8 a, O5 R% g% s, O, z+ ?shell( G4 f* X7 Q# G& t# ?2 I
dd if=/dev/mtd0 of=/dev/shm/0.bin/ \( g4 z1 ]# m( U
dd if=/dev/mtd1 of=/dev/shm/1.bin& r: `5 _. ?. e% W' l) E, Y6 }0 `
dd if=/dev/mtd2 of=/dev/shm/2.bin
$ Z/ A4 R6 m; ^dd if=/dev/mtd3 of=/dev/shm/3.bin. P1 `) H5 _! D
dd if=/dev/mtd4 of=/dev/shm/4.bin$ S+ p: o3 Z& C) c9 S
dd if=/dev/mtd5 of=/dev/shm/5.bin
) `3 a; D! L, i Kdd if=/dev/mtd6 of=/dev/shm/6.bin
0 c& w/ l: h$ ]7 t1 Idd if=/dev/mtd7 of=/dev/shm/7.bin
* g, V" S% S P1 ?0 F" Cdd if=/dev/mtd8 of=/dev/shm/8.bin9 A0 Q3 R: N7 M' E9 |/ w9 W
dd if=/dev/mtd9 of=/dev/shm/9.bin6 n J) y) z/ p% m6 S7 ?6 G
dd if=/dev/mtd10 of=/dev/shm/10.bin3 x: m i8 |' u0 X w8 O7 e4 V
dd if=/dev/mtd11 of=/dev/shm/11.bin( t, `) g' ]. e
dd if=/dev/mtd12 of=/dev/shm/12.bin
+ ]3 h: o( T! Ocd /dev/shm, W5 i, I/ w9 H- }/ [# T
tftp -p -l 0.bin -r 0.bin 192.168.1.3 (复制文件到电脑TFTP目录 192.168.1.3 为IP地址)
4 X) W1 E0 l) J9 K& P: Q4 Ytftp -p -l 1.bin -r 1.bin 192.168.1.3. i- O; [$ `+ J
tftp -p -l 2.bin -r 2.bin 192.168.1.3
) X2 r2 ?& r+ ~ dtftp -p -l 3.bin -r 3.bin 192.168.1.3" z7 H1 k. q& \4 Y
tftp -p -l 4.bin -r 4.bin 192.168.1.36 ^" g! w8 V: N# k: j/ ?+ @0 n+ B
tftp -p -l 5.bin -r 5.bin 192.168.1.3
" x0 H7 S1 O- \: n0 {; _0 w# Q5 Wtftp -p -l 6.bin -r 6.bin 192.168.1.3! f# l2 g `2 m, k: S6 _4 I$ g6 j
tftp -p -l 7.bin -r 7.bin 192.168.1.3" n" C( o. h. t7 N1 S
tftp -p -l 8.bin -r 8.bin 192.168.1.38 ~. h' w* {: {- v8 l5 f' ^
tftp -p -l 9.bin -r 9.bin 192.168.1.3
' Q, ~: @* p$ ~, xtftp -p -l 10.bin -r 10.bin 192.168.1.3
4 ?; b4 X1 c2 q" K C* vtftp -p -l 11.bin -r 11.bin 192.168.1.3% M, F2 k y3 |0 j1 R r
tftp -p -l 12.bin -r 12.bin 192.168.1.33 {3 K4 x: k" ]9 _5 [0 | s) U
rm -rf * (删除备份文件,否则空间不够)9 S. `" P. t9 v! c- j
dd if=/dev/mtdblockubi0_9 of=/dev/shm/0_9.bin3 a6 L3 F/ J! d
dd if=/dev/mtdblockubi0_10 of=/dev/shm/0_10.bin
. }3 x5 X) A) ~/ v* x7 t) utftp -p -l 0_9.bin -r 0_9.bin 192.168.1.3v# m9 j; Z) z a
tftp -p -l 0_10.bin -r 0_10.bin 192.168.1.3
2 P- M! J% s5 P5 q- I( z4 X$ srm -rf *
! R/ m$ i! _, j1 ^* Y. ^/ Q! K3 Y: E% q' |. k0 n1 r5 y
2、恢复分区" N, @* ~/ z- T* E! Q: M
% \* {8 l( J. V; L
telnet 192.168.1.1
# m( v) [7 y; vroot
0 R$ k6 f8 x% E1 n: }adminHW( R3 x4 v$ n7 x" ]8 R* Z, ]* p
su4 h* x/ j* u8 ` Z* `9 T' c D" O$ V
shell
}1 @6 d5 F8 g2 U4 ]cd /dev/shm
% k/ v. x2 w3 H+ ytftp -g -l 0.bin -r 0.bin 192.168.1.3 (将电脑TFTP目录文件上传到光猫/dev/shm)
. D. o5 c+ b) o+ H+ d& mtftp -g -l 1.bin -r 1.bin 192.168.1.3
& J4 c4 _5 ?9 T7 g. W' I2 A% Q4 Ttftp -g -l 2.bin -r 2.bin 192.168.1.3
# ? E; p! H6 Ktftp -g -l 3.bin -r 3.bin 192.168.1.3- F3 _" g8 l& _* {! q/ R0 k
tftp -g -l 4.bin -r 4.bin 192.168.1.34 h& q% a5 X; \/ I
tftp -g -l 5.bin -r 5.bin 192.168.1.3
3 M' z/ C* J' W: ?tftp -g -l 6.bin -r 6.bin 192.168.1.32 N( r6 ~9 \; [4 W
tftp -g -l 7.bin -r 7.bin 192.168.1.37 q( E: C$ L! M, C# z
tftp -g -l 8.bin -r 8.bin 192.168.1.3
, K0 K7 Z- L$ v! B9 t) Qtftp -g -l 9.bin -r 9.bin 192.168.1.3
+ P9 U3 s$ n4 m" ^4 K7 Rtftp -g -l 10.bin -r 10.bin 192.168.1.3
?9 i! T- n) L, @tftp -g -l 11.bin -r 11.bin 192.168.1.33 U) F/ N+ @: H4 P4 ? S8 A/ }
tftp -g -l 12.bin -r 12.bin 192.168.1.3' b( \. |% g8 `- j" F* {/ h, q
dd if=/dev/shm/0.bin of=/dev/mtdblock0$ W. [5 O. g1 E& x \; o \
dd if=/dev/shm/1.bin of=/dev/mtdblock1
3 r: h; b: n# E+ C6 Q$ e. `dd if=/dev/shm/2.bin of=/dev/mtdblock2
5 r( s3 P- I) J% h( L4 zdd if=/dev/shm/3.bin of=/dev/mtdblock3
% L: V5 ^. k: L; g$ Jdd if=/dev/shm/4.bin of=/dev/mtdblock4! Q0 ]0 z0 c) @4 v% C% X' z! y
dd if=/dev/shm/5.bin of=/dev/mtdblock5
/ _8 x; ?2 Q* W. g$ W# h$ a6 udd if=/dev/shm/6.bin of=/dev/mtdblock6
T& V# m4 m. ], ?; @$ odd if=/dev/shm/7.bin of=/dev/mtdblock7
4 x" C* H8 l; Vdd if=/dev/shm/8.bin of=/dev/mtdblock8
' b* W9 W: i3 r$ Zdd if=/dev/shm/9.bin of=/dev/mtdblock9, q; ^* X2 m; s$ \5 J$ F `$ G
dd if=/dev/shm/10.bin of=/dev/mtdblock106 i1 b; K- F$ N2 R q1 N
dd if=/dev/shm/11.bin of=/dev/mtdblock115 D% |( Q9 G2 e+ n) g8 _0 ?
dd if=/dev/shm/12.bin of=/dev/mtdblock12" I8 S1 H2 V" L I7 k* |2 Q2 |
rm -rf *
0 z" _( ]* T: k: G7 ^/ _1 O8 D% wtftp -g -l 0_9.bin -r 0_9.bin 192.168.1.3
8 n7 o9 B7 G0 I$ |6 G6 f& Ctftp -g -l 0_10.bin -r 0_10.bin 192.168.1.3
- t0 c) H5 h" w0 n O. u- Vdd if=/dev/shm/0_9.bin of=/dev/mtdblockubi0_9
5 l: x' E+ U% V* n/ R3 ^5 \1 vdd if=/dev/shm/0_10.bin of=/dev/mtdblockubi0_10" X, ^/ v+ D2 A$ f' H* L) F
rm -rf * " b* ~. K! y. U( q p6 h
reboot
p. {4 C- C) e6 T( F* E" r# L% X# S
3、备份 jffs2文件夹:! b" e2 {( M# f; b% ~
; R3 H/ h; t) k- R5 s3 R
telnet 192.168.1.1$ x, i$ q9 D b) \7 ~
root( ~8 W# ^5 ~' \% U( C, U
adminHW
- @) n" @0 Q( o i) fsu
$ e$ |2 X" O: ^2 i# {shell: g) ^2 G r. S% J1 c4 i- m9 r: K
cd /mnt/jffs2 8 N& ^% `6 ^) ^5 N- {- g, y
tar -czf jffs2bak.tar.gz * (压缩jffs2文件夹为 jffs2bak.tar.gz)2 g+ J4 g( k9 [% q- l' j5 X
mv /mnt/jffs2/jffs2bak.tar.gz /tmp (剪切jffs2bak.tar.gz文件到 /tmp文件夹)
& b" p9 {. z" ]- ocd /tmp: }1 P/ I8 W7 E
tftp -p -l jffs2bak.tar.gz -r jffs2bak.tar.gz 192.168.1.3
' @5 y* \, p+ G) T3 E8 `
( c4 |* c e) E6 `2 }0 B4、恢复 jffs2:5 {( K2 {: c+ W1 Q* H$ C
, a# S; j5 C4 C1 ]& j2 C% z. x
telnet 192.168.1.17 l3 F I. T" j7 \. t: E! F
root
& ?" @; B/ @ t6 F. B& v( PadminHW/ [* f8 A: w( R( |, k9 }" {
su
0 i( }: t4 ]" k& `( m9 F& S* _0 Yshell' G- t/ p0 B) V/ J& E4 J: a% z
cd /mnt/jffs2 - b- b( [" o/ G0 Z2 R. `* l+ O& d