0

The Problem

Partitioning 32GB uSD cards with 2GB FAT32/~30GB EXT4 in a production environment (20 per day) performed by production technicians (people who need something that's simple as a single click)

The Status

I know there are GUIs out there. I don't want a GUI.

I know it can be done from Linux. I don't want to run a Linux machine in our production floor.

I know I can create an master ISO and use it to image disks. This takes forever.

Acceptable solutions:

I'm looking to create an EXT4 partition from Windows in an automated way. I know this is possible because all these little GUIs are able to do it when I click a the right buttons.

  • PowerShell script (probably not possible)
  • 3rd Party tool that can be launched in an automatic mode with arguments (AOMEI partition assistant doesn't support EXT4 from arguments)
  • 3rd Party library I can use to write a tool myself.
  • Some kind of document that explains how to partition a disk even if it means setting raw 1s and 0s on the disk so I could write the damn thing myself and stop making endless searches

Any help is greatly appreciated

7
  • If anyone knows of a better forum that I should post this on, I'm happy to try there as well
    – stevep
    Commented Apr 8, 2022 at 13:54
  • I haven't tried.. (thus the comment) but Windows 11 WSL2 is supposed to be able to access EXT4 in all of its glory. This might be no different to you than running a Linux machine on the floor though. Ext4Fsd is supposed to be able to do this.. but I haven't tried it myself. Commented Apr 8, 2022 at 14:11
  • OK, I'll look into EXT4FSD. For WSL2, is it possible to start this automatically? So if I could launch WSL2 from powershell and have it run a bash script, that'd work fine.
    – stevep
    Commented Apr 8, 2022 at 14:31
  • @stevep The only way I know of to create ext4 partitions on Windows is via Paragon's Linux Filesystems for Windows and it does support CLI (second from the bottom under Features)
    – JW0914
    Commented Apr 8, 2022 at 14:41
  • 1
    @JW0914 Thank you. Through The LinuxFileSystems, I found that mke2fs creates an EXT4 partition thought command line, and it's open source
    – stevep
    Commented Apr 8, 2022 at 17:49

1 Answer 1

0

Thanks to JW0914 for the help. The open source Ext2 File System Driver for Windows can be used to format an partition as EXT4 in Win10. Install and add it to PATH so it can be used from command prompt/PowerShell

Example for an SD card set to disk number 4

Create and format the first partition with PowerShell

New-Partition -DiskNumber 4 -Size 2GB  -AssignDriveLetter | Format-Volume -FileSystem FAT32 -NewFileSystemLabel MyDrive

Create a second unformatted partition with PowerShell

New-Partition -DiskNumber 4 -UseMaximumSize

Use mke2fs to format the second partition.

mke2fs -t ext4 -L "Ext4Volume" /dev/sde2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .