Step1. 建立一個空檔:
[root@localhost ruckus]# cd /tmp/[root@localhost tmp]# dd if=/dev/zero of=vs_file bs=1M count=512512+0 records in512+0 records out536870912 bytes (537 MB) copied,0.767225 秒,700 MB/s
Step2. 將空檔格式化成虛擬的檔案系統:
[root@localhost tmp]# mke2fs -j vs_filemke2fs 1.39 (29-May-2006)vs_file is not a block special device.Proceed anyway? (y,n) yFilesystem label=OS type: LinuxBlock size=1024 (log=0)Fragment size=1024 (log=0)131072 inodes, 524288 blocks26214 blocks (5.00%) reserved for the super userFirst data block=1Maximum filesystem blocks=6763315264 block groups8192 blocks per group, 8192 fragments per group2048 inodes per groupSuperblock backups stored on blocks:8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409Writing inode tables: doneCreating journal (16384 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 21 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
Step3. 以一般掛載partition的方法掛載虛擬檔案系統:
[root@localhost tmp]# mount -o loop /tmp/vs_file /mnt/vf/
Step4. 驗證一下:
[root@localhost tmp]# mount | grep vs_file/tmp/vs_file on /mnt/vf type ext3 (rw,loop=/dev/loop0)[root@localhost tmp]# cd /mnt/vf/[root@localhost vf]# lslost+found[root@localhost vf]# touch test[root@localhost vf]# lslost+found test
No comments:
Post a Comment