Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Support for ExFAT filesystem? #597

Open
michaelbaudino opened this issue Jul 19, 2020 · 7 comments
Open

Support for ExFAT filesystem? #597

michaelbaudino opened this issue Jul 19, 2020 · 7 comments

Comments

@michaelbaudino
Copy link

Hello,

Recalbox core team member here 👋

We are switching one of our partition filesystem to ExFAT in our next release (due in a few weeks), but from what I can see in this piece of code there's no way to ask NOOBS to create an ExFAT filesystem from our partitions.json file 😭

Are there any plans to support this? Or at least any custom filesystem creation command? If not, which approach do you think we should consider?

Thanks a lot in advance for your help.

PS: I've tried a few things already to reformat and create the filesystem on first boot, but all my attempts failed:

  • parted refuses to resize the extended partition that contains the logical partition mounted as /
  • fdisk is made for humans and thus its input is highly inconsistent and not reliably usable by a script
  • sfdisk doesn't seem to support GPT
@michaelbaudino
Copy link
Author

Just to be clear, I'd be happy to provide a PR to support this (let me know if you want it!), but it doesn't sound like a good solution to me because it's not backward compatible: people who own (or receive from a manufacturer) a NOOBS SD-card created with an older version would not be able to install our OS.

@maxnet
Copy link
Collaborator

maxnet commented Jul 20, 2020

Or at least any custom filesystem creation command?

You can run your own arbitrary commands as post-installation (partition_setup) script.
Windows does that as well.

Regarding partitions.json:
Set "empty_fs" to true to tell NOOBS you don't want the partition formatted.
"partition_type" to whatever MBR partition id exFAT uses (2 hex digits).

sfdisk doesn't seem to support GPT

Neither does NOOBS.

@michaelbaudino
Copy link
Author

Awesome idea, I'll try that 🙌
Thanks a lot for the hint @maxnet 🙏

@lurch
Copy link
Collaborator

lurch commented Jul 20, 2020

I hope you don't mind me asking, purely out of curiosity...

We are switching one of our partition filesystem to ExFAT in our next release

Why? :)

I've just googled and found https://en.wikipedia.org/wiki/ExFAT#Adoption and to answer your original query NOOBS doesn't (yet) use a 5.4 kernel 😉 (Although apparently it does support FUSE, which I didn't realise!)

@lurch
Copy link
Collaborator

lurch commented Jul 20, 2020

it doesn't sound like a good solution to me because it's not backward compatible

We've had similar backwards-compatibility problems in the past, and that's why current versions of NOOBS download os_list_v3.json with older versions still being supported.

@michaelbaudino
Copy link
Author

michaelbaudino commented Jul 21, 2020

@lurch:

I hope you don't mind me asking, purely out of curiosity...

We are switching one of our partition filesystem to ExFAT in our next release

Why? :)

I've just googled and found https://en.wikipedia.org/wiki/ExFAT#Adoption and to answer your original query NOOBS doesn't (yet) use a 5.4 kernel 😉 (Although apparently it does support FUSE, which I didn't realise!)

Ahah sure, feel free to ask 🤗

This partition is the one where users can store their media content (roms (games), music, movies, …). Some users have a lot of content.

Since we are targeting non-technical users, we need this partition to be readable/writable on Windows, thus we excluded EXT4. We also excluded FAT32 due to technical limitations (partition size, file size, access rights, no journaling, …). We've been supporting NTFS for some time too, but have a few issues with it (mounting is slow, partitions are randomly not detected, …). It's probably an issue on our side, since NTFS seems quite mature, but we never had time to properly track that kind of not reproductible bugs. Finally, we recently tried ExFAT, which is well supported on both Windows (natively) and Linux, and is quite solid/stable, from what we can see.

Anyway, we may move back to NTFS at some point (since NTFS optimizes space better than ExFAT, iirc), but for now, we're quite happy with ExFAT broad support and performance.


Regarding the driver, we are using this FUSE-based driver which is actually provided by Buildroot. We may switch to native Linux 5.4 support, but we didn't bump to 5.4 on all architectures yet (only on Pi4 at the moment, actually).

@michaelbaudino
Copy link
Author

@maxnet:

Regarding partitions.json:
Set "empty_fs" to true to tell NOOBS you don't want the partition formatted.
"partition_type" to whatever MBR partition id exFAT uses (2 hex digits).

It worked 🙌

Well, actually, I also had to add "filesystem_type": "unformatted" too, otherwise NOOBS tries to run mkfs, which is not what we want.

Actually, I was expecting "filesystem_type": "unformatted" to be enough (i.e. that it would imply "empty_fs": true), but no 🤷‍♂️ With only "filesystem_type": "unformatted", NOOBS does not create the filesystem (i.e. it does not run mkfs, as we would expect), but it still tries to download a tarball and populate the (not-existent) filesystem.

Let me try to make this more  clear  nerdy.

Current behaviour pseudo-code:

  • if partition is defined in partitions.json then
    • create partition
    • if filesystem_type is not unformatted then
      • create filesystem (mkfs)
    • if empty_fs is not true then
      • populate filesystem with tarball content

Shouldn't it rather be:

  • if partition is defined in partitions.json then
    • create partition
    • if filesystem_type is not unformatted then
      • create filesystem (mkfs)
      • if empty_fs is not true then
        • populate filesystem with tarball

Anyway, thanks a lot for your help 🙏

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

No branches or pull requests

3 participants