I want to create a mountable image with the newfs file system which can be mounted with newfs file system. How can I do that?

I have tried to create an image with the command

dd if=localfiles.tar.gz of=/root/upload/test.img

but I could not creat a newfs file system. How can I do that?

有帮助吗?

解决方案

Something along the lines:

$ dd if=/dev/zero bs=8M count=<depends on the size of the fs you need> of=/root/upload/test.img
$ mkfs.newfs /root/upload/test.img
# mount -o loop /root/upload/test.img /mnt
$ cd /mnt
$ tar xzf /path/to/localfiles.tar.gz
$ cd
# umount /mnt
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top