{"slug": "show-hn-linux2win-auto-detect-linux-disks-project-ext2-3-4-as-windows-folders", "title": "Show HN:Linux2Win Auto-detect Linux disks, project Ext2/3/4 as Windows folders", "summary": "A developer released Linux2Win, a C++20/CMake tool that auto-detects Linux disks and USB drives on Windows and projects their Ext2/3/4 data partitions as native Windows folders via the Windows Projected File System (ProjFS). The tool mounts partitions read-only under C:\\LinuxDisks\\Disk<N>_Part<M>, excludes EFI System Partitions, BIOS Boot, /boot, swap, Microsoft Reserved and Microsoft Recovery partitions, and requires Visual Studio 2022, CMake 3.20+, and Windows 10 (1809+) or Windows 11.", "body_md": "A modern, high-performance C++20 / CMake solution that automatically detects Linux disks & USBs (when inserted or already present), validates and parses Linux data partitions (Ext2/3/4), strictly excludes boot/system/swap partitions, protects write safety with read-only enforcement, and projects data partitions as native Windows folders using **Windows Projected File System (ProjFS)**.\n\n1. **Automatic Disk & Hotplug Monitoring** :\n  - Detects all existing physical drives (`PhysicalDrive0` ..`PhysicalDriveN` ).\n  - Listens in real-time for USB and external disk insertion and removal via Win32 `WM_DEVICECHANGE` device interface hooks.\n2. Detects all existing physical drives (\n3. **Strict Data-Only Partition Filtering** :\n  - Automatically inspects GPT and MBR partition tables.\n  - **Allowed Data Partitions** : Linux Filesystem Data, Linux`/home` , Linux Root (`x86_64` ,`arm64` ,`x86` ),`/srv` ,`/var` , and user data partitions.\n  - **Excluded Partitions** : EFI System Partitions (ESP), BIOS Boot, Linux`/boot` , Linux Swap, Microsoft Reserved (MSR), Microsoft Recovery.\n4. **Zero-Dependency Ext2/Ext3/Ext4 Engine** :\n  - Built-in, self-contained parser supporting 64-bit block addressing, extents trees, directory hash/linear entries, fast & regular symlinks, and inode table parsing.\n5. **Native Windows Explorer Integration (ProjFS)** :\n  - Projects the Linux filesystem directly into `C:\\LinuxDisks\\Disk<N>_Part<M>` using the Windows Projected File System.\n  - Standard Windows Explorer operations: double-click to open files, view properties, drag-and-drop, and copy files/folders directly to Windows drives.\n6. Projects the Linux filesystem directly into \n7. **Enforced Read-Only Safety** :\n  - Drive handles opened strictly in `GENERIC_READ` mode with`FILE_SHARE_READ | FILE_SHARE_WRITE` .\n  - File attributes tagged with `FILE_ATTRIBUTE_READONLY` .\n  - All write, modify, truncate, and delete operations are blocked (`ERROR_ACCESS_DENIED` ).\n8. Drive handles opened strictly in \n9. **Memory-Resident Background Daemon & System Tray** :\n  - Runs quietly in the notification area with a sleek context menu.\n  - Interactive permission prompt asking user consent for Windows startup.\n  - Desktop balloon notifications when Linux partitions are mounted or unmounted.\n\nLinux2Win provides an integrated Windows Setup Wizard (`linux2win_setup.exe`):\n\n1. **Interactive Startup Permission** : Asks for permission to load on Windows startup in memory-resident background mode.\n2. **Explorer Shortcuts** : Automatically creates desktop and Start Menu shortcuts to`C:\\LinuxDisks` .\n3. **ProjFS Feature Activator** : Enables the Windows Projected File System feature if not active.\n4. **Clean Uninstallation** : Registers with Windows*Add or Remove Programs* and generates`uninstall.exe` .\n\n```\n# Scan all physical drives and classify partitions (shows data vs excluded boot/swap partitions)\n.\\linux2win.exe scan\n\n# Start real-time hotplug monitor (detects USB / drive insertion and removal)\n.\\linux2win.exe monitor\n\n# Auto-mount all detected Linux data partitions to Windows folders\n.\\linux2win.exe auto\n\n# Mount a specific Linux data partition as a Windows folder via ProjFS\n.\\linux2win.exe mount <disk_index> <partition_number> [target_folder]\n# Example:\n.\\linux2win.exe mount 1 2 C:\\LinuxDisks\\Drive1_Part2\n\n# List directory contents on a Linux partition\n.\\linux2win.exe ls <disk_index> <partition_number> [path]\n# Example:\n.\\linux2win.exe ls 1 2 /home/user\n\n# Display contents of a file on Linux partition\n.\\linux2win.exe cat <disk_index> <partition_number> <file_path>\n\n# Safely copy/export a file or folder from Linux partition to Windows\n.\\linux2win.exe export <disk_index> <partition_number> <linux_path> <windows_target_dir>\n# Example:\n.\\linux2win.exe export 1 2 /etc/fstab C:\\Users\\YourUser\\Desktop\n```\n\n- Visual Studio 2022 (with MSVC C++20 toolchain)\n- CMake 3.20+\n- Windows 10 (1809+) or Windows 11\n\n```\n# Clone the repository\ngit clone https://github.com/APS-PPR-2016/Linux2Win.git\ncd Linux2Win\n\n# Configure with MSVC 2022\ncmake -B build -G \"Visual Studio 17 2022\" -A x64\n\n# Build Release binaries\ncmake --build build --config Release\n\n# Run automated unit tests\ncd build\nctest -C Release --output-on-failure\n\n# Package ZIP distribution\ncpack -C Release -G ZIP\n```\n\nIf you find **Linux2Win** useful, please consider supporting the project:\n\nThis project is licensed under the [MIT License](https://github.com/APS-PPR-2016/Linux2Win/blob/main/LICENSE).", "url": "https://wpnews.pro/news/show-hn-linux2win-auto-detect-linux-disks-project-ext2-3-4-as-windows-folders", "canonical_source": "https://github.com/APS-PPR-2016/Linux2Win", "published_at": "2026-09-21 10:31:05+00:00", "updated_at": "2026-09-21 10:53:36.620742+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Linux2Win", "Windows Projected File System", "Ext2", "Ext3", "Ext4", "CMake", "Visual Studio 2022", "Microsoft Windows"], "alternates": {"html": "https://wpnews.pro/news/show-hn-linux2win-auto-detect-linux-disks-project-ext2-3-4-as-windows-folders", "markdown": "https://wpnews.pro/news/show-hn-linux2win-auto-detect-linux-disks-project-ext2-3-4-as-windows-folders.md", "text": "https://wpnews.pro/news/show-hn-linux2win-auto-detect-linux-disks-project-ext2-3-4-as-windows-folders.txt", "jsonld": "https://wpnews.pro/news/show-hn-linux2win-auto-detect-linux-disks-project-ext2-3-4-as-windows-folders.jsonld"}}