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

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 at 18:42

2 Answers 2

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
1  
This is correct. –  ewwhite Mar 21 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

 
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.