* 현재 yaffs2가 마운트는 되는데 파일 쓰기 중 에러납니다.
아래 설정 및 실행결과를 올립니다.
어떻게 해결해야 되는지 아시면 좀 알려주시면 감사하겠습니다.
* 환경은 다음과 같습니다.
- CPU : PXA320
- Kernel Ver : 2.6.21
- NAND : K9F1G08U0B
* <Kernel Root>/drivers/mtd/nand/pxa3xx_nand.c : 커널 파티션 설정
--------------------------------------------------------------------------------------
/*
* BootRom and XDB will use last 127 block,
and they will keep all the status
* of the bootloader and image, so skip the
first 2M size and last 2M size
*/
static struct mtd_partition
partition_info[] = {
{
name:
"Bootloader",
offset: 0,
mask_flags: MTD_WRITEABLE /* force read-only */
},{
name: "Kernel",
size: 0x00200000,
mask_flags: MTD_WRITEABLE /*
force read-only */
},{
name:
"Filesystem",
size: 0x03000000, /* only mount
48M fs */
offset: 0x00240000,
},
{
name: "MassStorage",
size: 0x0, /* It will be set at probe function */
offset: MTDPART_OFS_APPEND /* Append after fs section */
},
{
name: "BBT",
size:
0x0, /* It will be set at probe function */
offset:
MTDPART_OFS_APPEND,/* Append after fs section */
mask_flags: MTD_WRITEABLE /* force read-only */
}
};
* 실행 결과
--------------------------------------------------------------------------------------
[root@MV320 /proc]#cat filesystems
nodev
sysfs
nodev rootfs
nodev bdev
nodev proc
nodev
sockfs
nodev pipefs
nodev futexfs
nodev tmpfs
nodev
inotifyfs
nodev eventpollfs
nodev devpts
ext2
nodev
ramfs
msdos
vfat
nodev nfs
nodev nfs4
nodev
jffs2
yaffs
yaffs2
nodev rpc_pipefs
[root@MV320 /root]#cat /proc/partitions
major
minor #blocks name
31 0 256 mtdblock0
31 1
2048 mtdblock1
31 2 49152 mtdblock2
31 3 62848
mtdblock3
31 4 512 mtdblock4
[root@MV320 /root]#cat /proc/mtd
dev:
size erasesize name
mtd0: 00040000 00020000 "Bootloader"
mtd1: 00200000
00020000 "Kernel"
mtd2: 03000000 00020000 "Filesystem"
mtd3: 03d60000
00020000 "MassStorage"
mtd4: 00080000 00020000 "BBT"
[root@MV320 /root]#ls /dev/
0 dspW0 hda6 mixer mtdblock3
tty2
123 dspW1 hda7 mixer0 mtdblock4
tty3
GPIO dspW2 hda8 mixer1 mtdblock5
tty4
GPS dspW3 hdb mixer2 null
tty5
audio dspdefault hdb1 mixer3 psaux
tty6
audio0 f3d2k hdb2 mmca ptmx
tty7
audio1 fb hdb3 mmca1 pts
tty8
audio2 fb0 hdb4 mmca2 ram0
ttyACM0
audio3 fb1 hdb5 mmca3 ram1
ttyP0
audioctl fb2 hdb6 mmca4 ram2
ttyP1
c fb3 hdb7 mmca5 ram3
ttyP2
console fb4 hdb8 mmca6 random
ttyP3
cusa0 fb5 initctl mmca7 root
ttyS0
cusa1 fb6 input mmcb rtc0
ttyS1
cusa2 fb7 ipmc mmcb1 sda
ttyS2
dmb flh0 ixs_oscr mmcb2 sda1
ttySA0
dmfm flh1 kmem mmcb3 sda5
ttySA1
dmfm0 flh2 loop0 mmcb4 sequencer
ttySA2
dpmc flh3 loop1 mmcb5 snd
urandom
dsp hda mem mmcb6 sndstat
video
dsp0 hda1 midi mmcb7 tact
video0
dsp1 hda2 midi00 mmcblk0p1 touchscreen
zero
dsp2 hda3 midi01 mtdblock0 tty
dsp3
hda4 midi02 mtdblock1 tty0
dspW hda5
midi03 mtdblock2 tty1
[root@MV320 /root]#mount
/dev/mtdblock2 on /
type jffs2 (rw)
none on /tmp type ramfs (rw)
none on /proc type proc
(rw)
none on /dev/pts type devpts (rw)
sysfs on /sys type sysfs
(rw)
tmpfs on /tmpfs type tmpfs (rw)
[root@MV320 /proc]#df
Filesystem 1k-blocks Used Available Use% Mounted
on
/dev/mtdblock2 49152 46320 2832 94%
/
tmpfs 24576 0 24576 0% /tmpfs
[root@MV320 /proc]#mount -t yaffs2 /dev/mtdblock3
/mnt2
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags
""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs_read_super:
isCheckpointed 0
[root@MV320 bin]#ls -al 1.wav
-rw-r--r-- 1
root root 3354178 Jan 1 1970 1.wav
[root@MV320 bin]#cp 1.wav /mnt2
yaffs tragedy:
no more erased blocks
!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
yaffs
tragedy: no more erased blocks
!!!!!!!!! Allocator out
!!!!!!!!!!!!!!!!!
...
한참 나옴
[root@MV320 bin]#ls -al /mnt2
drw-rw-rw- 1
root root 2048 Aug 2 09:17 .
drwxr-xr-x 19 root
root 0 Jan 1 1970 ..
-rw-r--r-- 1 root root 126976
Aug 2 09:17 1.wav
drw-rw-rw- 1 root root 2048 Aug 2 09:15
lost+found
[root@MV320 bin]#df
Filesystem
1k-blocks Used Available Use% Mounted on
/dev/mtdblock2
49152 46320 2832 94% /
tmpfs 24576 0
24576 0% /tmpfs
/dev/mtdblock3 62848 1280 61568 2%
/mnt2
[root@MV320 bin]#cat /proc/yaffs
YAFFS built:Aug 2 2009
09:08:20
$Id: yaffs_fs.c,v 1.81 2009/05/26 01:22:44 charles Exp $
$Id:
yaffs_guts.c,v 1.87 2009/07/29 04:30:24 charles Exp $
Device 0 "MassStorage"
startBlock......... 0
endBlock...........
490
totalBytesPerChunk. 2048
nDataBytesPerChunk.
2048
chunkGroupBits..... 0
chunkGroupSize..... 1
nErasedBlocks......
0
nReservedBlocks.... 5
blocksInCheckpoint. 0
nTnodesCreated.....
100
nFreeTnodes........ 95
nObjectsCreated.... 200
nFreeObjects.......
95
nFreeChunks........ 31360
nPageWrites........ 0
nPageReads.........
0
nBlockErasures..... 1
nGCCopies.......... 0
garbageCollections.
0
passiveGCs......... 0
nRetriedWrites..... 0
nShortOpCaches.....
10
nRetireBlocks...... 0
eccFixed........... 0
eccUnfixed.........
0
tagsEccFixed....... 0
tagsEccUnfixed..... 0
cacheHits..........
0
nDeletedFiles...... 0
nUnlinkedFiles..... 0
nBackgroudDeletions
0
useNANDECC......... 1
isYaffs2........... 1
inbandTags.........
0
[root@MV320 /root]#umount /mnt2
save exit: isCheckpointed 0
save
exit: isCheckpointed 0
[root@MV320 /root]#cat /proc/yaffs
YAFFS built:Aug 2 2009
09:08:20
$Id: yaffs_fs.c,v 1.81 2009/05/26 01:22:44 charles Exp $
$Id:
yaffs_guts.c,v 1.87 2009/07/29 04:30:24 charles Exp $
[root@MV320 /root]#./flash_eraseall /dev/mtd3
./flash_eraseall:
/dev/mtd3: No such file or directory
[root@MV320 /root]#./flash_eraseall /dev/mtdblock3
./flash_eraseall:
/dev/mtdblock3: unable to get MTD device info