Author Topic: Running Image On Sd File, Ext2, Rboot And / Sync ?  (Read 2080 times)

obergix

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • http://www.olivierberger.com/weblog/
Running Image On Sd File, Ext2, Rboot And / Sync ?
« on: June 27, 2005, 02:33:33 am »
I’m using rboot to boot an (GPE) image out of an ext2 file stored on my SD.

It works pretty well actually, until there is a problem, for instance if I have to reset...

I'm afraid the / image then becomes corrupt, and I can lose un-synced saved data.

I think that there may be a problem during the pivot-root which mounts the new / without sync, which is not recommended I think for ext2.

The SD is mounted with sync, so any change to the "looped" / image should be written ASAP, but are changed inside the image written ASAP ? If the new / is only mounted ext2 without sync (or appears at such when using mount from inside it), is it good ?

What do others think ?

Would ext3 be preferred ?

I'm also not really sure if at next reboot the uncleanly shutdown filesystem will be checked (fsck'd) before the pivo_root...

Thanks in advance for your comments.

Best regards,
Zaurus SL-C1000 - OpenZaurus 3.5.4.1-alpha1 w/ GPE image (some packages "custom made", compiled at home from bitbake+openembedded)

CoreDump

  • Hero Member
  • *****
  • Posts: 713
    • View Profile
    • http://www.hentges.net
Running Image On Sd File, Ext2, Rboot And / Sync ?
« Reply #1 on: July 04, 2005, 01:57:25 pm »
Quote
I’m using rboot to boot an (GPE) image out of an ext2 file stored on my SD.

It works pretty well actually, until there is a problem, for instance if I have to reset...

I'm afraid the / image then becomes corrupt, and I can lose un-synced saved data.

I think that there may be a problem during the pivot-root which mounts the new / without sync, which is not recommended I think for ext2.

The SD is mounted with sync, so any change to the "looped" / image should be written ASAP,

Correct.

Quote
but are changed inside the image written ASAP ? If the new / is only mounted ext2 without sync (or appears at such when using mount from inside it), is it good ?

Nope, if the loop-image is not mounted "sync", data is not written ASAP.

Quote
What do others think ?

Running fsck.ext2 on the loop-image prior to mounting is a good idea.
Note: Hacking /sbin/init can be a bitch heh

Quote
Would ext3 be preferred ?

Um no, journaling filesystems are a bad idea on flash-based storage devices.
They cause way more writes to the disk as non-journaling filesystems.

Quote
I'm also not really sure if at next reboot the uncleanly shutdown filesystem will be checked (fsck'd) before the pivo_root...

The 3.5.3 version of rboot doesn't check the image or the card. It has been some time since I last looked at the script though. Things may have changed.
Webmaster of hentges.net & Embedded Linux Developer.