|
本帖最后由 olight 于 2015-4-4 22:36 编辑
本人是个刚工作主机系统管理员,对Linux比较感兴趣,于是来玩路由器了,属于新手。
看了各种教程,来个作业》
备份:
[root@Youku-router]cat /proc/mtd
dev: size erasesize name
mtd0: 02000000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Factory"
mtd4: 01fb0000 00010000 "firmware"
mtd5: 01e2ae8d 00010000 "rootfs"
mtd6: 01720000 00010000 "rootfs_data"
[root@Youku-router]
[root@Youku-router]
[root@Youku-router]df -h
Filesystem Size Used Available Use% Mounted on
rootfs 23.1M 732.0K 22.4M 3% /
/dev/root 7.0M 7.0M 0 100% /rom
tmpfs 61.1M 1.1M 60.1M 2% /tmp
/dev/mtdblock6 23.1M 732.0K 22.4M 3% /overlay
overlayfs:/overlay 23.1M 732.0K 22.4M 3% /
tmpfs 512.0K 0 512.0K 0% /dev
tmpfs 4.0M 276.0K 3.7M 7% /tmp/youku
tmpfs 4.0M 4.0K 4.0M 0% /tmp/youku/data
/dev/mmcblk0p1 126.0M 87.0K 125.9M 0% /tmp/youku/mnt/tf0
/dev/mmcblk0p2 126.0M 512 126.0M 0% /tmp/youku/mnt/tf1
/dev/mmcblk0p3 2.0G 1.9G 145.0M 93% /tmp/youku/mnt/tf2
/dev/mmcblk0p5 2.0G 1.9G 139.9M 93% /tmp/youku/mnt/tf3
/dev/mmcblk0p6 2.0G 1.8G 152.6M 93% /tmp/youku/mnt/tf4
/dev/mmcblk0p7 1.1G 916.5M 257.2M 78% /tmp/youku/mnt/tf5
#我的tf2还是挺满的,请问tf0~tf5就是存储卡吗?按照教程,我还是放在tf2吧:
[root@Youku-router]dd if=/dev/mtd0 of=/tmp/youku/mnt/tf2/fullflash.bin
65536+0 records in
65536+0 records out
[root@Youku-router]cd /tmp/youku/mnt/tf2
[root@Youku-router]ls
fullflash.bin youku
[root@Youku-router]
[root@Youku-router]
[root@Youku-router]ls -tlrh
drwxr-xr-x 3 root root 4.0K Jan 1 1980 youku
-rwxr-xr-x 1 root root 32.0M Apr 3 19:27 fullflash.bin
[root@Youku-router]
#链接到http服务下,便于浏览器直接下载
[root@Youku-router]ln -s /tmp/youku/mnt/tf2/fullflash.bin /www/fullflash.bin
[root@Youku-router]
[root@Youku-router]
[root@Youku-router]cd /www/
[root@Youku-router]ls
cgi-bin favicon.ico fullflash.bin index.html pub
err footer.htm header.htm luci-static
[root@Youku-router]ls -tlrh
lrwxrwxrwx 1 root root 14 Jan 1 1970 pub -> /tmp/youku/pub
-rw-r--r-- 1 root root 5.7K Feb 28 16:40 header.htm
-rw-r--r-- 1 root root 1.1K Feb 28 16:40 footer.htm
-rw-r--r-- 1 root root 381 Feb 28 16:41 index.html
-rw-r--r-- 1 root root 1.1K Feb 28 16:41 favicon.ico
drwxr-xr-x 5 root root 73 Feb 28 19:31 luci-static
drwxr-xr-x 2 root root 63 Feb 28 19:31 err
drwxr-xr-x 2 root root 27 Feb 28 19:31 cgi-bin
lrwxrwxrwx 1 root root 32 Apr 3 19:33 fullflash.bin -> /tmp/youku/mnt/tf2/fullflash.bin
#把其他mtd也备份了,不知道有什么用,有备无患
[root@Youku-router]dd if=/dev/mtd1 of=/tmp/youku/mnt/tf2/Bldr
384+0 records in
384+0 records out
[root@Youku-router]dd if=/dev/mtd2 of=/tmp/youku/mnt/tf2/cnfg
128+0 records in
128+0 records out
[root@Youku-router]dd if=/dev/mtd3 of=/tmp/youku/mnt/tf2/fcty
128+0 records in
128+0 records out
[root@Youku-router]dd if=/dev/mtd4 of=/tmp/youku/mnt/tf2/fw
64896+0 records in
64896+0 records out
[root@Youku-router]dd if=/dev/mtd5 of=/tmp/youku/mnt/tf2/rtfs
61783+1 records in
61783+1 records out
[root@Youku-router]dd if=/dev/mtd6 of=/tmp/youku/mnt/tf2/rtfsd
47360+0 records in
47360+0 records out
[root@Youku-router]cd /tmp
#在本机开一个http服务,把下载好的breed挂上,通过wget下载到路由器
[root@Youku-router]wget http://192.168.11.176/bin/breed-mt7620-youku-yk1.bin
Connecting to 192.168.11.176 (192.168.11.176:80)
breed-mt7620-youku-y 100% |****************************************************| 82370 0:00:00 ETA
[root@Youku-router]ls -tlrh
drwxr-xr-x 2 root root 80 Jan 1 1970 sysinfo
drwxr-xr-x 2 root root 40 Jan 1 1970 overlay
drwxr-xr-x 2 root root 40 Jan 1 1970 extroot
-rw-r--r-- 1 root root 6 Jan 1 1970 TZ
drwxr-xr-x 2 root root 80 Jan 1 1970 state
drwxr-xr-x 2 root root 100 Jan 1 1970 etc
drwxr-xr-x 2 root root 60 Jan 1 1970 nmbd
drwxrwxrwt 11 root root 300 Jan 1 1970 youku
drwxr-xr-x 2 root root 860 Jan 1 1970 luci-modulecache
drwxr-xr-x 2 root root 140 Jan 1 1970 log
-rw-r--r-- 1 root root 21 Jan 1 1970 resolv.conf
drwxr-xr-x 2 root root 60 Jan 1 1970 hosts
-rw------- 1 root root 55.7K Apr 1 21:28 luci-indexcache
-rw-r--r-- 1 root root 90 Apr 1 21:28 802.mt7610.log
-rw-r--r-- 1 root root 162 Apr 1 21:28 wifi.log
-rw-r--r-- 1 root root 16.5K Apr 1 21:28 uci2dat.log
-rw-r--r-- 1 root root 87 Apr 1 21:29 802.mt7620.log
-rw-r--r-- 1 root root 99 Apr 3 04:07 resolv.conf.auto
--w------- 1 root root 146.0K Apr 3 08:12 history
-rw-r--r-- 1 root root 41 Apr 3 08:13 LED_STATUS
-rw-r--r-- 1 root root 238 Apr 3 19:06 dhcp.leases
drwx------ 2 root root 80 Apr 3 19:58 luci-sessions
-rw-r--r-- 1 root root 166 Apr 3 20:04 upnp.leases
drwxr-xr-x 2 root root 220 Apr 3 21:04 run
drwxr-xr-x 2 root root 340 Apr 3 21:06 lock
-rw-r--r-- 1 root root 80.4K Apr 3 21:06 breed-mt7620-youku-yk1.bin
[root@Youku-router]cat /proc/mtd
dev: size erasesize name
mtd0: 02000000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Factory"
mtd4: 01fb0000 00010000 "firmware"
mtd5: 01e2ae8d 00010000 "rootfs"
mtd6: 01720000 00010000 "rootfs_data"
[root@Youku-router]mtd -r write /tmp/breed-mt7620-youku-yk1.bin mtd1
Unlocking mtd1 ...
Writing from /tmp/breed-mt7620-youku-yk1.bin to mtd1 ...
Rebooting ...
[root@Youku-router]
#重启后遇到问题,指示灯许久不亮。拔网线重新差断电,终于等到指示灯亮,问题也来了 http://192.168.1.1 根本不通,也就是breed网页界面打不开,也ping不通
#20150404 21:58,重刷了4月1~3日版breed,都不行
#20150404 22:32 仔细研读了breed作者主页里的进入web说明:
#网线连接主机和路由Lan口
#[进入 Web 刷机模式]
#电脑网络连接设置为自动获取 IP 地址
#打开 CMD,运行 ping 192.168.1.1 -t
#拔电
#按住复位键或者WPS键再给路由通电,如果看到 ping 通即表明进入 Web 刷机模式
#成功ping通!打开IE成功进入web!
|
|