* mkfs.ubifs / ubiformat: Bad UBI magic
@ 2009-10-06 11:00 Tobias Wahlström
2009-10-08 8:51 ` Adrian Hunter
2009-10-08 8:54 ` Adrian Hunter
0 siblings, 2 replies; 4+ messages in thread
From: Tobias Wahlström @ 2009-10-06 11:00 UTC (permalink / raw)
To: linux-mtd
Hi!
This is my first post at this list - I hope it makes (at least) some
sense anyway. I have looked through the mailing archive and searched
using google without finding anything useful on the topic. I hope I
provided the information you need - if not, just tell me what you are
missing!
I'm working on a project where we would like to use ubi and ubifs as
root filesystem since it seems to be the best choise in many ways. But
I have a problem which I can't find anything about either the mail
archive nor using google etc. I currently use linux 2.6.26 with some
patches. My target is the freescale imx255 pdk board. My build system
is Ubuntu 9.04 (run within vmware).
I have cloned the mtd-utils.git (today 2009-09-05) and compiled the
tools both for my build system and my target (both without xattr
support). Then I created a ubifs image using mkfs.ubifs on my build
system and tried to flash it to the nand using ubiformat. The commands
I used was:
build> mkfs.ubifs -m 2048 -e 256KiB -c 384 -U --root rootfs -o rootfs.ubifs
target> flash_eraseall /dev/mtd2
target> ubiformat /dev/mtd2 -s 2048 -v -f rootfs.ubifs
The output from ubiformat is:
ubiformat: mtd2 (nand), size 100663296 bytes (96.0 MiB), 384
eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 2048 bytes
libscan: start scanning eraseblocks 0-384
libscan: scanning eraseblock 0: empty
[...]
libscan: scanning eraseblock 383: empty
libscan: finished, mean EC 0, 0 OK, 0 corrupted, 384 empty, 0 alien, bad 0
ubiformat: 384 eraseblocks are supposedly empty
ubiformat: will write 13 eraseblocks
ubiformat: eraseblock 0: erase, change EC to 0ubiformat: error!: bad
UBI magic 0x31181006, should be 0x55424923
ubiformat: error!: bad EC header at eraseblock 0 of "/rootfs.ubifs"
If I look into the source code I see that UBI_EC_HDR_MAGIC is defined
twice in the source both in include/mtd/ubi-media.h and seems to be
used by all tools except for mkfs.ubifs. The command mkfs.ubifs use
UBIFS_NODE_MAGIC in mkfs.ubifs/ubifs-media.h. The values do not match
at all. And it also seems like mkfs.ubifs use little endian to encode
the magic number and the other tools use big endian... Strange!
/Tobias
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mkfs.ubifs / ubiformat: Bad UBI magic
2009-10-06 11:00 mkfs.ubifs / ubiformat: Bad UBI magic Tobias Wahlström
@ 2009-10-08 8:51 ` Adrian Hunter
2009-10-08 8:54 ` Adrian Hunter
1 sibling, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2009-10-08 8:51 UTC (permalink / raw)
To: Tobias Wahlström
Cc: Bityutskiy Artem (Nokia-M/Helsinki),
linux-mtd@lists.infradead.org
Tobias Wahlström wrote:
> Hi!
>
> This is my first post at this list - I hope it makes (at least) some
> sense anyway. I have looked through the mailing archive and searched
> using google without finding anything useful on the topic. I hope I
> provided the information you need - if not, just tell me what you are
> missing!
>
> I'm working on a project where we would like to use ubi and ubifs as
> root filesystem since it seems to be the best choise in many ways. But
> I have a problem which I can't find anything about either the mail
> archive nor using google etc. I currently use linux 2.6.26 with some
> patches. My target is the freescale imx255 pdk board. My build system
> is Ubuntu 9.04 (run within vmware).
>
> I have cloned the mtd-utils.git (today 2009-09-05) and compiled the
> tools both for my build system and my target (both without xattr
> support). Then I created a ubifs image using mkfs.ubifs on my build
> system and tried to flash it to the nand using ubiformat. The commands
> I used was:
>
> build> mkfs.ubifs -m 2048 -e 256KiB -c 384 -U --root rootfs -o rootfs.ubifs
Try making the -e option the leb-size not the peb-size i.e. probably 252KiB
> target> flash_eraseall /dev/mtd2
> target> ubiformat /dev/mtd2 -s 2048 -v -f rootfs.ubifs
>
> The output from ubiformat is:
>
> ubiformat: mtd2 (nand), size 100663296 bytes (96.0 MiB), 384
> eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 2048 bytes
> libscan: start scanning eraseblocks 0-384
> libscan: scanning eraseblock 0: empty
> [...]
> libscan: scanning eraseblock 383: empty
> libscan: finished, mean EC 0, 0 OK, 0 corrupted, 384 empty, 0 alien, bad 0
> ubiformat: 384 eraseblocks are supposedly empty
> ubiformat: will write 13 eraseblocks
> ubiformat: eraseblock 0: erase, change EC to 0ubiformat: error!: bad
> UBI magic 0x31181006, should be 0x55424923
> ubiformat: error!: bad EC header at eraseblock 0 of "/rootfs.ubifs"
>
> If I look into the source code I see that UBI_EC_HDR_MAGIC is defined
> twice in the source both in include/mtd/ubi-media.h and seems to be
> used by all tools except for mkfs.ubifs. The command mkfs.ubifs use
> UBIFS_NODE_MAGIC in mkfs.ubifs/ubifs-media.h. The values do not match
> at all. And it also seems like mkfs.ubifs use little endian to encode
> the magic number and the other tools use big endian... Strange!
>
> /Tobias
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mkfs.ubifs / ubiformat: Bad UBI magic
2009-10-06 11:00 mkfs.ubifs / ubiformat: Bad UBI magic Tobias Wahlström
2009-10-08 8:51 ` Adrian Hunter
@ 2009-10-08 8:54 ` Adrian Hunter
2009-10-08 8:55 ` Artem Bityutskiy
1 sibling, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2009-10-08 8:54 UTC (permalink / raw)
To: Tobias Wahlström
Cc: Bityutskiy Artem (Nokia-M/Helsinki),
linux-mtd@lists.infradead.org
Tobias Wahlström wrote:
> Hi!
>
> This is my first post at this list - I hope it makes (at least) some
> sense anyway. I have looked through the mailing archive and searched
> using google without finding anything useful on the topic. I hope I
> provided the information you need - if not, just tell me what you are
> missing!
>
> I'm working on a project where we would like to use ubi and ubifs as
> root filesystem since it seems to be the best choise in many ways. But
> I have a problem which I can't find anything about either the mail
> archive nor using google etc. I currently use linux 2.6.26 with some
> patches. My target is the freescale imx255 pdk board. My build system
> is Ubuntu 9.04 (run within vmware).
>
> I have cloned the mtd-utils.git (today 2009-09-05) and compiled the
> tools both for my build system and my target (both without xattr
> support). Then I created a ubifs image using mkfs.ubifs on my build
> system and tried to flash it to the nand using ubiformat. The commands
> I used was:
>
> build> mkfs.ubifs -m 2048 -e 256KiB -c 384 -U --root rootfs -o rootfs.ubifs
> target> flash_eraseall /dev/mtd2
> target> ubiformat /dev/mtd2 -s 2048 -v -f rootfs.ubifs
Also, doesn't ubiformat take a UBI image not a UBIFS image
>
> The output from ubiformat is:
>
> ubiformat: mtd2 (nand), size 100663296 bytes (96.0 MiB), 384
> eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 2048 bytes
> libscan: start scanning eraseblocks 0-384
> libscan: scanning eraseblock 0: empty
> [...]
> libscan: scanning eraseblock 383: empty
> libscan: finished, mean EC 0, 0 OK, 0 corrupted, 384 empty, 0 alien, bad 0
> ubiformat: 384 eraseblocks are supposedly empty
> ubiformat: will write 13 eraseblocks
> ubiformat: eraseblock 0: erase, change EC to 0ubiformat: error!: bad
> UBI magic 0x31181006, should be 0x55424923
> ubiformat: error!: bad EC header at eraseblock 0 of "/rootfs.ubifs"
>
> If I look into the source code I see that UBI_EC_HDR_MAGIC is defined
> twice in the source both in include/mtd/ubi-media.h and seems to be
> used by all tools except for mkfs.ubifs. The command mkfs.ubifs use
> UBIFS_NODE_MAGIC in mkfs.ubifs/ubifs-media.h. The values do not match
> at all. And it also seems like mkfs.ubifs use little endian to encode
> the magic number and the other tools use big endian... Strange!
>
> /Tobias
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mkfs.ubifs / ubiformat: Bad UBI magic
2009-10-08 8:54 ` Adrian Hunter
@ 2009-10-08 8:55 ` Artem Bityutskiy
0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2009-10-08 8:55 UTC (permalink / raw)
To: Hunter Adrian (Nokia-D/Helsinki)
Cc: linux-mtd@lists.infradead.org, Tobias Wahlström
On 10/08/2009 11:54 AM, Hunter Adrian (Nokia-D/Helsinki) wrote:
> Tobias Wahlström wrote:
>> Hi!
>>
>> This is my first post at this list - I hope it makes (at least) some
>> sense anyway. I have looked through the mailing archive and searched
>> using google without finding anything useful on the topic. I hope I
>> provided the information you need - if not, just tell me what you are
>> missing!
>>
>> I'm working on a project where we would like to use ubi and ubifs as
>> root filesystem since it seems to be the best choise in many ways. But
>> I have a problem which I can't find anything about either the mail
>> archive nor using google etc. I currently use linux 2.6.26 with some
>> patches. My target is the freescale imx255 pdk board. My build system
>> is Ubuntu 9.04 (run within vmware).
>>
>> I have cloned the mtd-utils.git (today 2009-09-05) and compiled the
>> tools both for my build system and my target (both without xattr
>> support). Then I created a ubifs image using mkfs.ubifs on my build
>> system and tried to flash it to the nand using ubiformat. The commands
>> I used was:
>>
>> build> mkfs.ubifs -m 2048 -e 256KiB -c 384 -U --root rootfs -o rootfs.ubifs
>> target> flash_eraseall /dev/mtd2
>> target> ubiformat /dev/mtd2 -s 2048 -v -f rootfs.ubifs
>
> Also, doesn't ubiformat take a UBI image not a UBIFS image
Right.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-10-08 8:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-06 11:00 mkfs.ubifs / ubiformat: Bad UBI magic Tobias Wahlström
2009-10-08 8:51 ` Adrian Hunter
2009-10-08 8:54 ` Adrian Hunter
2009-10-08 8:55 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).