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

vdev_id.conf slot mapping fails on Debian 7 #2965

Closed
ghost opened this issue Dec 17, 2014 · 2 comments
Closed

vdev_id.conf slot mapping fails on Debian 7 #2965

ghost opened this issue Dec 17, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 17, 2014

After a ZFS upgrade on a Debian 7 server, my JBOD slot mappings defined in /etc/zfs/vdev_id.conf were broken. When I ran the vdev_id script manually on a device, I got the following:

# /lib/udev/vdev_id -d sde              
awk: line 1: regular expression compile failed (missing operand)
^(A|)$                                                          
ID_VDEV=A9                                                      
ID_VDEV_PATH=disk/by-vdev/A9                                    

The device should actually be mapped to A10 (linux slot 9 mapped to A10), but the awk error prevents the mapping and so the bay_identifier value is used instead. I have an older ZFS version installed on CentOS, and I copied it to this same Debian server, and that scripted worked fine. It appears the change for issue #2056 introduced this problem (specifically this diff: nedbass@533d96a#diff-081bd452e1418e3d0dfab42b86a44142L115). I did a bit more investigation and noticed that the versions of awk are different between Debian and CentOS, the former being "mawk" while the latter is "gawk". Apparently the new syntax is not portable between them. After I installed gawk on the Debian server, the error is gone and my mappings are correct again:

# /lib/udev/vdev_id -d sde                                                                                                                                    
ID_VDEV=A10
ID_VDEV_PATH=disk/by-vdev/A10

I would have suggested adding a gawk dependency to the Debian package, but not sure that will fly. I have found some similar issues that avoided doing so: #76 (gawk dependency was removed) and #259 (awk usage was replaced)

@FransUrbo
Copy link
Contributor

This belong to https://github.com/zfsonlinux/pkg-zfs, where the Debian GNU/Linux packages are managed and not here, which deals with the core software ZFS On Linux.

@ghost
Copy link
Author

ghost commented Dec 17, 2014

Thanks, I wasn't aware. I'll reopen there if necessary.

@ghost ghost closed this as completed Dec 17, 2014
nedbass added a commit to nedbass/zfs that referenced this issue Dec 17, 2014
Slot mapping in vdev_id doesn't work on systems using mawk as the 'awk'
alternative. A regular expression in map_slot() contains an unquoted
empty string following the alternation (|) operator, which results in an
"missing operand" error with mawk. The solution is to quote the empty
string.

Issue zfsonlinux/pkg-zfs#136
Issue openzfs#2965

Signed-off-by: Ned Bass <bass6@llnl.gov>
nedbass added a commit to nedbass/zfs that referenced this issue Dec 17, 2014
Slot mapping in vdev_id doesn't work on systems using mawk as the 'awk'
alternative. A regular expression in map_slot() contains an unquoted
empty string following the alternation (|) operator, which results in an
"missing operand" error with mawk. The solution is to rearrange the
expression so the alternation has two operands.

Issue zfsonlinux/pkg-zfs#136
Issue openzfs#2965

Signed-off-by: Ned Bass <bass6@llnl.gov>
nedbass added a commit to nedbass/zfs that referenced this issue Dec 17, 2014
Slot mapping in vdev_id doesn't work on systems using mawk as the 'awk'
alternative. A regular expression in map_slot() contains an unquoted
empty string following the alternation (|) operator, which results in an
"missing operand" error with mawk. The solution is to rearrange the
expression so the alternation has two operands.

Issue zfsonlinux/pkg-zfs#136
Issue openzfs#2965

Signed-off-by: Ned Bass <bass6@llnl.gov>
behlendorf pushed a commit to behlendorf/zfs that referenced this issue Dec 19, 2014
Slot mapping in vdev_id doesn't work on systems using mawk as the 'awk'
alternative. A regular expression in map_slot() contains an unquoted
empty string following the alternation (|) operator, which results in an
"missing operand" error with mawk. The solution is to rearrange the
expression so the alternation has two operands.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/pkg-zfs#136
Closes openzfs#2965
dajhorn added a commit to zfsonlinux/pkg-zfs that referenced this issue Dec 20, 2014
Commit: openzfs/zfs@2d9d57b
From: Ned Bass <bass6@llnl.gov>
Date: Wed, 17 Dec 2014 11:01:42 -0800
Subject: vdev_id: use mawk-compatible regular expression

Slot mapping in vdev_id doesn't work on systems using mawk as the 'awk'
alternative. A regular expression in map_slot() contains an unquoted
empty string following the alternation (|) operator, which results in an
"missing operand" error with mawk. The solution is to rearrange the
expression so the alternation has two operands.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #136
Closes openzfs/zfs#2965
This issue was closed.
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

1 participant