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

man zpool states that a vdev for a zfs pool can be a "regular file". Can I specify a sparse file (the warning about the integrity of the file being determined by the underlying filesystem should apply with the same relevance for a sparse file)?

The ZFS administration guide on states that file vdevs "must be preallocated, and not sparse files or thin provisioned" (thanks to @jlliagre).

On sparse files are used without any comment.

share|improve this question
But don't do this, of course. It's not a good solution. I don't want the answers below to seem as though they're an endorsement for this type of solution. – ewwhite Aug 20 '14 at 20:16

Yes, you can use sparse files as VDEVs when creating a ZFS pool. Although there was a bug affecting an early Linux ZFS port that prevented it to work, it was fixed four years ago.

You shouldn't expect performance or reliability with file based vdevs though.

Quoting the zpool manual page:

The use of files as a backing store is strongly discouraged. It is designed primarily for experimental purposes, ...

share|improve this answer

Yes you can specify sparse file provided with an absolute path to file.I use it for testing purpose only.Refer File Vdevs for more details.

share|improve this answer
Interestingly, the link you posted states the opposite: " Further, the image files must be preallocated, and not sparse files or thin provisioned. " – jlliagre Aug 20 '14 at 6:48
try "zpool create tank absolute path to sparse file" will issues no error" ,same for other zfs operations – nagato Aug 20 '14 at 8:16
@RamSuradkar I guess, the fact that there's no error might be related to the fact that zpool won't check whether the file is a sparse file if it don't support it. Anyway, the specification is absolutely clear about it. It's crucial to understand content that you link if you post an answer, otherwise contribute the link to as a comment to the question, only! – Karl Richter Aug 20 '14 at 9:34
well can you refer this ""; from zfsonlinux.I too wanted to comment first,need 50 rep point :(,because question is not that much descriptive – nagato Aug 20 '14 at 9:49
@Ram You seem to miss my point. While your reply is otherwise correct, it doesn't make sense to suggest reading a document for more details when that document tells the exact opposite. – jlliagre Aug 20 '14 at 20:10

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.