October 4, 2020
I recently wanted to set up the Dashcam/Sentry Mode in my new Model Y. After doing some research on the best removable storage device to use, I settled on the Samsung T5 SSD. While researching, I found a number of folks saying that if I was using Windows, I'd need to download a third-party utility to format the drive as FAT32 since Windows 10 only supports FAT32 partition sizes up to 32GB. After doing a bit more digging, I found some other folks saying that formatting the drive as ext4 (a Linux-only filesystem format) also worked.
I couldn't help but think that this sounded like a perfect job for the Windows Subsystem for Linux (WSL). All in all, I went from not having the WSL installed to having a new SSD working with Dashcam/Sentry Mode in under 15 minutes with no third-party tools required! Here's how:
Install WSL 2
Plug in the drive to your computer
Nothing too fancy here.
Open an elevated ("As Administrator") PowerShell prompt and run the following commands:
wmic diskdrive list brief
This lists the available drives in Windows. My SSD had a DeviceID of
wsl --mount <your disk's DeviceID> --bare
This will mount the drive in WSL.
This will open a WSL terminal. You can exit this terminal at any time by typing
In the WSL terminal, run the following commands:
sudo fdisk -l
This will list all drives and partitions accessible to WSL. You should see your newly mounted SSD appear here. If you're not sure which device/partition is which, you can always unmount the SSD by running
wsl --unmount <your disk's DeviceID> in an elevated PowerShell prompt. And re-running the command above to see which drive disappeared. Note that you'll need to re-mount it again before continuing.
My SSD was accessible at
dev/sdc and had a single
sudo fdisk /dev/sdc
This will begin the process of formatting the drive. Once
fdisk is running, you can execute the following commands. Note that
fdisk runs all commands in memory until you write them to disk.
This deletes the current filesystem on disk.
This creates a new partition.
This makes the new partition a primary partition.
This is the primary partition's partition number.
This changes the partition type to "Linux"
This writes the changes to disk (please note that this is a destructive action and cannot be undone).
fdisk should now output the name of your new partition. In my case, this partition was still called
This formats the new partition to ext4. Be sure to replace
dev/sdc1 with your new partition's name. This command might take a few minutes to complete, but once it's done, you'll have a new ext4 partition!
Return to your elevated PowerShell prompt and run the following commands:
wsl --mount <your disk's DeviceID> --partition 1
You may have to unmount the drive first by running
wsl --unmount <your disk's DeviceID>. From here, the drive should now be viewable in Windows Explorer. From the sidebar in Windows Explorer, select Linux, then choose your distribution (mine was Ubuntu), and find the location of your mounted partition. Per the documentation, the default location is
Open your mounted partition and create a new
TeslaCam folder at its root. You may also see a pre-existing
lost+found directory. That's not important for this exercise, but you can read more about what it's for here.
Once you have the
TeslaCam folder created, that should be it! You can run the following command in your elevated PowerShell prompt to unmount your drive:
wsl --unmount <your disk's DeviceID>
Plug your newly formatted drive into your Tesla and make sure it's recognized:
You should see the following icon appear:
I hope this guide was helpful for others who are looking to format a SSD for their Tesla without requiring third-party tools! Thanks as well to the WSL Team at Microsoft who (apparently) just recently shipped the support for ext4 that made this possible!