2 of 2 edited tags

Create filesystem in regular file using FreeBSD

When using Linux, one can easily create a regular file of some size and then create a filesystem in it. How can one do the same thing when using FreeBSD?

I tried this:

root@:/tmp/test # newfs -U ~/disk
newfs: /root/disk: not a character-special device: No error: 0
newfs: no valid label found

I didn't find any relevant information on this (e.g.: "Use switch -i to allow the filesystem to be created on a regular file instead of only on a character device." on the (fairly short) man page of newfs.