Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about implementation #2

Open
stuaxo opened this issue Jan 15, 2020 · 2 comments
Open

Question about implementation #2

stuaxo opened this issue Jan 15, 2020 · 2 comments

Comments

@stuaxo
Copy link

stuaxo commented Jan 15, 2020

Is the data duplicated, or are blocks for a file only in one place + referenced by the FAT, and whatever ext2/3 does ?

Edit: The most cursed implementation I can imagine has each file stored only once.

@meithecatte
Copy link
Owner

Currently the filesystems are entirely independent and don't share data. I want to explore creating some files that would be shared between the two (or more!) filesystems. Naturally, deleting them would be unsafe and induce corruption.

@stuaxo
Copy link
Author

stuaxo commented Jan 15, 2020

I don't know enough to implement this, but maybe it could work like this:

one filesystem can be written to at a time, and the others are readonly - they get synced after writes to the first one.

To start with, this could be limited to a writing to ext2/3 and syncing readonly FAT filesystem to the same files after those writes.

The ext2 and FAT filesystem would have the same size datablocks (cluster size on fat??)

This is because FAT has a relatively simple structure to write, and ext2 has debugfs to read the data blocks.

list of the datablocks in a file in the ext2 filesystem with debugfs:

https://serverfault.com/questions/29886/how-do-i-list-a-files-data-blocks-on-linux

To sync the a file to the fat filesystem

  • mount it, or use mtools to create a zero length file with the correct name.
    (this avoids having to manually deal with long filenames in the FAT fs).

  • iterate the datablocks on the ext file system and update the entry for the file in the FAT to point to those blocks.

Obviously there are many reasons this may not work - but maybe if the block size matches ext2 it might work ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants