天天看點

CentOS 6以下版本 支援Ext4

使用環境使用的是CentOS5.8 核心是  2.6.18-238.19.1.el5

其實CentOS 5.8 裡面是有 ext4 子產品的,隻是沒加載,是以我們先把子產品加入系統

# cd

/lib/modules/2.6.18-238.19.1.el5/kernel/fs/ext4 

 //ext4子產品就在此目錄下

# [root@linux ext4]# ls

ext4.ko

找到子產品後使用modprobe 指令添加

# modprobe ext4  

 //注意:這裡隻能寫子產品名,不能寫成 ext4.ko

# lsmod |grep ext4  //添加完後使用lsmod 檢視

ext4                

 285409  0

jbd2                

  47744  1 ext4

crc16                

  1027  1 ext4

[root@linux ext4]# yum install

e4fsprogs     //最後使用yum

安裝一下 e4fsprogs

[root@linux ext4]# mkfs.ext4

/dev/sdc    //最後建立一個分區來使用ext4

建立檔案系統

mke4fs 1.41.12 (17-May-2010)

/dev/sdi is entire device, not just one partition!

Proceed anyway? (y,n) y

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

61014016 inodes, 244056064 blocks

12202803 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

7448 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks: 

        32768, 98304, 163840, 229376, 294912, 819200,

884736, 1605632, 2654208, 

        4096000, 7962624, 11239424, 20480000, 23887872,

71663616, 78675968, 

        102400000, 214990848

Writing inode tables: done              

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or

180 days, whichever comes first.  Use tune4fs -c or -i to

override.

[root@linux ext4]#mount

/dev/sdc /hadoop1