You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using zfs rename, zvol links are not being updated correctly after the rename. Along the way, at least two other problems may be encountered too. See example below for details. I'll note in advance that the results you see may vary somewhat from the results that I show. I've run several of the trials shown below with differing results each time.
Describe how to reproduce the problem
0: The problem of missing / disappearing zvol links also occurs after shutting down a VM. (See ##12712 .) It's serious enough that I've created a small script which resets (fixes) zvol links when I notice that they're messed up. I now run it (by hand) every time I shut down a VM. Here's an attachment with a gzip'd version of the script that I'm using to fix the zvol links:
3: Create zvols and partition them, giving them two partitions each:
[root@ocotillo ~]# for d in D{1..8}; do zfs create -V 100MiB $POOL/$DSP-1/$d; D=/dev/zvol/$POOL/$DSP-1/$d; echo $D; sgdisk -Z -n1:1M:+49M -n2:0:0 $D; done
/dev/zvol/puddle/rename-test-1/D1
Creating new GPT entries in memory.
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
The operation has completed successfully.
/dev/zvol/puddle/rename-test-1/D2
...
Notice that links are missing for D5-part2 and D6-part2. This is another (perhaps related) bug, but I'm going to include it here along with the zfs rename problem.
5: Use script fix-zvol-links to add those missing links and examine directory again:
That commit from #12759 fixes two of the three problems that I reported. In particular, all links are present after creating the zvols and partitioning them. Also, after the rename, all of the D1..D8 links are present in /dev/zvol/$POOL/$DSP-2.
However, all of the D{1..8}-part{1,2} links are still present in /dev/zvol/$POOL/$DSP-1. I think this is a different bug from the one that's being fixed by #12759.
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.
System information
Describe the problem you're observing
When using zfs rename, zvol links are not being updated correctly after the rename. Along the way, at least two other problems may be encountered too. See example below for details. I'll note in advance that the results you see may vary somewhat from the results that I show. I've run several of the trials shown below with differing results each time.
Describe how to reproduce the problem
0: The problem of missing / disappearing zvol links also occurs after shutting down a VM. (See ##12712 .) It's serious enough that I've created a small script which resets (fixes) zvol links when I notice that they're messed up. I now run it (by hand) every time I shut down a VM. Here's an attachment with a gzip'd version of the script that I'm using to fix the zvol links:
fix-zvol-links.gz
I will use this script twice in the example below to fix the links prior to proceeding to the next step.
1: Set up variables for pool name and data set prefix:
2: Create dataset
[root@ocotillo ~]# zfs create $POOL/$DSP-1
3: Create zvols and partition them, giving them two partitions each:
4: Examine /dev/zvol/$POOL/$DSP-1:
Notice that links are missing for D5-part2 and D6-part2. This is another (perhaps related) bug, but I'm going to include it here along with the zfs rename problem.
5: Use script fix-zvol-links to add those missing links and examine directory again:
Note that all links are now present.
6: Rename dataset containing the zvols / partitions that were created:
[root@ocotillo puddle]# zfs rename $POOL/$DSP-1 $POOL/$DSP-2
7: Examine directory, $DSP-2, in which we expect to see the various zvol / partition links:
Note that this directory is woefully underpopulated. This demonstrates the bug.
8: Examine directory, $DSP-1; the fact that this directory still exists is also a bug.
Note that the partition links are still in $DSP-1. This is also a bug; these links should now be in $DSP-2.
9: Run workaround script fix-zvol-links again and observe correct link placement:
The fact that rename-test-1 no longer exists is good; that's what we should have seen in step 8, above. Continuing...
This is the output that we should have seen in step 7.
10: Clean up:
[root@ocotillo puddle]# zfs destroy -r $POOL/$DSP-2
The text was updated successfully, but these errors were encountered: