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

Renaming a zvol with partition(s) does not move/rename the ”-partX” entries in /dev/zvol. #4282

Closed
cumafo opened this issue Jan 28, 2016 · 2 comments
Labels
Status: Inactive Not being actively updated Status: Stale No recent activity for issue Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@cumafo
Copy link

cumafo commented Jan 28, 2016

spl & zfs: 0.6.5.4-1~trusty

@loli10K
Copy link
Contributor

loli10K commented Aug 17, 2017

Sometimes udev needs a little push in the right direction:

[root@centos ~]# POOLNAME="testpool"
[root@centos ~]# TMPDIR='/var/tmp'
[root@centos ~]# #
[root@centos ~]# mountpoint -q $TMPDIR || mount -t tmpfs tmpfs $TMPDIR
[root@centos ~]# zpool destroy $POOLNAME
[root@centos ~]# rm -f $TMPDIR/zpool.dat
[root@centos ~]# fallocate -l 128m $TMPDIR/zpool.dat
[root@centos ~]# zpool create $POOLNAME $TMPDIR/zpool.dat
[root@centos ~]# #
[root@centos ~]# zfs create -V 64M -s $POOLNAME/zvol
[root@centos ~]# udevadm trigger
[root@centos ~]# udevadm settle
[root@centos ~]# parted /dev/zvol/$POOLNAME/zvol -s -- mklabel gpt
[root@centos ~]# parted /dev/zvol/$POOLNAME/zvol -s -- mkpart part0 1cyl 1cyl
[root@centos ~]# udevadm trigger
[root@centos ~]# udevadm settle
[root@centos ~]# #
[root@centos ~]# ls -l /dev/zvol/$POOLNAME/
total 0
lrwxrwxrwx. 1 root root  9 Aug 17 14:05 zvol -> ../../zd0
lrwxrwxrwx. 1 root root 11 Aug 17 14:05 zvol-part1 -> ../../zd0p1
[root@centos ~]# #
[root@centos ~]# zfs rename $POOLNAME/zvol $POOLNAME/new
[root@centos ~]# #
[root@centos ~]# ls -l /dev/zvol/$POOLNAME/
total 0
lrwxrwxrwx. 1 root root  9 Aug 17 14:06 new -> ../../zd0
lrwxrwxrwx. 1 root root 11 Aug 17 14:05 zvol-part1 -> ../../zd0p1
[root@centos ~]# #
[root@centos ~]# udevadm trigger
[root@centos ~]# udevadm settle
[root@centos ~]# ls -l /dev/zvol/$POOLNAME/
total 0
lrwxrwxrwx. 1 root root  9 Aug 17 14:06 new -> ../../zd0
lrwxrwxrwx. 1 root root 11 Aug 17 14:06 new-part1 -> ../../zd0p1
[root@centos ~]# 

I don't know if there's anything we can do in zfs via libudev, leaving this open in case someone wants to work on this.

@stale
Copy link

stale bot commented Aug 25, 2020

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.

@stale stale bot added the Status: Stale No recent activity for issue label Aug 25, 2020
@stale stale bot closed this as completed Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Inactive Not being actively updated Status: Stale No recent activity for issue Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

3 participants
@loli10K @cumafo and others