<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cannot delete file in dbfs in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/cannot-delete-file-in-dbfs/m-p/41248#M27318</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/84270"&gt;@erigaud&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;The issue you're facing might be due to the fact that the folder was a mounted storage account that has been deleted. This could cause some inconsistencies in the file system view and hence, you're unable to delete the folder.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;You can try using Databricks Utilities to refresh the mounts and then attempt to delete the folder again.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Here is the command you can use in Databricks notebook:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;python&lt;BR /&gt;dbutils.fs.refreshMounts()&lt;BR /&gt;dbutils.fs.rm("/mnt/my_folder", recurse=True)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;This command will refresh the state of the mounts in your workspace and then attempt to delete the folder recursively.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Aug 2023 22:26:23 GMT</pubDate>
    <dc:creator>Priyanka_Biswas</dc:creator>
    <dc:date>2023-08-23T22:26:23Z</dc:date>
    <item>
      <title>Cannot delete file in dbfs</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-delete-file-in-dbfs/m-p/39660#M27050</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to delete a folder in /dbfs/mnt, but I am unable to do so. The folder was an old mounted storage account, which was deleted. The folder contains a single file 'mount.err'.&lt;/P&gt;&lt;P&gt;In command line I tried&lt;STRONG&gt; rm -rf my_folder&lt;/STRONG&gt;, with and without sudo. I also tried to rename the folder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whatever I try, I get the following error :&amp;nbsp;&lt;STRONG&gt;rm: cannot remove 'my_folder/mount.err': Input/output error&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I also tried in a notebook and with dbutils, but one again without success.&lt;/P&gt;&lt;P&gt;I tried repairing the filesystem with&amp;nbsp;fsck.ext4, without success.&lt;/P&gt;&lt;P&gt;Please let me know if someone has a solution, thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 13:58:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-delete-file-in-dbfs/m-p/39660#M27050</guid>
      <dc:creator>erigaud</dc:creator>
      <dc:date>2023-08-11T13:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete file in dbfs</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-delete-file-in-dbfs/m-p/41271#M27322</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for the answer !&lt;/P&gt;&lt;P&gt;The problem was indeed coming from a broken mount point. After running the refreshMounts() command, I still was not able to remove the folder, because the command was throwing a NullPointerException. However I was able to run the&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;dbutils.fs.unmount&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;command on the broken folder (even though before it did not work and the folder was not showing up when I was trying to list all the mounts.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After running the unmount command I was able to delete the folder just fine. Thank you !&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 06:11:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-delete-file-in-dbfs/m-p/41271#M27322</guid>
      <dc:creator>erigaud</dc:creator>
      <dc:date>2023-08-24T06:11:40Z</dc:date>
    </item>
  </channel>
</rss>

