* Create, Flash and Mount UBIFS Images @ 2009-04-02 11:36 Manuel Sahm 2009-04-02 11:42 ` Artem Bityutskiy 2009-04-02 12:21 ` Artem Bityutskiy 0 siblings, 2 replies; 9+ messages in thread From: Manuel Sahm @ 2009-04-02 11:36 UTC (permalink / raw) To: linux-mtd Hello, Could anybody explain me how to build an ubi.img that I could flash inside my system ? NAND Flash: Micron 256 MByte Physical Eraseblock Size = 131072 Logical Eraseblock Size = 129024 Min I/O Size = 2048 SubPage = 512 The Partition /dev/mtd6 is 32MByte. I did the following steps: On my host I created the file through: mkfs.ubifs -d /exports/ -m 2048 -e 129024 -o ubifs.img -x "none" -c 2047 ubinize -p 128KiB -m 2048 -s 512 -O 512 -o ubi.img ubi.ini with ubi.ini [TEST] mode=ubi image=ubifs.img vol_id=0 vol_size=3MiB vol_type=dynamic vol_alignment=1 vol_flags=autoresize Then I copy this creted ubi.img to my embedded system. On my embedded system I did: flash_eraseall /dev/mtd6 ubiformat /dev/mtd6 -s 512 -f ubi.img ubiattach /dev/ubi_ctrl -m6 -d6 -O512 mount -t ubifs ubi6_0 /mnt/ubi6 Then at the mount command I got the error: validate_sb: bad superblock So what´s wrong ? Thank you ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Create, Flash and Mount UBIFS Images 2009-04-02 11:36 Create, Flash and Mount UBIFS Images Manuel Sahm @ 2009-04-02 11:42 ` Artem Bityutskiy 2009-04-02 12:07 ` Manuel Sahm [not found] ` <49D4C59A.187F.00BC.1@feig.de> 2009-04-02 12:21 ` Artem Bityutskiy 1 sibling, 2 replies; 9+ messages in thread From: Artem Bityutskiy @ 2009-04-02 11:42 UTC (permalink / raw) To: Manuel Sahm; +Cc: linux-mtd Hi, On Thu, 2009-04-02 at 13:36 +0200, Manuel Sahm wrote: > Hello, > > Could anybody explain me how to build an ubi.img that I could flash > inside my system ? > > NAND Flash: Micron 256 MByte > Physical Eraseblock Size = 131072 > Logical Eraseblock Size = 129024 > Min I/O Size = 2048 > SubPage = 512 > > The Partition /dev/mtd6 is 32MByte. > > > I did the following steps: > On my host I created the file through: > > mkfs.ubifs -d /exports/ -m 2048 -e 129024 -o ubifs.img -x "none" -c > 2047 > ubinize -p 128KiB -m 2048 -s 512 -O 512 -o ubi.img ubi.ini > > with ubi.ini > [TEST] > mode=ubi > image=ubifs.img > vol_id=0 > vol_size=3MiB > vol_type=dynamic > vol_alignment=1 > vol_flags=autoresize > > Then I copy this creted ubi.img to my embedded system. > > On my embedded system I did: > flash_eraseall /dev/mtd6 > ubiformat /dev/mtd6 -s 512 -f ubi.img > ubiattach /dev/ubi_ctrl -m6 -d6 -O512 > mount -t ubifs ubi6_0 /mnt/ubi6 > > Then at the mount command I got the error: > validate_sb: bad superblock > > So what´s wrong ? Could you please try to enable debugging, as it is asked here: http://www.linux-mtd.infradead.org/doc/ubifs.html#L_how_send_bugreport And I do not understand why you did not provide all UBIFS output. The print is: ubifs_err("bad superblock, error %d", err); and you did not provide error code number. -- Best regards, Artem Bityutskiy (Битюцкий Артём) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: Create, Flash and Mount UBIFS Images 2009-04-02 11:42 ` Artem Bityutskiy @ 2009-04-02 12:07 ` Manuel Sahm [not found] ` <49D4C59A.187F.00BC.1@feig.de> 1 sibling, 0 replies; 9+ messages in thread From: Manuel Sahm @ 2009-04-02 12:07 UTC (permalink / raw) To: dedekind; +Cc: linux-mtd Hello, sorry for the previous post without informations... Here are the last two steps I did embedded: [Attach the /dev/mtd6 to ubifs and try to mount it] [Before I did a "flash_eraseall /dev/mtd6" and a "ubiformat /dev/mtd6 -s512 -f ubi.img"] /usr/sbin # ubiattach /dev/ubi_ctrl -m6 -d6 -O512 UBI: attaching mtd6 to ubi6 UBI: physical eraseblock size: 131072 bytes (128 KiB) UBI: logical eraseblock size: 129024 bytes UBI: smallest flash I/O unit: 2048 UBI: sub-page size: 512 UBI: VID header offset: 512 (aligned 512) UBI: data offset: 2048 UBI: attached mtd6 to ubi6 UBI: MTD device name: "Partition 7 - UPDATE : 32 MByte" UBI: MTD device size: 32 MiB UBI: number of good PEBs: 256 UBI: number of bad PEBs: 0 UBI: max. allowed volumes: 128 UBI: wear-leveling threshold: 4096 UBI: number of internal volumes: 1 UBI: number of user volumes: 1 UBI: available PEBs: 233 UBI: total number of reserved PEBs: 23 UBI: number of PEBs reserved for bad PEB handling: 2 UBI: max/mean erase counter: 0/0 UBI: background thread "ubi_bgt6d" started, PID 1336 UBI device number 6, total 256 LEBs (33030144 bytes, 31.5 MiB), available 233 LEBs (30062592 bytes, 28.7 MiB), LEB size 129024 bytes (126.0 KiB) /usr/sbin # mount -t ubifs ubi ubiattach ubidetach ubimirror ubinize ubiupdatevol ubicrc32 ubiformat ubimkvol ubirename ubicrc32.pl ubigen ubinfo ubirmvol /usr/sbin # mount -t ubifs ubi6_0 /mnt/OBIDfs_ubi/ UBIFS: static UBI volume - read-only mode UBIFS error (pid 1391): mount_ubifs: cannot mount read-write - read-only media UBIFS: static UBI volume - read-only mode UBIFS error (pid 1391): validate_sb: bad superblock, error 4 mount: mounting ubi6_0 on /mnt/OBIDfs_ubi/ failed: Invalid argument Any idea why this seems to fail ? By the way if I use: "flash_eraseall /dev/mtd6" "ubiformat /dev/mtd6 -s512" "ubiattach /dev/ubi_ctrl -d6 -m6 -O512" "ubimkvol /dev/ubi6 -m -N "TEST"" "mount -t ubifs ubi6_0 /mnt/ubi/" this works ?? Thank you very much >>> Artem Bityutskiy <dedekind@infradead.org> 02.04.2009 13:42 >>> Hi, On Thu, 2009-04-02 at 13:36 +0200, Manuel Sahm wrote: > Hello, > > Could anybody explain me how to build an ubi.img that I could flash > inside my system ? > > NAND Flash: Micron 256 MByte > Physical Eraseblock Size = 131072 > Logical Eraseblock Size = 129024 > Min I/O Size = 2048 > SubPage = 512 > > The Partition /dev/mtd6 is 32MByte. > > > I did the following steps: > On my host I created the file through: > > mkfs.ubifs -d /exports/ -m 2048 -e 129024 -o ubifs.img -x "none" -c > 2047 > ubinize -p 128KiB -m 2048 -s 512 -O 512 -o ubi.img ubi.ini > > with ubi.ini > [TEST] > mode=ubi > image=ubifs.img > vol_id=0 > vol_size=3MiB > vol_type=dynamic > vol_alignment=1 > vol_flags=autoresize > > Then I copy this creted ubi.img to my embedded system. > > On my embedded system I did: > flash_eraseall /dev/mtd6 > ubiformat /dev/mtd6 -s 512 -f ubi.img > ubiattach /dev/ubi_ctrl -m6 -d6 -O512 > mount -t ubifs ubi6_0 /mnt/ubi6 > > Then at the mount command I got the error: > validate_sb: bad superblock > > So what´s wrong ? Could you please try to enable debugging, as it is asked here: http://www.linux-mtd.infradead.org/doc/ubifs.html#L_how_send_bugreport And I do not understand why you did not provide all UBIFS output. The print is: ubifs_err("bad superblock, error %d", err); and you did not provide error code number. -- Best regards, Artem Bityutskiy (Битюцкий Артём) ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <49D4C59A.187F.00BC.1@feig.de>]
* Re: Antw: Re: Create, Flash and Mount UBIFS Images [not found] ` <49D4C59A.187F.00BC.1@feig.de> @ 2009-04-02 12:20 ` Artem Bityutskiy 0 siblings, 0 replies; 9+ messages in thread From: Artem Bityutskiy @ 2009-04-02 12:20 UTC (permalink / raw) To: Manuel Sahm; +Cc: linux-mtd On Thu, 2009-04-02 at 14:03 +0200, Manuel Sahm wrote: > Hello, sorry for the previous post without informations... > > Here are the last two steps I did embedded: > [Attach the /dev/mtd6 to ubifs and try to mount it] > [Before I did a "flash_eraseall /dev/mtd6" and a "ubiformat /dev/mtd6 > -s512 -f ubi.img"] > > /usr/sbin # ubiattach /dev/ubi_ctrl -m6 -d6 -O512 > UBI: attaching mtd6 to ubi6 > UBI: physical eraseblock size: 131072 bytes (128 KiB) > UBI: logical eraseblock size: 129024 bytes > UBI: smallest flash I/O unit: 2048 > UBI: sub-page size: 512 > UBI: VID header offset: 512 (aligned 512) > UBI: data offset: 2048 > UBI: attached mtd6 to ubi6 This ubi6 is weird. Do you have 6 UBI devices, or this is just because of "-d6"? Could you please try without "-d6"? > UBI: MTD device name: "Partition 7 - UPDATE : 32 MByte" > UBI: MTD device size: 32 MiB > UBI: number of good PEBs: 256 > UBI: number of bad PEBs: 0 > UBI: max. allowed volumes: 128 > UBI: wear-leveling threshold: 4096 > UBI: number of internal volumes: 1 > UBI: number of user volumes: 1 > UBI: available PEBs: 233 > UBI: total number of reserved PEBs: 23 > UBI: number of PEBs reserved for bad PEB handling: 2 > UBI: max/mean erase counter: 0/0 > UBI: background thread "ubi_bgt6d" started, PID 1336 > UBI device number 6, total 256 LEBs (33030144 bytes, 31.5 MiB), > available 233 LEBs (30062592 bytes, 28.7 MiB), LEB size 129024 bytes > (126.0 KiB) > /usr/sbin # mount -t ubifs ubi > ubiattach ubidetach ubimirror ubinize ubiupdatevol > ubicrc32 ubiformat ubimkvol ubirename > ubicrc32.pl ubigen ubinfo ubirmvol > /usr/sbin # mount -t ubifs ubi6_0 /mnt/OBIDfs_ubi/ > UBIFS: static UBI volume - read-only mode In the previous e-mail it was said that the volume is dynamic. Why it is static now? hmm.. > UBIFS error (pid 1391): mount_ubifs: cannot mount read-write - > read-only media > UBIFS: static UBI volume - read-only mode > UBIFS error (pid 1391): validate_sb: bad superblock, error 4 > mount: mounting ubi6_0 on /mnt/OBIDfs_ubi/ failed: Invalid argument Could you please enable UBIFS debugging ? And then send what dmesg says you, not only what you see on the console, please. -- Best regards, Artem Bityutskiy (Битюцкий Артём) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Create, Flash and Mount UBIFS Images 2009-04-02 11:36 Create, Flash and Mount UBIFS Images Manuel Sahm 2009-04-02 11:42 ` Artem Bityutskiy @ 2009-04-02 12:21 ` Artem Bityutskiy 2009-04-03 7:32 ` Manuel Sahm 1 sibling, 1 reply; 9+ messages in thread From: Artem Bityutskiy @ 2009-04-02 12:21 UTC (permalink / raw) To: Manuel Sahm; +Cc: linux-mtd On Thu, 2009-04-02 at 13:36 +0200, Manuel Sahm wrote: > Hello, > > Could anybody explain me how to build an ubi.img that I could flash > inside my system ? > > NAND Flash: Micron 256 MByte > Physical Eraseblock Size = 131072 > Logical Eraseblock Size = 129024 > Min I/O Size = 2048 > SubPage = 512 > > The Partition /dev/mtd6 is 32MByte. > > > I did the following steps: > On my host I created the file through: > > mkfs.ubifs -d /exports/ -m 2048 -e 129024 -o ubifs.img -x "none" -c > 2047 Are you sure -c 2047 is a sane value for a 32MiB volume? -- Best regards, Artem Bityutskiy (Битюцкий Артём) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: Create, Flash and Mount UBIFS Images 2009-04-02 12:21 ` Artem Bityutskiy @ 2009-04-03 7:32 ` Manuel Sahm 2009-04-03 8:30 ` Artem Bityutskiy 0 siblings, 1 reply; 9+ messages in thread From: Manuel Sahm @ 2009-04-03 7:32 UTC (permalink / raw) To: dedekind; +Cc: linux-mtd Hello, thank you for your help. I got something working, but don´t know really what I´ve done: OK, let me gibve you some more information about my sytem: My 256MB NAND Flash is divided into 7 MTD partitions: mtd0: 128KiB (First Level Bootloader) mtd1: 896KiB (UBoot) mtd2: 4MiB (Kernel) mtd3: 40MiB (RFS) mtd4: 20MiB (Private Partition) mtd5: 20 MiB (Private Partition2) mtd6: 32Mib (Backup Partition) Now I at first I need to build an ubi image with mkfs.ubifs and with ubinze on my host. I tried it with this settings: mkfs.ubifs -d /exports/ -m 2048 -e 129024 -c 326 -o RFS.ubifs There is my first question: ---------------------------------------- What about the pramater -c ? In the FAQ: -c 2047: specifies maximum file-system size in logical eraseblocks; this means that it will be possible to use the resulting file-system on volumes up to this size (less or equivalent); so in this particular case, the resulting FS may be put on volumes up to about 251MiB (129024 multiplied by 2047); See this section for more details. So my MTD Partition is 40MiB; Logical Ersablocksize is 129024 Bytes; --> (40MiB / 129024)+1 = c --> c=326 Is this correct ? Now I go on with ubinize: ubinize -p128KiB -m 2048 -s 512 -O 512 -o RFS.ubi config.ini with config.ini: [RFS] mode=ubi image=RFS.ubifs vol_size=30MiB vol_id=0 vol_type=dynamic vol_name=RFS vol_alignment=1 There is my second question: ----------------------------------------- Did I miss something in the ini File ? What about the line vol_flags=autoresize - Do I need this one ? There is my third question: ----------------------------------------- vol_size=30MiB -> The mtd partition is 40MiB, but if I use vol_size=40MiB there appears an error concerning a table ? Which value should I use ? There is my fourth question: ----------------------------------------- Now the ubi image is created -> I flashed it into the nand an put the kernel paramter mtd.ubi in the kernel command line. After the ubi images are attached and mounted, there seems to less memory ? There should by 30MiB instead of 28 MiB ? What about the journal size ? Is my user Memory = UBIFS: file system size - UBIFS: journal size ? UBIFS: recovery needed UBIFS: recovery completed UBIFS: mounted UBI device 0, volume 0, name "RFS" UBIFS: file system size: 30191616 bytes (29484 KiB, 28 MiB, 234 LEBs) UBIFS: journal size: 5548032 bytes (5418 KiB, 5 MiB, 43 LEBs) UBIFS: media format: 4 (latest is 4) UBIFS: default compressor: LZO UBIFS: reserved for root: 0 bytes (0 KiB) VFS: Mounted root (ubifs filesystem). df -h returns Filesystem 1K-blocks Used Available Use% Mounted on ubi0_0 27256 17788 9468 65% / Thank you very much Manuel >>> Artem Bityutskiy <dedekind@infradead.org> 02.04.2009 14:21 >>> On Thu, 2009-04-02 at 13:36 +0200, Manuel Sahm wrote: > Hello, > > Could anybody explain me how to build an ubi.img that I could flash > inside my system ? > > NAND Flash: Micron 256 MByte > Physical Eraseblock Size = 131072 > Logical Eraseblock Size = 129024 > Min I/O Size = 2048 > SubPage = 512 > > The Partition /dev/mtd6 is 32MByte. > > > I did the following steps: > On my host I created the file through: > > mkfs.ubifs -d /exports/ -m 2048 -e 129024 -o ubifs.img -x "none" -c > 2047 Are you sure -c 2047 is a sane value for a 32MiB volume? -- Best regards, Artem Bityutskiy (Битюцкий Артём) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: Create, Flash and Mount UBIFS Images 2009-04-03 7:32 ` Manuel Sahm @ 2009-04-03 8:30 ` Artem Bityutskiy 2009-04-03 10:57 ` Manuel Sahm 0 siblings, 1 reply; 9+ messages in thread From: Artem Bityutskiy @ 2009-04-03 8:30 UTC (permalink / raw) To: Manuel Sahm; +Cc: linux-mtd Hi, On Fri, 2009-04-03 at 09:32 +0200, Manuel Sahm wrote: > Hello, thank you for your help. > I got something working, but don´t know really what I´ve done: > > OK, let me gibve you some more information about my sytem: > > My 256MB NAND Flash is divided into 7 MTD partitions: > mtd0: 128KiB (First Level Bootloader) > mtd1: 896KiB (UBoot) > mtd2: 4MiB (Kernel) > mtd3: 40MiB (RFS) > mtd4: 20MiB (Private Partition) > mtd5: 20 MiB (Private Partition2) > mtd6: 32Mib (Backup Partition) Well, you have so many MTD partitions which is in general bad design. The whole idea of UBI spreading wear evenly across the chip is just not used. But you probably know what you do... > Now I at first I need to build an ubi image with mkfs.ubifs and with > ubinze on my host. I tried it with this settings: > mkfs.ubifs -d /exports/ -m 2048 -e 129024 -c 326 -o RFS.ubifs > > There is my first question: > ---------------------------------------- > What about the pramater -c ? > In the FAQ: -c 2047: specifies maximum file-system size in logical > eraseblocks; this means that it will be possible to use the resulting > file-system on volumes up to this size (less or equivalent); so in this > particular case, the resulting FS may be put on volumes up to about > 251MiB (129024 multiplied by 2047); See this section for more details. Is the description not understandable? If yes, ask specific question please. And also, try this "See this section for more details" link. > So my MTD Partition is 40MiB; Logical Ersablocksize is 129024 Bytes; > --> (40MiB / 129024)+1 = c --> c=326 > Is this correct ? Sounds right. > Now I go on with ubinize: > ubinize -p128KiB -m 2048 -s 512 -O 512 -o RFS.ubi config.ini > with config.ini: > [RFS] > mode=ubi > image=RFS.ubifs > vol_size=30MiB > vol_id=0 > vol_type=dynamic > vol_name=RFS > vol_alignment=1 > > There is my second question: > ----------------------------------------- > Did I miss something in the ini File ? > What about the line vol_flags=autoresize - Do I need this one ? I do not know if you need it or not. First of all try to understand what is autoresize, this is documented at the MTD web site. If you cannot understand, ask specific questions please. > There is my third question: > ----------------------------------------- > vol_size=30MiB -> The mtd partition is 40MiB, but if I use > vol_size=40MiB there appears an error concerning a table ? > Which value should I use ? Volume size is the amount of free space in the volume. There is overhead, which should be taken into account. Volume of size M needs partition of size F, and F > M. The overhead calculation is described on the MTD web site. If you want a volume to take whole partition, the easiest way to do so is to use the "autoresize" flag for this volume, and make the volume 30MiB in this case. Please, read docs to realize why. > There is my fourth question: > ----------------------------------------- > Now the ubi image is created -> I flashed it into the nand an put the > kernel paramter mtd.ubi in the kernel command line. > After the ubi images are attached and mounted, there seems to less > memory ? You mean "flash memory", i guess. > There should by 30MiB instead of 28 MiB ? It is also not clear if you refer UBI volume size or amount of free space in UBIFS. UBIFS sits _inside_ UBI volume. It is encapsulation. It does not affect UBI volume size. > What about the journal size ? > Is my user Memory = UBIFS: file system size - UBIFS: journal size ? No, not really. There are many sources of overhead, and in general UBIFS cannot tell how much space you have. Please, take a look at UBIFS docs: http://www.linux-mtd.infradead.org/doc/ubifs.html#L_spaceacc > UBIFS: recovery needed > UBIFS: recovery completed > UBIFS: mounted UBI device 0, volume 0, name "RFS" > UBIFS: file system size: 30191616 bytes (29484 KiB, 28 MiB, 234 > LEBs) > UBIFS: journal size: 5548032 bytes (5418 KiB, 5 MiB, 43 LEBs) > UBIFS: media format: 4 (latest is 4) > UBIFS: default compressor: LZO > UBIFS: reserved for root: 0 bytes (0 KiB) > VFS: Mounted root (ubifs filesystem). > > df -h returns > Filesystem 1K-blocks Used Available Use% > Mounted on > ubi0_0 27256 17788 9468 65% > / The available part is usually not accurate. -- Best regards, Artem Bityutskiy (Битюцкий Артём) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: Re: Create, Flash and Mount UBIFS Images 2009-04-03 8:30 ` Artem Bityutskiy @ 2009-04-03 10:57 ` Manuel Sahm 2009-04-03 14:41 ` Artem Bityutskiy 0 siblings, 1 reply; 9+ messages in thread From: Manuel Sahm @ 2009-04-03 10:57 UTC (permalink / raw) To: dedekind; +Cc: linux-mtd Hello, concerning the autoresize flag: As far as I understand: If a partition is 40 MiB, I have to set the vol_size < Partition size, and set the autoresize flag to use the whole Partition size of 40 MiB. right ? Is it correct that the resize depends on the value -c of the mkfs.ubifs program ? --> (40MiB / 129024)+1 = c --> c=326 With c=326 the autoresize feature should make the ubifs use the whole partitoon sizue of 40 MiB - right ? concerning the kernel command parameter: Is it possible to define the ubi device number trough the kernel command line argument, like it is possible through the ubiattach program ? Example: ubi.mtd=4 is actually attached to /dev/ubi1 and /dev/ubi1_0. I want to have /dev/ubi4 and /dev/ubi4_0 possible ? Thank you very much. Manuel >>> Artem Bityutskiy <dedekind@infradead.org> 03.04.2009 10:30 >>> Hi, On Fri, 2009-04-03 at 09:32 +0200, Manuel Sahm wrote: > Hello, thank you for your help. > I got something working, but don´t know really what I´ve done: > > OK, let me gibve you some more information about my sytem: > > My 256MB NAND Flash is divided into 7 MTD partitions: > mtd0: 128KiB (First Level Bootloader) > mtd1: 896KiB (UBoot) > mtd2: 4MiB (Kernel) > mtd3: 40MiB (RFS) > mtd4: 20MiB (Private Partition) > mtd5: 20 MiB (Private Partition2) > mtd6: 32Mib (Backup Partition) Well, you have so many MTD partitions which is in general bad design. The whole idea of UBI spreading wear evenly across the chip is just not used. But you probably know what you do... > Now I at first I need to build an ubi image with mkfs.ubifs and with > ubinze on my host. I tried it with this settings: > mkfs.ubifs -d /exports/ -m 2048 -e 129024 -c 326 -o RFS.ubifs > > There is my first question: > ---------------------------------------- > What about the pramater -c ? > In the FAQ: -c 2047: specifies maximum file-system size in logical > eraseblocks; this means that it will be possible to use the resulting > file-system on volumes up to this size (less or equivalent); so in this > particular case, the resulting FS may be put on volumes up to about > 251MiB (129024 multiplied by 2047); See this section for more details. Is the description not understandable? If yes, ask specific question please. And also, try this "See this section for more details" link. > So my MTD Partition is 40MiB; Logical Ersablocksize is 129024 Bytes; > --> (40MiB / 129024)+1 = c --> c=326 > Is this correct ? Sounds right. > Now I go on with ubinize: > ubinize -p128KiB -m 2048 -s 512 -O 512 -o RFS.ubi config.ini > with config.ini: > [RFS] > mode=ubi > image=RFS.ubifs > vol_size=30MiB > vol_id=0 > vol_type=dynamic > vol_name=RFS > vol_alignment=1 > > There is my second question: > ----------------------------------------- > Did I miss something in the ini File ? > What about the line vol_flags=autoresize - Do I need this one ? I do not know if you need it or not. First of all try to understand what is autoresize, this is documented at the MTD web site. If you cannot understand, ask specific questions please. > There is my third question: > ----------------------------------------- > vol_size=30MiB -> The mtd partition is 40MiB, but if I use > vol_size=40MiB there appears an error concerning a table ? > Which value should I use ? Volume size is the amount of free space in the volume. There is overhead, which should be taken into account. Volume of size M needs partition of size F, and F > M. The overhead calculation is described on the MTD web site. If you want a volume to take whole partition, the easiest way to do so is to use the "autoresize" flag for this volume, and make the volume 30MiB in this case. Please, read docs to realize why. > There is my fourth question: > ----------------------------------------- > Now the ubi image is created -> I flashed it into the nand an put the > kernel paramter mtd.ubi in the kernel command line. > After the ubi images are attached and mounted, there seems to less > memory ? You mean "flash memory", i guess. > There should by 30MiB instead of 28 MiB ? It is also not clear if you refer UBI volume size or amount of free space in UBIFS. UBIFS sits _inside_ UBI volume. It is encapsulation. It does not affect UBI volume size. > What about the journal size ? > Is my user Memory = UBIFS: file system size - UBIFS: journal size ? No, not really. There are many sources of overhead, and in general UBIFS cannot tell how much space you have. Please, take a look at UBIFS docs: http://www.linux-mtd.infradead.org/doc/ubifs.html#L_spaceacc > UBIFS: recovery needed > UBIFS: recovery completed > UBIFS: mounted UBI device 0, volume 0, name "RFS" > UBIFS: file system size: 30191616 bytes (29484 KiB, 28 MiB, 234 > LEBs) > UBIFS: journal size: 5548032 bytes (5418 KiB, 5 MiB, 43 LEBs) > UBIFS: media format: 4 (latest is 4) > UBIFS: default compressor: LZO > UBIFS: reserved for root: 0 bytes (0 KiB) > VFS: Mounted root (ubifs filesystem). > > df -h returns > Filesystem 1K-blocks Used Available Use% > Mounted on > ubi0_0 27256 17788 9468 65% > / The available part is usually not accurate. -- Best regards, Artem Bityutskiy (Битюцкий Артём) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: Re: Create, Flash and Mount UBIFS Images 2009-04-03 10:57 ` Manuel Sahm @ 2009-04-03 14:41 ` Artem Bityutskiy 0 siblings, 0 replies; 9+ messages in thread From: Artem Bityutskiy @ 2009-04-03 14:41 UTC (permalink / raw) To: Manuel Sahm; +Cc: linux-mtd On Fri, 2009-04-03 at 12:57 +0200, Manuel Sahm wrote: > Hello, > > concerning the autoresize flag: > > As far as I understand: > If a partition is 40 MiB, I have to set the vol_size < Partition size, > and set the autoresize flag to use the whole Partition size of 40 MiB. > right ? Yes. > Is it correct that the resize depends on the value -c of the mkfs.ubifs > program ? The autoresize is UBI thing. -c is UBIFS thing. Yes, -c defines maximum UBIFS size in LEBs. Make it larger, e.g. -c 511 if you are concerned. > --> (40MiB / 129024)+1 = c --> c=326 > With c=326 the autoresize feature should make the ubifs use the whole > partitoon sizue of 40 MiB - right ? Not exactly. But kind of. You should distinguish between UBI and UBIFS - they are different thing. UBIFS does not know anuthing about MTD partition, it knows only about UBI space, which is less than partition space. But just use -c511, it is safe. UBIFS overhead increases considerably when this -c value goes over a power-of-2 boundary. So there is not that much difference between -c 326 and -c 512. > concerning the kernel command parameter: > Is it possible to define the ubi device number trough the kernel > command line argument, like it is possible through the ubiattach program > ? > Example: ubi.mtd=4 is actually attached to /dev/ubi1 and /dev/ubi1_0. > I want to have /dev/ubi4 and /dev/ubi4_0 > > possible ? Hmm, not really. We did not think about this. May be you may add this feature - should not be too difficult. -- Best regards, Artem Bityutskiy (Битюцкий Артём) ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-04-03 15:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-02 11:36 Create, Flash and Mount UBIFS Images Manuel Sahm
2009-04-02 11:42 ` Artem Bityutskiy
2009-04-02 12:07 ` Manuel Sahm
[not found] ` <49D4C59A.187F.00BC.1@feig.de>
2009-04-02 12:20 ` Antw: " Artem Bityutskiy
2009-04-02 12:21 ` Artem Bityutskiy
2009-04-03 7:32 ` Manuel Sahm
2009-04-03 8:30 ` Artem Bityutskiy
2009-04-03 10:57 ` Manuel Sahm
2009-04-03 14:41 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox