Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rc2: created zpool stuck in limbo after creation and part identifiers changed #220

Open
colemickens opened this issue Apr 13, 2023 · 11 comments

Comments

@colemickens
Copy link

This is with the ZFS for Windows RC2.

I shrank my C: drive, added a new partition, and did not reboot.

I was able to create a pool with zpool create zfsin Harddisk0Partition8 (though I did hit this: openzfsonwindows/ZFSin#349, but proceeded as the OP there indicates that the pool does still work regardless of the error output).

However, when I rebooted, zpool list returned no results. Upon looking at diskpart, it seems that Windows decided to rename the partitions, so the partition I created the zpool on is now named Harddisk0Partition4. (it is indeed the 4th partition)

However, if I try to again create the pool with the new partition identifier, it's revealed that somewhere "ZFS for Windows" knows that pool once existed:

zephwin-> zpool list
no pools available

zephwin-> zpool create -O driveletter=Z zfsin Harddisk0Partition4
Expanded path to '\\?\Harddisk0Partition4'
invalid vdev specification
use '-f' to override the following errors:
\\?\Harddisk0Partition4 is part of potentially active pool 'zfsin'

Is it possible that somewhere ZFS is (probably correctly) normalizing that identifier to something more concrete, but somehow zfs list is using the original, maybe unstable identifier?

I haven't tried -f yet, but maybe I will. I feel like this hints at some sort of normalization/book-keeping bug, possibly? Clearly some parts of ZFS know that "zfsin" existed? Or is "ZFS for Windows" completely unaware, and it's just sanity checking the RAW disk and seeing that it has metadata indicating it's part of a pool?

Even if it's the latter, it still feels like that partition identifier should be rejected in favor of the partition GUID, or it should internally normalize it to the partition GUID and use it going forward.

(I don't think this repo has Discussions enabled, but I plan to experiment around with this new, non-critical pool from both Windows and Linux (NixOS). I will try to find somewhere appropriate to share any results positive or negative.)

@colemickens
Copy link
Author

It seems to have worked "ok" using -f. However, setting the driveletter isn't really doing what I'd expect. On my system, the next drive letter was "D:" and it seems to have been mounted with that letter instead of Z as expected (-O driveletter=Z)

@colemickens
Copy link
Author

colemickens commented Apr 13, 2023

I'm not now realizing that maybe zpools aren't imported by default, so maybe that was really the whole crux of the issue. I rebooted after force recreating the pool, and it wasn't listed. After running zpool import zfsin, I see the drive (again with D:) and the test data present.

Maybe I missed it but is there a way to have the pool auto-mounted?

@lundman
Copy link

lundman commented Apr 13, 2023

Hello, yes sorry there is no auto pool import just yet, i think someone on wiki mentioned you can do a windows "after-boot" hook to run it, I've not yet tried it.

https://openzfsonosx.org/wiki/Windows_import

If you set driveletter=Z then I would have expected that to work, so maybe we need to check that for a bug.

Can you show us zfs get driveletter zfsin ?

@colemickens
Copy link
Author

I've actually changed it to d to match Windows, but I know for sure that I ran this post-pool-creation and it reported Z. I also issued zfs set driveletter=Z zfsin and rebooted and still saw it taking "D:"

This is what I had gotten before I updated it to d

NAME   PROPERTY     VALUE        SOURCE
zfsin  driveletter  Z            local

@colemickens
Copy link
Author

Additionally, I created a scheduled task, set to trigger "On startup", run as "SYSTEM", to run a batch script that just imports the pool. By time I login, I see it mounted and available.

@colemickens
Copy link
Author

Someone else had reported driveletter issue too: #135

@inoperable
Copy link

inoperable commented Apr 14, 2023

This issue is solved, actually.
What you need to do is import -> umount -> mount pools/datasets with timeouts
to make sure Windows is capable of keep up (...)

Below a Task Scheduler I use plus my very commented .cmd file you can modify
I added a small and extensive variant, Windows tends to enable administrative shares
on drive letters so I added a netshare delete loop into that batch - just remove the whole thing.
Hope you don't get a headache while going through the goto hell
zfs_cmds.zip

I started to write that insanity initially with Powershell, but I quickly found out that I prefer .bat files
instead of finding out about insane process handling in powershell pipes

@colemickens
Copy link
Author

Respectfully, and I do appreciate it, but that doesn't seem "solved" to me?

Also, I booted Windows with an external hard drive plugged in, the external drive got D:\ and now my ZFS pool seems to be stuck always getting E:\. I did confirm that driveletter is still set to d.

Let me know, but I feel like I should rename this issue, open a newly titled one, or close in favor of #135, which I now realize you opened @inoperable ...

@lundman
Copy link

lundman commented May 29, 2023

Ah did you expect it to be able to kick an existing (D:) off, and have ZFS take its place? I don't know if you can do that. driveletter is more of a "make an effort, if you can, to take this driveletter, when available"

@colemickens
Copy link
Author

Well I've rebooted a dozen or more times without the HDD attached and the ZFS pool still mounts as E:.

@lundman
Copy link

lundman commented May 29, 2023

OK I'll try to replicate here as well, see if I can get it to fail too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants