[問題] mtdblock 到 file system的大小變化
我用的是openwrt,硬體是TP-WDR3500。
http://wiki.openwrt.org/doc/techref/flash.layout
根據openwrt提供的flash layout,/rom size = mtd2 size - mtd3 size
而從我的/proc/partitions來看
major minor #blocks name
31 0 128 mtdblock0
31 1 1083 mtdblock1
31 2 6916 mtdblock2
31 3 5056 mtdblock3
31 4 64 mtdblock4
31 5 8000 mtdblock5
/rom size 應該是 6916 - 5056 = 1860
但是實際df的結果
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 5056 276 4780 5% /
/dev/root 2048 2048 0 100% /rom
tmpfs 63160 68 63092 0% /tmp
/dev/mtdblock3 5056 276 4780 5% /overlay
overlayfs:/overlay 5056 276 4780 5% /
tmpfs 512 0 512 0% /dev
/rom size 卻是 2048
是什麼樣的原因導致這樣的差別呢?
謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.219.255.69
※ 文章網址: http://www.ptt.cc/bbs/LinuxDev/M.1413858803.A.B75.html
→
10/22 07:33, , 1F
10/22 07:33, 1F
從df得到的rootfs的大小來看block size應該也是1K
從dmesg來換算也是如此
[ 0.710000] Creating 5 MTD partitions on "spi0.0":
[ 0.720000] 0x000000000000-0x000000020000 : "u-boot"
[ 0.720000] 0x000000020000-0x00000012ed38 : "kernel"
[ 0.730000] mtd: partition "kernel" must either start or end on erase
block boundary or be smaller than an erase block -- forcing read-only
[ 0.740000] 0x00000012ed38-0x0000007f0000 : "rootfs"
[ 0.750000] mtd: partition "rootfs" must either start or end on erase
block boundary or be smaller than an erase block -- forcing read-only
[ 0.760000] mtd: device 2 (rootfs) set to be root filesystem
[ 0.770000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.770000] 0x000000300000-0x0000007f0000 : "rootfs_data"
[ 0.780000] 0x0000007f0000-0x000000800000 : "art"
[ 0.790000] 0x000000020000-0x0000007f0000 : "firmware"
※ 編輯: hl4 (61.219.255.69), 10/22/2014 09:44:46
→
10/22 11:21, , 2F
10/22 11:21, 2F
→
10/22 11:22, , 3F
10/22 11:22, 3F
千萬別這麼說,我在embedded linux完全是新手,能得到意見或是討論我就很高興了:D
不太懂1860被吃掉兩個block之後,為什麼會變多為2048
真的這樣變的話,不就占用到其他的分割區了嗎?
另外,有沒有什麼方法能讓我驗證這個想法呢,謝謝
推
10/22 13:38, , 4F
10/22 13:38, 4F
root@OpenWrt:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00010000 "u-boot"
mtd1: 0010ed38 00010000 "kernel"
mtd2: 006c12c8 00010000 "rootfs"
mtd3: 004f0000 00010000 "rootfs_data"
mtd4: 00010000 00010000 "art"
mtd5: 007d0000 00010000 "firmware"
erasesize 應該是 64K
※ 編輯: hl4 (61.219.255.69), 10/22/2014 16:35:08
→
10/22 21:15, , 5F
10/22 21:15, 5F
→
10/22 21:15, , 6F
10/22 21:15, 6F
→
10/22 22:49, , 7F
10/22 22:49, 7F
rootfs是 overlayfs,其下包含/rom (SquashFS) 和rootfs_data (JFFS2)
我不知道你說的有沒有可能發生,不過也不知道怎麼確認是不是這麼回事
※ 編輯: hl4 (61.219.255.69), 10/23/2014 09:27:53
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
LinuxDev 近期熱門文章
PTT數位生活區 即時熱門文章