{"id":890,"date":"2021-03-02T10:21:01","date_gmt":"2021-03-02T00:21:01","guid":{"rendered":"http:\/\/www.nickdu.com\/?p=890"},"modified":"2021-03-02T10:21:01","modified_gmt":"2021-03-02T00:21:01","slug":"read-write-linux-ext2-3-4-file-system-from-windows-c-net-application","status":"publish","type":"post","link":"https:\/\/nickdu.com\/?p=890","title":{"rendered":"SharpExt4, a .Net library, provides read\/write Linux ext2\/3\/4 file system from Windows application"},"content":{"rendered":"\n<p>As a day to day Windows user, it&#8217;s not easy to access Linux file system. Windows doesn&#8217;t natively supports Linux <a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/Extended_file_system#:~:text=The%20extended%20file%20system%2C%20or,of%20the%20MINIX%20file%20system.\" target=\"_blank\">Extended file system<\/a> access. <\/p>\n\n\n\n<p>I have been working on Linux ARM IoT device, and it&#8217;s so annoying to be back and forth between Windows working PC and Linux development PC. I regularly need to burn\/flash SD card, read\/write file, remove\/open directory in Linux  device image. <\/p>\n\n\n\n<p>These are the findings so far:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/DiscUtils\/DiscUtils\" target=\"_blank\">DiscUtils<\/a>, is a .NET library to read and write ISO files and Virtual Machine disk files (VHD, VDI, XVA, VMDK, etc). DiscUtils also provides limited access to ext2\/3\/4 filesystem.<\/li><li><a rel=\"noreferrer noopener\" href=\"http:\/\/www.ext2fsd.com\/\" target=\"_blank\">Ext2Fsd<\/a> is another Windows file system driver for the Ext2, Ext3, and Ext4 file systems. It allows Windows to read Linux file systems natively, providing access to the file system via a drive letter that any program can access. But it stops developing since 2017.<\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.diskinternals.com\/linux-reader\/\" target=\"_blank\">DiskInternals Linux Reader<\/a> is a freeware application from DiskInternals, developers of data recovery software. But it doesn&#8217;t have API for .Net Framework.<\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/sourceforge.net\/projects\/ext2read\/\" target=\"_blank\">Ext2explore<\/a> is an open-source application that works similarly to DiskInternals Linux Reader\u2014but only for Ext4, Ext3, and Ext2 partitions. It stops developing for a long time and is read only.<\/li><\/ol>\n\n\n\n<p>I decided to implement my own library. Finally, I found this, <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/gkostka\/lwext4\" target=\"_blank\">lwext4<\/a>, a C library  to provide ext2\/3\/4 filesystem for microcontrollers. According to the author, the library has some cool and unique features in microcontrollers world:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>directory indexing &#8211; fast file find and list operations<\/li><li>extents &#8211; fast big file truncate<\/li><li>journaling transactions &amp; recovery &#8211; power loss resistance<\/li><\/ul>\n\n\n\n<p>Lwext4 is an excellent choice for SD\/MMC card, USB flash drive or any other wear leveled memory types. However it is not good for raw flash devices.<\/p>\n\n\n\n<p>To be continue.<\/p>\n\n\n\n<p>Next post <a href=\"https:\/\/www.nickdu.com\/?p=896\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.nickdu.com\/?p=896<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a day to day Windows user, it&#8217;s not easy to access Linux file system. Windows doesn&#8217;t natively supports Linux Extended file system access. I have been working on Linux ARM IoT device, and it&#8217;s so annoying to be back and forth between Windows working PC and Linux development PC. I regularly need to burn\/flash &hellip; <a href=\"https:\/\/nickdu.com\/?p=890\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SharpExt4, a .Net library, provides read\/write Linux ext2\/3\/4 file system from Windows application&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12,2],"tags":[],"class_list":["post-890","post","type-post","status-publish","format-standard","hentry","category-net","category-cc","category-it"],"_links":{"self":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=890"}],"version-history":[{"count":0,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/890\/revisions"}],"wp:attachment":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}