Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to create a ZFS pool using the following command:

zpool create MyPool disk /dev/sda

However, I get the following error:

cannot use '/dev/disk': must be a block device or regular file

I feel like I should have been able to find someone with this issue, but I haven't been able to. /dev/sda is a blank drive. Where am I going wrong? Do I have to format the drive before creating a zpool? If so, what format do I use?

share|improve this question
    
Sounds like you need to use a partition of a disk like /dev/sda1 (after fdisk-ing it). –  mdpc Aug 26 at 23:51
    
What partition type do I use? –  E-rich Aug 27 at 0:00
    
@mdpc Using partitions are supported, but certainly not a requirement. (The recommended method is to use whole disk.) –  fukawi2 Aug 27 at 0:04
    
No partition is needed. The command you're using is incorrect. –  ewwhite Aug 27 at 0:11

2 Answers 2

up vote 2 down vote accepted

Remove "disk" from your command line. It's the cause of the error you're receiving.

zpool create MyPool sda
share|improve this answer
    
The man page says you should be able to specify the full path, but removing it made it work. –  E-rich Aug 27 at 0:16
2  
You can use the full path as well. It's not needed. The error here was using "disk". –  ewwhite Aug 27 at 0:18

Try using this guide: AAron Toponce - ZFS on Linux.

Assuming you are trying to create a zfs pool called MyPool, using /dev/sda as a disk, try:
# zpool create MyPool sda

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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