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

Switch USB filesystem to ext4 #15

Open
wurmr opened this issue Jun 27, 2019 · 12 comments
Open

Switch USB filesystem to ext4 #15

wurmr opened this issue Jun 27, 2019 · 12 comments

Comments

@wurmr
Copy link
Contributor

wurmr commented Jun 27, 2019

Thoughts on switching from FAT32 to ext4 as the file system that is exposed to the Telsa?

Tesla's officially docs say it must be FAT32 but this is not true, the car will mount and happily write to ext4 (tested on my model 3 software version 2019.20.4.2).

The big advantage of this that I can think of is a journaled file system that won't get corrupted so easily plus ext4 supports multiple mount projection. This would allow us to mount it by the pi and copy files off it live. That would mean no more multiple images, we could just construct one very large image and work off of it.

@wurmr
Copy link
Contributor Author

wurmr commented Jun 27, 2019

I got a little excited, we cannot mount it at the same time. But the car will handle ext4 well as far as I can tell. The journal alone might help with FS recovery and corrupted file system that FAT is plagued with.

@milesburton
Copy link
Owner

milesburton commented Jun 27, 2019 via email

@rudybroersma
Copy link

Tesla's officially docs say it must be FAT32 but this is not true, the car will mount and happily write to
ext4 tested on my model 3 software version 2019.20.4.2).

Actually, it doesn't. It says ext3/ext4 is fine as well. See:

https://scontent-ams4-1.xx.fbcdn.net/v/t1.0-9/65303970_957692474568953_5781248575686049792_o.jpg?_nc_cat=103&_nc_ht=scontent-ams4-1.xx&oh=ca3b804e2b8f855934a61ed7bc871d48&oe=5D8C007A

So I agree with you, I believe we should go with ext4.

@wurmr
Copy link
Contributor Author

wurmr commented Jun 27, 2019

Tested and working with ext4. Both with Teslacam and by formating just a normal usb stick.

@milesburton
Copy link
Owner

milesburton commented Jun 27, 2019 via email

@wurmr
Copy link
Contributor Author

wurmr commented Jun 28, 2019

Yes, type 83.

execSync(`echo "type=83" | /sbin/sfdisk ${IMAGE_DIR}/cam${imageNum}`, { bubbleError: true });

@rudybroersma
Copy link

Do you still need to setup a partition table?

While I don't know for sure (but I can try it out sometime), I don't think that is required. When you plug in a non-partitioned (but formatted) ext3/ext4 drive in a Linux system it works fine. You can mount is using something like mount /dev/sdb /mnt

I don't see why this would be different in Tesla (which is just Linux).

Of course the only exception would be the separate cam and music disks, which would require partitioning.

@wurmr
Copy link
Contributor Author

wurmr commented Jun 28, 2019

Do you still need to setup a partition table?

While I don't know for sure (but I can try it out sometime), I don't think that is required. When you plug in a non-partitioned (but formatted) ext3/ext4 drive in a Linux system it works fine. You can mount is using something like mount /dev/sdb /mnt

I don't see why this would be different in Tesla (which is just Linux).

Of course the only exception would be the separate cam and music disks, which would require partitioning.

In my testing I was unable to get the Tesla to see the drive w/o setting up the table. Anything else I tried I ended up with the grey X on the camera. Maybe I was doing something wrong.

@milesburton
Copy link
Owner

I'm addressing this issue on branch https://github.com/milesburton/teslacam/tree/add-ext4-filesystem

It's not quite as straightforward as fat32 as it requires you to modify the kernel params. I suspect @wurmr may have a clever solution to get around this in docker

@milesburton
Copy link
Owner

ext4 appears to work in my MS on the latest update via a USB flash card. The branch above needs to be updated to include @wurmr's optimisations

@milesburton
Copy link
Owner

On this branch @wurmr, how much work would it be to merge this into your docker setup? Any chance you would test it with your setup?

@wurmr
Copy link
Contributor Author

wurmr commented Oct 8, 2019

@milesburton I'd say make a PR and let's take a peek and work through it.

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

3 participants