代码改变世界

How to create a size-limited file-system

2011-01-18 15:57  zhenjing  阅读(427)  评论(0编辑  收藏  举报

How to create a size-limited file-system?(loopback device)
1) dd if=/dev/zero of=/h/data/file.img bs=1k count=100000 # ~100M
2) su root
3) losetup /dev/loop1 /h/data/file.img
4) mkfs -t ext3 /dev/loop1 100000
5) mkdir /mnt/small
6) mount -t ext3 /dev/loop1 /mnt/small
7) chown tachyon:tachyon /mnt/small

Please refer to command: losetup, mount