* ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8
@ 2009-08-20 3:59 Aras Vaichas
2009-08-20 11:10 ` Adrian Hunter
2009-08-21 4:59 ` Artem Bityutskiy
0 siblings, 2 replies; 5+ messages in thread
From: Aras Vaichas @ 2009-08-20 3:59 UTC (permalink / raw)
To: MTD-LIST
Hi,
I've got UBI + UBIFS running as my root partition with 2.6.30, and I'm
using mtd-utils from git downloaded just last week.
I'm building my UBI image as per the instructions at:
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs
I have successfully created UBI images, formatted, attached and
mounted them. I'm not an expert, but I'm familiar with the procedure
now.
For some reason, I am now having problems mounting a known working
image. The image contains 1 file with a "hello world" text string in
it. I used to be able to mount it to my 8MB spare partition, but now
it fails with:
/root # mount -t ubifs ubi1:spareubi /mnt
UBIFS error (pid 791): validate_sb: bad superblock, error 8
mount: mounting ubi1:spareubi on /mnt failed: Invalid argument
The strange thing is that I can format, attach and mount this *same*
image to my other spare partition. It's like the NAND in this
partition has some problem.
Here are the details:
# cat /proc/mtd
dev: size erasesize name
mtd0: 00a00000 00020000 "Bootloader Area"
mtd1: 03600000 00020000 "Main root filing system partition"
mtd2: 00800000 00020000 "Spare Partition 1"
mtd3: 1b800000 00020000 "Spare Partition 2"
mtd4: 03310800 0001f800 "rootubi"
(*) Attempt to write to the first partition (this fails)
/root # ubiformat /dev/mtd2 -f ubi.img
ubiformat: mtd2 (nand), size 8388608 bytes (8.0 MiB), 64 eraseblocks
of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 63 -- 100 % complete
ubiformat: 64 eraseblocks have valid erase counter, mean value is 1
ubiformat: flashing eraseblock 15 -- 100 % complete
ubiformat: formatting eraseblock 63 -- 100 % complete
/root # ubiattach /dev/ubi_ctrl -m 2
UBI: attaching mtd2 to ubi1
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: volume 0 ("spareubi") re-sized from 17 to 58 LEBs
UBI: attached mtd2 to ubi1
UBI: MTD device name: "Spare Partition 1"
UBI: MTD device size: 8 MiB
UBI: number of good PEBs: 64
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: 0
UBI: total number of reserved PEBs: 64
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 4/2
UBI: background thread "ubi_bgt1d" started, PID 807
UBI device number 1, total 64 LEBs (8257536 bytes, 7.9 MiB), available
0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
/root # mount -t ubifs ubi1:spareubi /mnt
UBIFS error (pid 823): validate_sb: bad superblock, error 8
mount: mounting ubi1:spareubi on /mnt failed: Invalid argument
/root # ubidetach /dev/ubi_ctrl -m 2
UBI: mtd2 is detached from ubi1
(*) Attempt to write to the second partition (this works)
/root # ubiformat /dev/mtd3 -f ubi.img
ubiformat: mtd3 (nand), size 461373440 bytes (440.0 MiB), 3520
eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 3519 -- 100 % complete ock 2048 -- 58 % complete
ubiformat: 3519 eraseblocks have valid erase counter, mean value is 1
ubiformat: 1 bad eraseblocks found, numbers: 989
ubiformat: flashing eraseblock 15 -- 100 % complete
ubiformat: formatting eraseblock 3519 -- 100 % complete aseblock 3422
-- 97 % complete
/root # ubiattach /dev/ubi_ctrl -m 3
UBI: attaching mtd3 to ubi1
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: volume 0 ("spareubi") re-sized from 17 to 3410 LEBs
UBI: attached mtd3 to ubi1
UBI: MTD device name: "Spare Partition 2"
UBI: MTD device size: 440 MiB
UBI: number of good PEBs: 3519
UBI: number of bad PEBs: 1
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: 0
UBI: total number of reserved PEBs: 3519
UBI: number of PEBs reserved for bad PEB handling: 105
UBI: max/mean erase counter: 3/2
UBI: background thread "ubi_bgt1d" started, PID 835
UBI device number 1, total 3519 LEBs (454035456 bytes, 433.0 MiB),
available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
/root # mount -t ubifs ubi1:spareubi /mnt
UBIFS: mounted UBI device 1, volume 0, name "spareubi"
UBIFS: file system size: 262692864 bytes (256536 KiB, 250 MiB, 2036 LEBs)
UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 0 bytes (0 KiB)
# cat /mnt/README.txt
Hello World!
Aras
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8
2009-08-20 3:59 ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8 Aras Vaichas
@ 2009-08-20 11:10 ` Adrian Hunter
2009-08-21 2:05 ` Aras Vaichas
2009-08-21 4:59 ` Artem Bityutskiy
1 sibling, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2009-08-20 11:10 UTC (permalink / raw)
To: Aras Vaichas; +Cc: Bityutskiy Artem (Nokia-M/Helsinki), MTD-LIST
Aras Vaichas wrote:
> I've got UBI + UBIFS running as my root partition with 2.6.30, and I'm
> using mtd-utils from git downloaded just last week.
>
> I'm building my UBI image as per the instructions at:
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs
>
> I have successfully created UBI images, formatted, attached and
> mounted them. I'm not an expert, but I'm familiar with the procedure
> now.
>
> For some reason, I am now having problems mounting a known working
> image. The image contains 1 file with a "hello world" text string in
> it. I used to be able to mount it to my 8MB spare partition, but now
> it fails with:
>
> /root # mount -t ubifs ubi1:spareubi /mnt
> UBIFS error (pid 791): validate_sb: bad superblock, error 8
> mount: mounting ubi1:spareubi on /mnt failed: Invalid argument
>
> The strange thing is that I can format, attach and mount this *same*
> image to my other spare partition. It's like the NAND in this
> partition has some problem.
>
> Here are the details:
>
> # cat /proc/mtd
> dev: size erasesize name
> mtd0: 00a00000 00020000 "Bootloader Area"
> mtd1: 03600000 00020000 "Main root filing system partition"
> mtd2: 00800000 00020000 "Spare Partition 1"
> mtd3: 1b800000 00020000 "Spare Partition 2"
> mtd4: 03310800 0001f800 "rootubi"
>
> (*) Attempt to write to the first partition (this fails)
>
> /root # ubiformat /dev/mtd2 -f ubi.img
> ubiformat: mtd2 (nand), size 8388608 bytes (8.0 MiB), 64 eraseblocks
> of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
> libscan: scanning eraseblock 63 -- 100 % complete
> ubiformat: 64 eraseblocks have valid erase counter, mean value is 1
> ubiformat: flashing eraseblock 15 -- 100 % complete
> ubiformat: formatting eraseblock 63 -- 100 % complete
>
> /root # ubiattach /dev/ubi_ctrl -m 2
> UBI: attaching mtd2 to ubi1
> 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: volume 0 ("spareubi") re-sized from 17 to 58 LEBs
> UBI: attached mtd2 to ubi1
> UBI: MTD device name: "Spare Partition 1"
> UBI: MTD device size: 8 MiB
> UBI: number of good PEBs: 64
> 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: 0
> UBI: total number of reserved PEBs: 64
> UBI: number of PEBs reserved for bad PEB handling: 2
> UBI: max/mean erase counter: 4/2
> UBI: background thread "ubi_bgt1d" started, PID 807
> UBI device number 1, total 64 LEBs (8257536 bytes, 7.9 MiB), available
> 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
>
> /root # mount -t ubifs ubi1:spareubi /mnt
> UBIFS error (pid 823): validate_sb: bad superblock, error 8
> mount: mounting ubi1:spareubi on /mnt failed: Invalid argument
The journal is too big for the partition - see below where it
says:
UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
You will need to force the journal smaller using mkfs.ubifs -j
option.
>
> /root # ubidetach /dev/ubi_ctrl -m 2
> UBI: mtd2 is detached from ubi1
>
> (*) Attempt to write to the second partition (this works)
>
> /root # ubiformat /dev/mtd3 -f ubi.img
> ubiformat: mtd3 (nand), size 461373440 bytes (440.0 MiB), 3520
> eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
> libscan: scanning eraseblock 3519 -- 100 % complete ock 2048 -- 58 % complete
> ubiformat: 3519 eraseblocks have valid erase counter, mean value is 1
> ubiformat: 1 bad eraseblocks found, numbers: 989
> ubiformat: flashing eraseblock 15 -- 100 % complete
> ubiformat: formatting eraseblock 3519 -- 100 % complete aseblock 3422
> -- 97 % complete
>
> /root # ubiattach /dev/ubi_ctrl -m 3
> UBI: attaching mtd3 to ubi1
> 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: volume 0 ("spareubi") re-sized from 17 to 3410 LEBs
> UBI: attached mtd3 to ubi1
> UBI: MTD device name: "Spare Partition 2"
> UBI: MTD device size: 440 MiB
> UBI: number of good PEBs: 3519
> UBI: number of bad PEBs: 1
> 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: 0
> UBI: total number of reserved PEBs: 3519
> UBI: number of PEBs reserved for bad PEB handling: 105
> UBI: max/mean erase counter: 3/2
> UBI: background thread "ubi_bgt1d" started, PID 835
> UBI device number 1, total 3519 LEBs (454035456 bytes, 433.0 MiB),
> available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
>
> /root # mount -t ubifs ubi1:spareubi /mnt
> UBIFS: mounted UBI device 1, volume 0, name "spareubi"
> UBIFS: file system size: 262692864 bytes (256536 KiB, 250 MiB, 2036 LEBs)
> UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
> UBIFS: media format: w4/r0 (latest is w4/r0)
> UBIFS: default compressor: lzo
> UBIFS: reserved for root: 0 bytes (0 KiB)
>
> # cat /mnt/README.txt
> Hello World!
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8
2009-08-20 11:10 ` Adrian Hunter
@ 2009-08-21 2:05 ` Aras Vaichas
2009-08-21 5:41 ` Artem Bityutskiy
0 siblings, 1 reply; 5+ messages in thread
From: Aras Vaichas @ 2009-08-21 2:05 UTC (permalink / raw)
To: Adrian Hunter; +Cc: Bityutskiy Artem (Nokia-M/Helsinki), MTD-LIST
On Thu, Aug 20, 2009 at 9:10 PM, Adrian Hunter<adrian.hunter@nokia.com> wrote:
> Aras Vaichas wrote:
>
>> /root # mount -t ubifs ubi1:spareubi /mnt
>> UBIFS error (pid 823): validate_sb: bad superblock, error 8
>> mount: mounting ubi1:spareubi on /mnt failed: Invalid argument
>
> The journal is too big for the partition - see below where it
> says:
>
> UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
>
> You will need to force the journal smaller using mkfs.ubifs -j
> option.
Yes, that works.
I see my problem now. From mkfs.ubifs.c:
/* Make the journal about 12.5% of main area lebs */
c->max_bud_bytes = (lebs / 8) * (long long)c->leb_size;
/* Make the max journal size 8MiB */
if (c->max_bud_bytes > 8 * 1024 * 1024)
c->max_bud_bytes = 8 * 1024 * 1024;
if (c->max_bud_bytes < 4 * c->leb_size)
c->max_bud_bytes = 4 * c->leb_size;
The journal size is calculated based on the maximum FS size.
This means that the *minimum" ubifs size is a function of the
*maximum* UBIFS size. Interesting.
I chose an 8MB partition because I'm doing a lot of testing for a
factory/production flashing system, so I don't want to wait long while
I go through lots of erase/write/attach/mount cycles. Since this is
unusual, I won't worry too much about it.
Would there be a benefit to set a small fixed journal size, regardless
of UBIFS maximum size, for embedded systems?
Aras
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8
2009-08-21 2:05 ` Aras Vaichas
@ 2009-08-21 5:41 ` Artem Bityutskiy
0 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2009-08-21 5:41 UTC (permalink / raw)
To: Aras Vaichas; +Cc: Bityutskiy Artem (Nokia-M/Helsinki), MTD-LIST, Adrian Hunter
On 08/21/2009 05:05 AM, Aras Vaichas wrote:
> Yes, that works.
>
> I see my problem now. From mkfs.ubifs.c:
>
> /* Make the journal about 12.5% of main area lebs */
> c->max_bud_bytes = (lebs / 8) * (long long)c->leb_size;
> /* Make the max journal size 8MiB */
> if (c->max_bud_bytes> 8 * 1024 * 1024)
> c->max_bud_bytes = 8 * 1024 * 1024;
> if (c->max_bud_bytes< 4 * c->leb_size)
> c->max_bud_bytes = 4 * c->leb_size;
>
> The journal size is calculated based on the maximum FS size.
> This means that the *minimum" ubifs size is a function of the
> *maximum* UBIFS size. Interesting.
:-) Well, you may specify the size you want explicitly.
> I chose an 8MB partition because I'm doing a lot of testing for a
> factory/production flashing system, so I don't want to wait long while
> I go through lots of erase/write/attach/mount cycles. Since this is
> unusual, I won't worry too much about it.
You may create another image for this.
> Would there be a benefit to set a small fixed journal size, regardless
> of UBIFS maximum size, for embedded systems?
May be. We did not experiment much with the journal size. If you could
benchmark different journal sizes for different volume sizes and show
what would that small fixed journal size be, we could do what you suggest,
I think.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8
2009-08-20 3:59 ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8 Aras Vaichas
2009-08-20 11:10 ` Adrian Hunter
@ 2009-08-21 4:59 ` Artem Bityutskiy
1 sibling, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2009-08-21 4:59 UTC (permalink / raw)
To: Aras Vaichas; +Cc: MTD-LIST
On 08/20/2009 06:59 AM, Aras Vaichas wrote:
> Hi,
>
> I've got UBI + UBIFS running as my root partition with 2.6.30, and I'm
> using mtd-utils from git downloaded just last week.
>
> I'm building my UBI image as per the instructions at:
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs
>
> I have successfully created UBI images, formatted, attached and
> mounted them. I'm not an expert, but I'm familiar with the procedure
> now.
>
> For some reason, I am now having problems mounting a known working
> image. The image contains 1 file with a "hello world" text string in
> it. I used to be able to mount it to my 8MB spare partition, but now
> it fails with:
>
> /root # mount -t ubifs ubi1:spareubi /mnt
> UBIFS error (pid 791): validate_sb: bad superblock, error 8
> mount: mounting ubi1:spareubi on /mnt failed: Invalid argument
>
> The strange thing is that I can format, attach and mount this *same*
> image to my other spare partition. It's like the NAND in this
> partition has some problem.
Just create 2 images - one for your 250MiB volume, the other one
for your 8MiB volume. There are several UBIFS parameters which
depend on the volume size, e.g., you may read this:
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_max_leb_cnt
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-08-21 5:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-20 3:59 ubifs mount problem: UBIFS error (pid 1152): validate_sb: bad superblock, error 8 Aras Vaichas
2009-08-20 11:10 ` Adrian Hunter
2009-08-21 2:05 ` Aras Vaichas
2009-08-21 5:41 ` Artem Bityutskiy
2009-08-21 4:59 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox