You are not logged in.

#1 2014-07-27 00:40:11

Hrast
Member
Registered: 2014-07-27
Posts: 8

[SOLVED] Zpool creation fails with error

New to Arch (not to linux) and I've done this in my test environment without problem.  I'm trying to create a zpool, and I get the following:

[root@nas ~]# zpool create -f -o ashift=12 tank raidz2 ata-WL4000GSA6472E_WOL240277978 ata-WL4000GSA6472E_WOL240277990 ata-WL4000GSA6472E_WOL240278668 ata-WL4000GSA6472E_WOL240278708 ata-WL4000GSA6472E_WOL240291009 ata-WL4000GSA6472E_WOL240291031 ata-WL4000GSA6472E_WOL240291056
the kernel failed to rescan the partition table: 16
cannot label 'sdd': try using parted(8) and then provide a specific slice: -1

Version and package particulars:

[root@nas ~]# uname -a
Linux nas.priv 3.15.5-2-ARCH #1 SMP PREEMPT Fri Jul 11 07:56:02 CEST 2014 x86_64 GNU/Linux
[root@nas ~]# pacman -Q zfs-git
zfs-git 0.6.3_r0_g07dabd2_3.15.5_2-2

The controller I'm using is a cross-flashed IBM 1015.

I used sgdisk -Z /dev/sd<x> to clear any partitions, after I started seeing this.  I cleared all eight drives.

I've tried using the wwn names for the disks as well as the sd<x> nomenclature and I get the same or similar errors (the device changes based on the first one in the list).

Last edited by Hrast (2014-07-28 01:54:18)

Offline

#2 2014-07-27 03:50:31

Rubs
Member
Registered: 2014-07-27
Posts: 1

Re: [SOLVED] Zpool creation fails with error

I have the same issue, apart from the fact that I try to used raidz instead of raidz2. I tried reiterating the command which returns a different label failed every time. Running:

# parted /dev/disk/by-id/ata-ST2000DM001-1ER164_Z4Z06PRN mklabel gpt

does not work either, as one of the other disks fill produce the error.

Offline

#3 2014-07-27 23:34:43

NVS
Member
Registered: 2007-12-30
Posts: 29

Re: [SOLVED] Zpool creation fails with error

Were the drives ever part of a mdadm array? If so, verify that the array has been stopped.

Offline

#4 2014-07-27 23:56:40

Hrast
Member
Registered: 2014-07-27
Posts: 8

Re: [SOLVED] Zpool creation fails with error

Nope. they were new.

Offline

#5 2014-07-28 00:22:48

NVS
Member
Registered: 2007-12-30
Posts: 29

Re: [SOLVED] Zpool creation fails with error

You can consider trying

zpool labelclear /dev/sdX

Also, how long does it take for the command to run?

time zpool create ...
zpool create ...; time udevadm settle

At some point late last year zfsonlinux increased their internal timeout waiting for udev to update from 1 second to 30 seconds. Probably not your issue, but worth knowing if udev takes more time after zfs create has errored out. However, that would probably yield a 'cannot resolve path' type message.

Offline

#6 2014-07-28 00:35:39

Hrast
Member
Registered: 2014-07-27
Posts: 8

Re: [SOLVED] Zpool creation fails with error

Yeah, I tried labelclear in the past.  I just tried it again, and nothing changed...

[root@nas ~]# time zpool create -f -o ashift=12 tank raidz2 sdb sdc sdd sde sdf
the kernel failed to rescan the partition table: 16
cannot label 'sdb': try using parted(8) and then provide a specific slice: -1

real	0m0.120s
user	0m0.003s
sys	0m0.013s
[root@nas ~]# zpool create -f -o ashift=12 tank raidz2 sdb sdc sdd sde sdf; time udevadm settle
the kernel failed to rescan the partition table: 16
cannot label 'sdb': try using parted(8) and then provide a specific slice: -1

real	0m0.036s
user	0m0.000s
sys	0m0.000s
[root@nas ~]#

It does not appear to be a timing issue.

Offline

#7 2014-07-28 01:14:09

NVS
Member
Registered: 2007-12-30
Posts: 29

Re: [SOLVED] Zpool creation fails with error

Have you tried running the command multiple times back to back? It might just work. In this ticket someone also shoved `udevadm trigger` in between each try. I cannot vouch for this approach, but I cannot see any harm either.

Have the drives been used previously by ZFS? If so, maybe the labels are not in the expected locations. You might consider using dd to zero out the MBT/GPT manually. I know sgdisk -Z did not work for me in a particular instance that I had to replace a drive. Keep in mind that unlike a MBT, GPT is both at the start and end of a drive. The seek option of dd (as opposed to skip) is what you'd want.

Still, I know I've personally run into this issue before. It certainly can be frustrating. And it can feel like you're beating around a bush just to get it to work. Here is a fairly recent ticket with essentially your same issue.

Last edited by NVS (2014-07-28 01:16:15)

Offline

#8 2014-07-28 01:29:50

Hrast
Member
Registered: 2014-07-27
Posts: 8

Re: [SOLVED] Zpool creation fails with error

Wow.  I ran strace on the create command, and kept running it, and after 5-10 attempts it created the pool successfully.  It appears I was having the problem listed that Git Issue you linked.  Thanks for your help, I hope they get that one fixed soon.

EDIT - Just so I'm clear, I don't think strace had anything to do with it, I just kept running the damn command over and over again, as that was the last one in my history.

Last edited by Hrast (2014-07-28 01:53:42)

Offline

#9 2014-07-28 02:09:37

NVS
Member
Registered: 2007-12-30
Posts: 29

Re: [SOLVED] Zpool creation fails with error

Glad to hear it worked. And yeah, I doubt strace had anything to do with making it work. Just persistence.

Pretty certain that it is an issue with not waiting long enough in their code. Seems the issue may be addressed sooner than later.

Last edited by NVS (2014-07-28 02:11:15)

Offline

#10 2014-09-28 19:30:40

Marcher
Member
From: Gainesville, FL
Registered: 2013-06-04
Posts: 3

Re: [SOLVED] Zpool creation fails with error

In case anyone is wondering I was able to zero out the MBT using the instructions listed here.

https://www.bfccomputing.com/zero-a-gpt-label-using-dd/

Offline

#11 2015-01-03 10:05:44

Bronek
Member
From: London
Registered: 2014-02-14
Posts: 119

Re: [SOLVED] Zpool creation fails with error

I had this problem, and patching my archzfs with https://github.com/zfsonlinux/zfs/commi … 64d6097e19 mentioned in https://github.com/zfsonlinux/zfs/issues/2582 fixed it. The same patch also fixed other problem when "zpool import -d /dev/disk/by-id" was intermittently failing with "device busy" error.

Offline

Board footer

Powered by FluxBB