You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When mount existing filesystem littlefs library assumes that block size and block count is given during configuration time. Block size and number of blocks are stored in the superblock and when existing filesystem is mounted config should be updated from the super block structure instead of use default values from the config struct. config block_size blocks_count should be only used only when the blocks_size and count isn't know for example when lfs_format is used
The text was updated successfully, but these errors were encountered:
lucckb
changed the title
littlefs don't read config information from superblock
littlefs don't read config information from the superblock
Dec 17, 2020
This is something that's been looked at, but it's a bit more complicated than it first appears: #349
There's a sort of chicken-and-egg problem where littlefs needs to know the block_size in order to read the superblock. So reading the block_size requires knowing the block_size, which is a bit of a problem. There's some ideas around scanning the block device to find a valid superblock, but the problem there is that such a scan may have to read the entire disk if lfs_mount fails.
The block_count, on the other hand, is pretty easy to read, it just hasn't been a priority since usually block_count is provided by partition information anyways.
When mount existing filesystem littlefs library assumes that block size and block count is given during configuration time. Block size and number of blocks are stored in the superblock and when existing filesystem is mounted config should be updated from the super block structure instead of use default values from the config struct. config block_size blocks_count should be only used only when the blocks_size and count isn't know for example when lfs_format is used
The text was updated successfully, but these errors were encountered: