{"id":919,"date":"2021-04-11T09:15:48","date_gmt":"2021-04-10T23:15:48","guid":{"rendered":"https:\/\/www.nickdu.com\/?p=919"},"modified":"2021-04-11T09:15:48","modified_gmt":"2021-04-10T23:15:48","slug":"how-to-use-sharpext4-a-net-library-provides-read-write-linux-ext2-3-4-file-system-from-windows-application","status":"publish","type":"post","link":"https:\/\/nickdu.com\/?p=919","title":{"rendered":"How to use SharpExt4 to access Raspberry Pi SD Card Linux partition"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In my previous post, I introduced the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/nickdu088\/SharpExt4\" data-type=\"URL\" data-id=\"https:\/\/github.com\/nickdu088\/SharpExt4\" target=\"_blank\">SharpExt4 .Net library<\/a>. In this post, I will show how to use <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/nickdu088\/SharpExt4\" target=\"_blank\">SharpExt4<\/a> to access the <a href=\"https:\/\/www.nickdu.com\/?p=851\" target=\"_blank\" rel=\"noreferrer noopener\">Raspberry Pi<\/a> SD card from Windows OS.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Take out the Raspberry Pi SD card and insert it into a USB card reader<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.nickdu.com\/wp-content\/uploads\/2021\/04\/image.png\"><img decoding=\"async\" src=\"https:\/\/www.nickdu.com\/wp-content\/uploads\/2021\/04\/image.png\" alt=\"\" class=\"wp-image-920\"\/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Run &#8220;diskpart&#8221; from Windows command prompt and find out the SD card disk number and partition number. In my case, the disk number is 3 and the partition is  2.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.nickdu.com\/wp-content\/uploads\/2021\/04\/image-1.png\"><img decoding=\"async\" src=\"https:\/\/www.nickdu.com\/wp-content\/uploads\/2021\/04\/image-1.png\" alt=\"\" class=\"wp-image-921\"\/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Clone the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/nickdu088\/SharpExt4\" target=\"_blank\">SharpExt4<\/a> from GitHub, and open Visual Studio as <strong>Admin<\/strong><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Note: <em>If you want to access physical drive, you must run application in admin permission<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.nickdu.com\/wp-content\/uploads\/2021\/04\/image-2.png\"><img decoding=\"async\" src=\"https:\/\/www.nickdu.com\/wp-content\/uploads\/2021\/04\/image-2.png\" alt=\"\" class=\"wp-image-922\"\/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Open SharpExt4 and edit the <em>Program.cs<\/em> from the Sample project<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>static void Main(string&#91;] args)\n{\n    \/\/Open Raspberry Pi SD card, see diskpart disk number\n    var disk = ExtDisk.Open(<strong>3<\/strong>);\n    \/\/Get the file system, see diskpart partition number\n    var fs = ExtFileSystem.Open(disk.Parititions&#91;<strong>1<\/strong>]);\n    \/\/List all directories in root folder\n    foreach (var file in fs.GetDirectories(\"\/\", \"*\", SearchOption.TopDirectoryOnly))\n    {\n        Console.WriteLine(file);\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the Sample project and see the result to list all the folders in Raspberry Pi root folder.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.nickdu.com\/wp-content\/uploads\/2021\/04\/image-3.png\"><img decoding=\"async\" src=\"https:\/\/www.nickdu.com\/wp-content\/uploads\/2021\/04\/image-3.png\" alt=\"\" class=\"wp-image-923\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous post, I introduced the SharpExt4 .Net library. In this post, I will show how to use SharpExt4 to access the Raspberry Pi SD card from Windows OS. Take out the Raspberry Pi SD card and insert it into a USB card reader Run &#8220;diskpart&#8221; from Windows command prompt and find out the &hellip; <a href=\"https:\/\/nickdu.com\/?p=919\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to use SharpExt4 to access Raspberry Pi SD Card Linux partition&#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-919","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\/919","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=919"}],"version-history":[{"count":0,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/919\/revisions"}],"wp:attachment":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}