[root@localhost ~]# df Filesystem 1K-塊 已用 可用 已用% 掛載點/dev/hda1 10080488 4878740 4689680 51% /
none 257700 0 257700 0% /dev/shm
/dev/hda3 8538884 53424 8051708 1% /home
對創(chuàng)建好的2G.loop進(jìn)行格式化
[root@localhost ~]# mkfs.ext3 /2G.loop
mke2fs 1.35 (28-Feb-2004)
/2G.loop is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
250368 inodes, 500000 blocks
25000 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=515899392
16 block groups
32768 blocks per group, 32768 fragments per group
15648 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
創(chuàng)建一個2Gdata目錄,目的是將新劃分的空間掛載到這個目錄下。
[root@localhost ~]# mkdir /2Gdata
使用loop模式將創(chuàng)建好的空間進(jìn)行掛載
[root@localhost ~]# mount -o loop /2G.loop /2Gdata
確保在系統(tǒng)啟動時自動掛載,需把掛載信息寫入/etc/rc.local文件中。
[root@localhost 2Gdata]# vi /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you dont
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
mount -o loop /2G.loop /2Gdata
[root@localhost ~]# df Filesystem 1K-塊 已用 可用 已用% 掛載點/dev/hda1 10080488 4878744 4689676 51% /
none 257700 0 257700 0% /dev/shm
/dev/hda3 8538884 53424 8051708 1% /home
/2G.loop 1968528 35760 1832768 2% /2Gdata
掛載成功