6

When I try to create a ZPool, the following error occurs:

user@arch ~ % sudo zpool create -f -o ashift=12 -m /data media raidz /dev/disk/by-id/ata-ST2000DM001-1CH164_Z2F0TL8V /dev/disk/by-id/ata-ST2000DM001-1ER164_Z4Z030LK /dev/disk/by-id/ata-ST2000DM001-1ER164_Z4Z06PR
the kernel failed to rescan the partition table: 16  
cannot label 'sda': try using parted(8) and then provide a specific slice: -1

I have tried running the command multiple times back to back (running udevadm trigger in between too), clearing the drives using sgdisk -Z /dev/sdX. I tried parted /dev/sdX mklabel gpt as well as zpool labelclear /dev/sdX.

I have referred to the drives by /dev/disk/by-id as well as /dev/sdX but the same error occurs where the label changes depending on the order of the drives.

2
  • What about trying hdparm -z /dev/sdX prior as well? – slm Jul 28 '14 at 13:47
  • Unfortunately, this does not work either. I cycled through this command prior to creating the ZPool but I still get the same error. – Ruben Jul 29 '14 at 6:22
5

Searching for your error I came across this blog post titled: Error creating zfs pools using drives that belonged to a md raid array which showed your same error.

$ zpool create -f tank mirror /dev/disk/by-id/xxx /dev/disk/by-id/yyy the kernel failed to rescan the partition table: 16 cannot label 'sdb': try using parted(8) and then provide a specific slic

The article stated that the issue arose from the device being added to a unused MDADM array.

Even if the old mdadm array was no longer being mounted (as more than one disk > was missing and it was a raid5) they were still being added to md0:

  $ cat /proc/mdstat Personalities : [linear] [raid0] [raid1] [raid10] [raid6] > [raid5] [raid4] [multipath]
  md0 : inactive sdd1[4](S) sdb1[1](S)
  3907025072 blocks super 1.2

  unused devices:

The fix to this particular issue is as follows:

$ mdadm --stop /dev/md0
mdadm: stopped /dev/md0

$ zpool create -f tank mirror /dev/disk/by-id/xxx /dev/disk/by-id/yyy
$ zpool status
pool: tank
state: ONLINE
scan: none requested
[...]
4
  • The odd thing is that two of the drives are new, and the other one is a couple of months old (but it was never part of a raid array). – Ruben Jul 29 '14 at 6:14
  • The answer hints that something may be locking one or more of the devices. Are you able to use the devices in any other way? Have you checked whether lvm THINKS it owns some of the devices? – Johan Jul 29 '14 at 10:23
  • @Johan Apologies, didn't see you reply. The devices work with a regular ext4 file system; besides two of them are new. I don't actually have lvm installed and I'm not entirely sure how to do this anyway. Interestingly, whilst attempting to create the ZPool locally (not ssh), I got an fd0 error (which I fixed), but I'm not sure if this has anything to do with it. – Ruben Aug 2 '14 at 6:28
  • @Johan Nevermind, I do have lvm2 installed, but sudo lvm pvscan and sudo lvm lvscan both return no volumes found. – Ruben Aug 2 '14 at 7:01
2

Had the same problem trying to run for an external disk on /dev/sdb

$ sudo zpool create pool sdb -f
the kernel failed to rescan the partition table: 16
cannot label 'sdb': try using parted(8) and then provide a specific slice: -1

The problem was the disk was still mounted. After running

$ sudo umount /dev/sdb

everything worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.