All of lore.kernel.org
 help / color / mirror / Atom feed
* System recovery
@ 2018-05-09  8:31 Enrico Bonomi
  2018-05-09  9:25 ` Martin Townsend
  0 siblings, 1 reply; 5+ messages in thread
From: Enrico Bonomi @ 2018-05-09  8:31 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1807 bytes --]

Hi,

I work with Yocto Poky 1.7.3 on an imx6 dual lite SOM. I recently came
across a problem with a preexisting system. Infact in a couple of cases,
after about one year of work with no problems, file system results
corrupted and the machine can't work. So i decide to implement a recovery
system that can intervene in theese cases. An sd card is mounted on my
board, so i think that i can use it to act this process. Using gparted i
create a partition on sd card that can store my recovery file system.
This partition starts at block 1581056 (so 0x00182000), every block has a
size of 512 bytes and the file system size is 370262016 bytes (so
0x1611c000) that are 723168 blocks (so 0x000b08e0).
In the u-boot i do the following instructions:

nand erase.part rootfs
ubi part rootfs
ubi create rootfs
mmc dev 0
mmc read 12000000 0x00182000  0x000b08e0
ubi write 12000000 rootfs 0x1611c000
ubifsmount ubi0:rootfs

and this instruction results in the following errors:

UBIFS error (pid 0): ubifs_read_node: bad node type (0 but expected 6)
UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
'ubi0:rootfs' errno=-22!

ubifsmount - mount UBIFS volume

Usage:
ubifsmount <volume-name>
   - mount 'volume-name' volume

the strange thing is that when i first program all new devices i use the
following instruction:

tftpboot prall

and prall is the compiled of a txt file which, when programming file system
use the same instructions, obviously except for

tftp 12000000 rootfs.ubifs

instead of my mmc instructions, and

ubi write 12000000 rootfs ${filesize}

but from what i understand the "filesize" variable is set from the tftp
instruction

Where do i fail?

Thanks

Enrico

[-- Attachment #2: Type: text/html, Size: 9602 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: System recovery
  2018-05-09  8:31 System recovery Enrico Bonomi
@ 2018-05-09  9:25 ` Martin Townsend
       [not found]   ` <CALmqtKanTeT72ZgoLTnHX44vAFm2=ybLeRET5cv=Myb+03t+4A@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Townsend @ 2018-05-09  9:25 UTC (permalink / raw)
  To: Enrico Bonomi; +Cc: Yocto Project Discussion

Hi Enrico,

UBI is only designed to work on raw NAND using the MTD subsystem.  MMC
will be a standard block device as the SD card will have Flash
Translation layer. See the excellent MTD website for more info
http://www.linux-mtd.infradead.org/doc/ubi.html

In Yocto I believe you can use "sdcard" in the IMAGE_FSTYPES for a
flashable image for SD cards that can be used with U-Boot.

-Martin.


On Wed, May 9, 2018 at 9:31 AM, Enrico Bonomi <enrico.bonomi92@gmail.com> wrote:
> Hi,
>
> I work with Yocto Poky 1.7.3 on an imx6 dual lite SOM. I recently came
> across a problem with a preexisting system. Infact in a couple of cases,
> after about one year of work with no problems, file system results corrupted
> and the machine can't work. So i decide to implement a recovery system that
> can intervene in theese cases. An sd card is mounted on my board, so i think
> that i can use it to act this process. Using gparted i create a partition on
> sd card that can store my recovery file system.
> This partition starts at block 1581056 (so 0x00182000), every block has a
> size of 512 bytes and the file system size is 370262016 bytes (so
> 0x1611c000) that are 723168 blocks (so 0x000b08e0).
> In the u-boot i do the following instructions:
>
> nand erase.part rootfs
> ubi part rootfs
> ubi create rootfs
> mmc dev 0
> mmc read 12000000 0x00182000  0x000b08e0
> ubi write 12000000 rootfs 0x1611c000
> ubifsmount ubi0:rootfs
>
> and this instruction results in the following errors:
>
> UBIFS error (pid 0): ubifs_read_node: bad node type (0 but expected 6)
> UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
> UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
> 'ubi0:rootfs' errno=-22!
>
> ubifsmount - mount UBIFS volume
>
> Usage:
> ubifsmount <volume-name>
>    - mount 'volume-name' volume
>
> the strange thing is that when i first program all new devices i use the
> following instruction:
>
> tftpboot prall
>
> and prall is the compiled of a txt file which, when programming file system
> use the same instructions, obviously except for
>
> tftp 12000000 rootfs.ubifs
>
> instead of my mmc instructions, and
>
> ubi write 12000000 rootfs ${filesize}
>
> but from what i understand the "filesize" variable is set from the tftp
> instruction
>
> Where do i fail?
>
> Thanks
>
> Enrico
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: System recovery
       [not found]   ` <CALmqtKanTeT72ZgoLTnHX44vAFm2=ybLeRET5cv=Myb+03t+4A@mail.gmail.com>
@ 2018-05-09 10:37     ` Martin Townsend
  2018-05-10  6:14       ` Enrico Bonomi
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Townsend @ 2018-05-09 10:37 UTC (permalink / raw)
  To: Enrico Bonomi, Yocto Project Discussion

On Wed, May 9, 2018 at 11:21 AM, Enrico Bonomi
<enrico.bonomi92@gmail.com> wrote:
> Hi Martin,
>
> I'm newbie in yocto, but i used IMAGE_FSTYPES ="sdcard" to boot the system
> from SD card. What i want to obtain is to replace the broken file system
> that is located on the NAND with another one that works. A kind of recovery
> partition. is it possible from SD or should i create a recovery partition
> over the NAND?
>
> thanks
>
> Enrico
>
> 2018-05-09 11:25 GMT+02:00 Martin Townsend <mtownsend1973@gmail.com>:
>>
>> Hi Enrico,
>>
>> UBI is only designed to work on raw NAND using the MTD subsystem.  MMC
>> will be a standard block device as the SD card will have Flash
>> Translation layer. See the excellent MTD website for more info
>> http://www.linux-mtd.infradead.org/doc/ubi.html
>>
>> In Yocto I believe you can use "sdcard" in the IMAGE_FSTYPES for a
>> flashable image for SD cards that can be used with U-Boot.
>>
>> -Martin.
>>
>>
>> On Wed, May 9, 2018 at 9:31 AM, Enrico Bonomi <enrico.bonomi92@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I work with Yocto Poky 1.7.3 on an imx6 dual lite SOM. I recently came
>> > across a problem with a preexisting system. Infact in a couple of cases,
>> > after about one year of work with no problems, file system results
>> > corrupted
>> > and the machine can't work. So i decide to implement a recovery system
>> > that
>> > can intervene in theese cases. An sd card is mounted on my board, so i
>> > think
>> > that i can use it to act this process. Using gparted i create a
>> > partition on
>> > sd card that can store my recovery file system.
>> > This partition starts at block 1581056 (so 0x00182000), every block has
>> > a
>> > size of 512 bytes and the file system size is 370262016 bytes (so
>> > 0x1611c000) that are 723168 blocks (so 0x000b08e0).
>> > In the u-boot i do the following instructions:
>> >
>> > nand erase.part rootfs
>> > ubi part rootfs
>> > ubi create rootfs
>> > mmc dev 0
>> > mmc read 12000000 0x00182000  0x000b08e0
>> > ubi write 12000000 rootfs 0x1611c000
>> > ubifsmount ubi0:rootfs
>> >
>> > and this instruction results in the following errors:
>> >
>> > UBIFS error (pid 0): ubifs_read_node: bad node type (0 but expected 6)
>> > UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
>> > UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
>> > 'ubi0:rootfs' errno=-22!
>> >
>> > ubifsmount - mount UBIFS volume
>> >
>> > Usage:
>> > ubifsmount <volume-name>
>> >    - mount 'volume-name' volume
>> >
>> > the strange thing is that when i first program all new devices i use the
>> > following instruction:
>> >
>> > tftpboot prall
>> >
>> > and prall is the compiled of a txt file which, when programming file
>> > system
>> > use the same instructions, obviously except for
>> >
>> > tftp 12000000 rootfs.ubifs
>> >
>> > instead of my mmc instructions, and
>> >
>> > ubi write 12000000 rootfs ${filesize}
>> >
>> > but from what i understand the "filesize" variable is set from the tftp
>> > instruction
>> >
>> > Where do i fail?
>> >
>> > Thanks
>> >
>> > Enrico
>> >
>> > --
>> > _______________________________________________
>> > yocto mailing list
>> > yocto@yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/yocto
>> >
>
>

You forgot to reply to all so added the Yocto mailing list back in again.

You can create multiple images by specifying ubi and sdcard in
IMAGE_FSTYPES and then flash ubi to the raw NAND and then the sdcard
image to the SD then write the logic to perform the switch.

-Martin.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: System recovery
  2018-05-09 10:37     ` Martin Townsend
@ 2018-05-10  6:14       ` Enrico Bonomi
  2018-05-10 13:47         ` Martin Townsend
  0 siblings, 1 reply; 5+ messages in thread
From: Enrico Bonomi @ 2018-05-10  6:14 UTC (permalink / raw)
  To: Martin Townsend; +Cc: Yocto Project Discussion

[-- Attachment #1: Type: text/plain, Size: 4419 bytes --]

Hi Martin,

I know that i can create multiple images types, but i don't want an sdcard
bootable image. On my first try, the image on sdcard was ubi type because i
want to obtain i kind of recovery partition directly on the sdcard. Do you
suggest to put the recovery partition directly on the raw NAND? in that
case how could i create a compressed image (because i don't have enough
space on my device to keep 2 images)?

thanks

Enrico

2018-05-09 12:37 GMT+02:00 Martin Townsend <mtownsend1973@gmail.com>:

> On Wed, May 9, 2018 at 11:21 AM, Enrico Bonomi
> <enrico.bonomi92@gmail.com> wrote:
> > Hi Martin,
> >
> > I'm newbie in yocto, but i used IMAGE_FSTYPES ="sdcard" to boot the
> system
> > from SD card. What i want to obtain is to replace the broken file system
> > that is located on the NAND with another one that works. A kind of
> recovery
> > partition. is it possible from SD or should i create a recovery partition
> > over the NAND?
> >
> > thanks
> >
> > Enrico
> >
> > 2018-05-09 11:25 GMT+02:00 Martin Townsend <mtownsend1973@gmail.com>:
> >>
> >> Hi Enrico,
> >>
> >> UBI is only designed to work on raw NAND using the MTD subsystem.  MMC
> >> will be a standard block device as the SD card will have Flash
> >> Translation layer. See the excellent MTD website for more info
> >> http://www.linux-mtd.infradead.org/doc/ubi.html
> >>
> >> In Yocto I believe you can use "sdcard" in the IMAGE_FSTYPES for a
> >> flashable image for SD cards that can be used with U-Boot.
> >>
> >> -Martin.
> >>
> >>
> >> On Wed, May 9, 2018 at 9:31 AM, Enrico Bonomi <
> enrico.bonomi92@gmail.com>
> >> wrote:
> >> > Hi,
> >> >
> >> > I work with Yocto Poky 1.7.3 on an imx6 dual lite SOM. I recently came
> >> > across a problem with a preexisting system. Infact in a couple of
> cases,
> >> > after about one year of work with no problems, file system results
> >> > corrupted
> >> > and the machine can't work. So i decide to implement a recovery system
> >> > that
> >> > can intervene in theese cases. An sd card is mounted on my board, so i
> >> > think
> >> > that i can use it to act this process. Using gparted i create a
> >> > partition on
> >> > sd card that can store my recovery file system.
> >> > This partition starts at block 1581056 (so 0x00182000), every block
> has
> >> > a
> >> > size of 512 bytes and the file system size is 370262016 bytes (so
> >> > 0x1611c000) that are 723168 blocks (so 0x000b08e0).
> >> > In the u-boot i do the following instructions:
> >> >
> >> > nand erase.part rootfs
> >> > ubi part rootfs
> >> > ubi create rootfs
> >> > mmc dev 0
> >> > mmc read 12000000 0x00182000  0x000b08e0
> >> > ubi write 12000000 rootfs 0x1611c000
> >> > ubifsmount ubi0:rootfs
> >> >
> >> > and this instruction results in the following errors:
> >> >
> >> > UBIFS error (pid 0): ubifs_read_node: bad node type (0 but expected 6)
> >> > UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
> >> > UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
> >> > 'ubi0:rootfs' errno=-22!
> >> >
> >> > ubifsmount - mount UBIFS volume
> >> >
> >> > Usage:
> >> > ubifsmount <volume-name>
> >> >    - mount 'volume-name' volume
> >> >
> >> > the strange thing is that when i first program all new devices i use
> the
> >> > following instruction:
> >> >
> >> > tftpboot prall
> >> >
> >> > and prall is the compiled of a txt file which, when programming file
> >> > system
> >> > use the same instructions, obviously except for
> >> >
> >> > tftp 12000000 rootfs.ubifs
> >> >
> >> > instead of my mmc instructions, and
> >> >
> >> > ubi write 12000000 rootfs ${filesize}
> >> >
> >> > but from what i understand the "filesize" variable is set from the
> tftp
> >> > instruction
> >> >
> >> > Where do i fail?
> >> >
> >> > Thanks
> >> >
> >> > Enrico
> >> >
> >> > --
> >> > _______________________________________________
> >> > yocto mailing list
> >> > yocto@yoctoproject.org
> >> > https://lists.yoctoproject.org/listinfo/yocto
> >> >
> >
> >
>
> You forgot to reply to all so added the Yocto mailing list back in again.
>
> You can create multiple images by specifying ubi and sdcard in
> IMAGE_FSTYPES and then flash ubi to the raw NAND and then the sdcard
> image to the SD then write the logic to perform the switch.
>
> -Martin.
>

[-- Attachment #2: Type: text/html, Size: 6311 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: System recovery
  2018-05-10  6:14       ` Enrico Bonomi
@ 2018-05-10 13:47         ` Martin Townsend
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Townsend @ 2018-05-10 13:47 UTC (permalink / raw)
  To: Enrico Bonomi; +Cc: Yocto Project Discussion

Hi Enrico,

Then I would use a tar.gz image type and then extract that onto the
formatted partition of the SD card or if the partition is ext then I
think you can generate an image type for this.

There is also wic for generating partitioned images, I've not used it
so can't really comment on it but is described in the Yocto manual.

-Martin

On Thu, May 10, 2018 at 7:14 AM, Enrico Bonomi
<enrico.bonomi92@gmail.com> wrote:
> Hi Martin,
>
> I know that i can create multiple images types, but i don't want an sdcard
> bootable image. On my first try, the image on sdcard was ubi type because i
> want to obtain i kind of recovery partition directly on the sdcard. Do you
> suggest to put the recovery partition directly on the raw NAND? in that case
> how could i create a compressed image (because i don't have enough space on
> my device to keep 2 images)?
>
> thanks
>
> Enrico
>
> 2018-05-09 12:37 GMT+02:00 Martin Townsend <mtownsend1973@gmail.com>:
>>
>> On Wed, May 9, 2018 at 11:21 AM, Enrico Bonomi
>> <enrico.bonomi92@gmail.com> wrote:
>> > Hi Martin,
>> >
>> > I'm newbie in yocto, but i used IMAGE_FSTYPES ="sdcard" to boot the
>> > system
>> > from SD card. What i want to obtain is to replace the broken file system
>> > that is located on the NAND with another one that works. A kind of
>> > recovery
>> > partition. is it possible from SD or should i create a recovery
>> > partition
>> > over the NAND?
>> >
>> > thanks
>> >
>> > Enrico
>> >
>> > 2018-05-09 11:25 GMT+02:00 Martin Townsend <mtownsend1973@gmail.com>:
>> >>
>> >> Hi Enrico,
>> >>
>> >> UBI is only designed to work on raw NAND using the MTD subsystem.  MMC
>> >> will be a standard block device as the SD card will have Flash
>> >> Translation layer. See the excellent MTD website for more info
>> >> http://www.linux-mtd.infradead.org/doc/ubi.html
>> >>
>> >> In Yocto I believe you can use "sdcard" in the IMAGE_FSTYPES for a
>> >> flashable image for SD cards that can be used with U-Boot.
>> >>
>> >> -Martin.
>> >>
>> >>
>> >> On Wed, May 9, 2018 at 9:31 AM, Enrico Bonomi
>> >> <enrico.bonomi92@gmail.com>
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > I work with Yocto Poky 1.7.3 on an imx6 dual lite SOM. I recently
>> >> > came
>> >> > across a problem with a preexisting system. Infact in a couple of
>> >> > cases,
>> >> > after about one year of work with no problems, file system results
>> >> > corrupted
>> >> > and the machine can't work. So i decide to implement a recovery
>> >> > system
>> >> > that
>> >> > can intervene in theese cases. An sd card is mounted on my board, so
>> >> > i
>> >> > think
>> >> > that i can use it to act this process. Using gparted i create a
>> >> > partition on
>> >> > sd card that can store my recovery file system.
>> >> > This partition starts at block 1581056 (so 0x00182000), every block
>> >> > has
>> >> > a
>> >> > size of 512 bytes and the file system size is 370262016 bytes (so
>> >> > 0x1611c000) that are 723168 blocks (so 0x000b08e0).
>> >> > In the u-boot i do the following instructions:
>> >> >
>> >> > nand erase.part rootfs
>> >> > ubi part rootfs
>> >> > ubi create rootfs
>> >> > mmc dev 0
>> >> > mmc read 12000000 0x00182000  0x000b08e0
>> >> > ubi write 12000000 rootfs 0x1611c000
>> >> > ubifsmount ubi0:rootfs
>> >> >
>> >> > and this instruction results in the following errors:
>> >> >
>> >> > UBIFS error (pid 0): ubifs_read_node: bad node type (0 but expected
>> >> > 6)
>> >> > UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
>> >> > UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
>> >> > 'ubi0:rootfs' errno=-22!
>> >> >
>> >> > ubifsmount - mount UBIFS volume
>> >> >
>> >> > Usage:
>> >> > ubifsmount <volume-name>
>> >> >    - mount 'volume-name' volume
>> >> >
>> >> > the strange thing is that when i first program all new devices i use
>> >> > the
>> >> > following instruction:
>> >> >
>> >> > tftpboot prall
>> >> >
>> >> > and prall is the compiled of a txt file which, when programming file
>> >> > system
>> >> > use the same instructions, obviously except for
>> >> >
>> >> > tftp 12000000 rootfs.ubifs
>> >> >
>> >> > instead of my mmc instructions, and
>> >> >
>> >> > ubi write 12000000 rootfs ${filesize}
>> >> >
>> >> > but from what i understand the "filesize" variable is set from the
>> >> > tftp
>> >> > instruction
>> >> >
>> >> > Where do i fail?
>> >> >
>> >> > Thanks
>> >> >
>> >> > Enrico
>> >> >
>> >> > --
>> >> > _______________________________________________
>> >> > yocto mailing list
>> >> > yocto@yoctoproject.org
>> >> > https://lists.yoctoproject.org/listinfo/yocto
>> >> >
>> >
>> >
>>
>> You forgot to reply to all so added the Yocto mailing list back in again.
>>
>> You can create multiple images by specifying ubi and sdcard in
>> IMAGE_FSTYPES and then flash ubi to the raw NAND and then the sdcard
>> image to the SD then write the logic to perform the switch.
>>
>> -Martin.
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-10 13:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09  8:31 System recovery Enrico Bonomi
2018-05-09  9:25 ` Martin Townsend
     [not found]   ` <CALmqtKanTeT72ZgoLTnHX44vAFm2=ybLeRET5cv=Myb+03t+4A@mail.gmail.com>
2018-05-09 10:37     ` Martin Townsend
2018-05-10  6:14       ` Enrico Bonomi
2018-05-10 13:47         ` Martin Townsend

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.