Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I do

dd if=/dev/zero of=/tank/test/zpool bs=1M count=100

how can I treat the file /tank/test/zpool as a vdev, so I can use it as a zpool?

It is for zfs testing purposes only.

share|improve this question
maybe you are missing a needed information, you are using solaris or linux? – c4f4t0r Mar 21 '14 at 18:42
up vote 8 down vote accepted

There is no need to create a loop device, you can simply use the file itself as a vdev:

zpool create test /tank/test/zpool
share|improve this answer
This is correct. – ewwhite Mar 21 '14 at 19:46

Create a loop device backed by the file.

dd if=/dev/zero of=/tmp/foo bs=1M count=128
losetup /dev/loop0 /tmp/foo
zpool create tank /dev/loop0

(The minimum disk size of 128 MB.)

Oops, didn't notice the Solaris tag. My instructions were for Linux. Instead of losetup you can use lofiadm under Solaris.

share|improve this answer

Your Answer


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.