btrfs icon indicating copy to clipboard operation
btrfs copied to clipboard

Unable to uninstall

Open Zodiaksl opened this issue 1 year ago • 27 comments

Hello,

I am on Windows 11

I am currently trying to remove BTRFS following the instructions provided on the github page.

I ran CMD as admin and used

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 btrfs.inf

the notes say that "You may need to give the full path to btrfs.inf". I did not know where the file w as located, doing a search, I found the following location:

C:\btrfs-1.9\btrfs.inf_amd64_2a582010388bb96f

So I then tried running the command line again but this time with the path

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 C:\btrfs-1.9\btrfs.inf_amd64_2a582010388bb96f

Both of these commands gave me the same error of:

Error: Installation failed

I'm trying to uninstall BTRFS from Windows 11, not reinstall it.

Help please

Zodiaksl avatar Apr 30 '24 19:04 Zodiaksl

Same happens on my w10, Microsoft Windows [Version 10.0.19044.3086].

Can I help with some debugging on my machine?

sskras avatar May 03 '24 19:05 sskras

hmm, If you are trying to remove the system driver shouldn't path be an actual driver .inf ? like so: c:\Windows\System32\DriverStore\FileRepository\btrfs.inf_amd64_eee2870164cc723a\btrfs.inf

or the windows copy of it: c:\Windows\INF\oem147.inf (oem147 is a windows generated name so you need to check the name in "driver' tab of the btrfs volume device.

pee-tu avatar May 07 '24 09:05 pee-tu

Just tried both paths to no avail: "Installation failed."

image

sskras avatar May 07 '24 10:05 sskras

it seem you are not using elevated prompt. Try to use admin command line.

pee-tu avatar May 07 '24 15:05 pee-tu

it seem you are not using elevated prompt. Try to use admin command line.

Hello,

Thanks for the reply.

This time around I did the following command as requested.

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 C:\Windows\System32\DriverStore\FileRepository\btrfs.inf_amd64_eee2870164cc723a\btrfs.inf

Nothing appears to have happened, but the prompt came back cleanly with no errors or fussing.

I've since then rebooted my computer.

How can I verify that the BTRFS driver has been successfully uninstalled?

Thank you

Zodiaksl avatar May 07 '24 15:05 Zodiaksl

it seem you are not using elevated prompt. Try to use admin command line.

OK, I did. The result same as written by @Zodiaksl – nothing happens except for my taskbar flashing two times in a half of second:

image

sskras avatar May 07 '24 17:05 sskras

@Zodiaksl wrote:

How can I verify that the BTRFS driver has been successfully uninstalled?

I think using sc query is good enoough:

C:\Windows\system32> sc query btrfs

SERVICE_NAME: btrfs
        TYPE               : 1  KERNEL_DRIVER
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

On my box it shows that BTRFS driver is still running.

sskras avatar May 07 '24 17:05 sskras

Open an elevated Regedit Set HKLM\SYSTEM\CurrentControlSet\services\btrfs\Start to 4 Reboot and delete C:\Windows\System32\drivers\btrfs.sys

maharmstone avatar May 07 '24 17:05 maharmstone

CMD

I tried the sc querry btrfs after doing RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 C:\Windows\System32\DriverStore\FileRepository\btrfs.inf_amd64_eee2870164cc723a\btrfs.inf and it's still there.

Regedit

I then launched Regedit as admin, went to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\btrfs and set it to 4 and rebooted.

I then rebooted, went to C:\Windows\System32\drivers and tried to delete btrfs.sys but it's not letting me, even though my user account is set to administrator.

Delete Error

Zodiaksl avatar May 07 '24 21:05 Zodiaksl

alright, that command (one using RUNDLL32.exe) does not work because of this: _

Starting with Windows 10 version 1903, the DefaultUninstall and DefaultUninstall.Services sections are prohibited, (with exception). These sections were optional in prior OS versions. _

Apparently rundll32 uninstallation has been deprecated and forbidden to use. Neither btrfs.inf nor btrfs-vol.inf have DefaultUninstall .inf section (which is correct). Ducumetation is either outdated or command never worked. rundlll32.exe will do nothing. No action is taked and that could be observed in c:\Windows\INF\setupapi.dev.log :

[Boot Session: 2024/05/07 15:46:45.500]
>>>  [Device Installation Restrictions Policy Check]
>>>  Section start 2024/05/07 15:48:01.702
<<<  Section end 2024/05/07 15:48:01.811
<<<  [Exit status: SUCCESS]

Nevertheless there is a short PS script provided with chocolatey btrfs package that almost did the trick: ProgramData\chocolatey\lib\winbtrfs\tools\chocolateyuninstall.ps1

$ErrorActionPreference = 'Stop';
$toolsDir   = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

Write-Host -ForegroundColor green	"Listing drivers"
$btrfsDrivers = Get-WmiObject win32_pnpsigneddriver | where { $_.DeviceName -like "*btrfs*" -and $_.InfName -like "*oem*"}

foreach($driver in $btrfsDrivers)
{
	Write-Host -ForegroundColor green "Removing driver" $driver.DeviceName $driver.InfName 
	pnputil -f -d $driver.InfName
}

Problem with this script is it's unable to remove both drivers. Yeap are two : btrfs.inf and btrfs-vol.inf It could properly indentify only btrfs driver, the volume driver was not detected. Aditionally there is a problem with btrfs service: it's incomplete hence there is no possiblility to stop it from system side (other than not to start it).

In the end to completely remove btrfs from system one need to do few steps:

  1. grep \Window\inf folder for btrfs string (for example in my case oem146.inf and oem147.inf were the offenders)
  2. "sc delete btrfs" ( or deleting HKLM \SYSTEM\CurrentControlSet\Services\btrfs key entirely ) then reboot
  3. pnputil.exe -f -d oem146.inf
  4. pnputil.exe -f -d oem147.inf
  5. manually remove btrfs storage device in devmgmt.msc

pee-tu avatar May 07 '24 21:05 pee-tu

In the end to completely remove btrfs from system one need to do the steps:

  1. grep \Window\inf folder for btrfs string (for example in my case oem146.inf and oem147.inf were the offenders)
  2. "sc delete btrfs" ( or deleting HKLM \SYSTEM\CurrentControlSet\Services\btrfs key entirely ) then reboot
  3. pnputil.exe -f -d oem146.inf
  4. pnputil.exe -f -d oem147.inf
  5. manually remove btrfs storage device in devmgmt.msc

I don't understand what grep is, means or how to do it, is it just a cmd command?

Zodiaksl avatar May 07 '24 21:05 Zodiaksl

sorry, grep is an idiom from linux world derived from program name grep used for searching things. in widows you can use findstr:

cd c:\Windows\INF
findstr /m /s /i /c:"Btrfs driver" *.inf

pee-tu avatar May 07 '24 21:05 pee-tu

Not really, sohuld be max two. I do not know the correct syntax out of my head. Use findstr manual (easy to find on MS sites) Basically you want to find *.inf files that have "Btrfs driver" string in them.

pee-tu avatar May 07 '24 22:05 pee-tu

Not really, sohuld be max two. I do not know the correct syntax out of my head. Use findstr manual (easy to find on MS sites) Basically you want to find *.inf files that have "Btrfs driver" string in them.

Just do findstr /? to get the --help info that'll be more than enough; /? goes for the vast majority of pre-PowerShell apps, it even works with PowerShell (I just tested, haven't used Batch/CMD for years).

rautamiekka avatar May 07 '24 22:05 rautamiekka

Not really, sohuld be max two. I do not know the correct syntax out of my head. Use findstr manual (easy to find on MS sites) Basically you want to find *.inf files that have "Btrfs driver" string in them.

Just do findstr /? to get the --help info that'll be more than enough; /? goes for the vast majority of pre-PowerShell apps, it even works with PowerShell (I just tested, haven't used Batch/CMD for years).

Don't confuse me more than I already am @_@

I barely know cmd or powershell commands.

I just wish for a clear and easy way to uninstall the BTRFS drives.

Zodiaksl avatar May 07 '24 22:05 Zodiaksl

findstr /m /s /i /c:"Btrfs driver" *.inf worked for me

pee-tu avatar May 07 '24 23:05 pee-tu

findstr /m /s /i /c:"Btrfs driver" *.inf worked for me

CMD

This is the result I got from it. Does that look right? If so, what do I do next?

Zodiaksl avatar May 07 '24 23:05 Zodiaksl

wrong folder cd c:\Windows\INF

pee-tu avatar May 07 '24 23:05 pee-tu

now you are in wrong folder and have wrong command:. change directory to windows\inf and then use the original command

pee-tu avatar May 07 '24 23:05 pee-tu

CMD

Is this right this time? Sorry, I'm trying.

Do I just go there and delete those files?

Zodiaksl avatar May 08 '24 03:05 Zodiaksl

image Does this not work for you??

itsTyrion avatar May 31 '24 13:05 itsTyrion

image Does this not work for you??

"Storage volumes" does not show up in my Device Manager

Zodiaksl avatar May 31 '24 15:05 Zodiaksl

CMD

I tried the sc querry btrfs after doing RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 C:\Windows\System32\DriverStore\FileRepository\btrfs.inf_amd64_eee2870164cc723a\btrfs.inf and it's still there.

Regedit

I then launched Regedit as admin, went to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\btrfs and set it to 4 and rebooted.

I then rebooted, went to C:\Windows\System32\drivers and tried to delete btrfs.sys but it's not letting me, even though my user account is set to administrator.

Delete Error

Try this, change the file read permission.

Right click %Windows%/system32/drivers/btrfs.sys, press r. Switch to "safe" tab, click "Enhance edit(v)"(I haven't set system language as English. Maybe this is not correct. Please find the button with this meaning.) . Then, add permission user. When you need to insert name of your account, asking by the system, you can click "Enhance search...", and then find name of account in the list. Press OK(or Enter?), and ok for the previous dialog box including the safe tab.

Next, delete the Btrfs driver, try.

musicomputer-tao avatar Jun 22 '24 17:06 musicomputer-tao

CMD I tried the sc querry btrfs after doing RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 C:\Windows\System32\DriverStore\FileRepository\btrfs.inf_amd64_eee2870164cc723a\btrfs.inf and it's still there. Regedit I then launched Regedit as admin, went to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\btrfs and set it to 4 and rebooted. I then rebooted, went to C:\Windows\System32\drivers and tried to delete btrfs.sys but it's not letting me, even though my user account is set to administrator. Delete Error

Try this, change the file read permission.

Right click %Windows%/system32/drivers/btrfs.sys, press r. Switch to "safe" tab, click "Enhance edit(v)"(I haven't set system language as English. Maybe this is not correct. Please find the button with this meaning.) . Then, add permission user. When you need to insert name of your account, asking by the system, you can click "Enhance search...", and then find name of account in the list. Press OK(or Enter?), and ok for the previous dialog box including the safe tab.

Next, delete the Btrfs driver, try.

Hello,

Thank you for the reply.

I've just tried doing this.

C:\Windows\system32\drivers, find btrfs.sys > Right click > Properties > Security > Advanced > Changed the Owner from TrustedInstaller to my user Bryce (GAMING\Bryce) and even gave myself Full Control.

Then I tried deleting the file and it still wouldn't let me, so I rebooted the computer.

Even after rebooting it still wouldn't let me, saying I needed approval from the owner and even listing ME (Bryce (GAMING\Bryce) as the owner.

I had to go back INTO Security and this time go into Show Advanced Permissions and I just checked all 13 of the permissions boxes that were not even all under Advanced permissions...

But files appear to have been deleted now... I hope.

Zodiaksl avatar Jun 22 '24 20:06 Zodiaksl

命令 完成后,我尝试了 sc querry btrfs RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 C:\Windows\System32\DriverStore\FileRepository\btrfs.inf_amd64_eee2870164cc723a\btrfs.inf,但它仍然存在。 然后我以管理员身份启动 Regedit,转到 Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\btrfs 并将其设置为 4,然后重新启动。 然后我重新启动,转到 C:\Windows\System32\drivers 并尝试删除 btrfs.sys,但它不让我删除,即使我的用户帐户设置为管理员。 注册表编辑 删除错误

尝试一下,改变文件的读取权限。 右键点击%Windows%/system32/drivers/btrfs.sys,按r键。切换到“安全”选项卡,点击“增强编辑(v)”(我没有将系统语言设置为英语。可能不正确。请找到具有此含义的按钮。)。然后,添加权限用户。当您需要输入账户名称时,系统会询问,您可以点击“增强搜索...”,然后在列表中找到账户名称。按OK(或Enter?),然后对包含安全选项卡的上一个对话框单击确定。 接下来删除Btrfs驱动,试试。

你好,

谢谢您的回复。

我刚刚尝试这样做。

C:\Windows\system32\drivers,找到 btrfs.sys > 右键单击​​ > 属性 > 安全 > 高级 > 将所有者从 TrustedInstaller 更改为我的用户 Bryce (GAMING\Bryce),甚至授予自己完全控制权。

然后我尝试删除该文件但仍然不允许,所以我重新启动了计算机。

即使重新启动后,它仍然不允许我这样做,说我需要得到所有者的批准,甚至将我(Bryce(GAMING\Bryce))列为所有者。

我不得不回到安全界面,这次进入显示高级权限,我刚刚检查了所有 13 个权限框,这些权限框甚至不全部在高级权限下......

但是文件现在似乎已被删除...我希望。

可以尝试一下这个软件!也许可以删除! image

starfish0422 avatar Aug 14 '24 14:08 starfish0422

The problem is , [DefaultUninstall] is not in btrfs.inf !!!!! it's missing in the new version of winbtrfs!!!

shade233 avatar Oct 01 '24 08:10 shade233

Like others who posted here, i had some problems completely removing the driver. Wasn't having success with things in this thread, I end up starting from scratch & I was able to fully remove the Btrfs drivers successfully using only device manager. Thought I'd make an account to post this, as maybe it could help others.

  1. Open device manager (however you prefer: with devmgmt.msc command, control panel, or windows search)
  2. under storage device/storage controller. right click on BTRFS items and select uninstall driver, check the options (attempt/forcing)
  3. restart PC
  4. open device manager again
  5. this time, click on the view drop down menu and select "devices by driver"
  6. look for any btrfs items

Image

I had 2, oem6 and oem49 (the oem## is auto-assigned by windows, individual PCs will be different) 7) right click to uninstall, check the boxes (attempt/force options) and uninstall 8) restart PC 9) use cmd prompt "sc query btrfs" to verify btrfs is gone, example in my pic below

Image

0cr3 avatar Mar 15 '25 19:03 0cr3