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.

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 https://pthree.org/2012/12/04/zfs-administration-part-i-vdevs/ states that file vdevs "must be preallocated, and not sparse files or thin provisioned" (thanks to @jlliagre).

On https://wiki.archlinux.org/index.php/Experimenting_with_ZFS 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 at 20:16

2 Answers 2

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 at 6:48
    
try "zpool create tank absolute path to sparse file" will issues no error" ,same for other zfs operations –  nagato Aug 20 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 at 9:34
    
well can you refer this "github.com/zfsonlinux/zfs/issues/33"; from zfsonlinux.I too wanted to comment first,need 50 rep point :(,because question is not that much descriptive –  nagato Aug 20 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 at 20:10

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.