rhel 5.x 支持 ext4
5.x默认的文件格式是 ext3,如果要支持ext4,需要如下操作
1)查看版本号
# lsb_release -a
# cat /etc/redhat-release
# uname -a
2)配置好yum本地源
# cd /mnt
# mkdir cdrom
# mount /dev/cdrom /mnt/cdrom
# vi /etc/yum.conf
[base]
name=base pyb yum test
baseurl=file:///mnt/cdrom/Server
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[updates-released]
name= updates-released pyb yum test
baseurl=file:///mnt/cdrom/Server
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
修改其中的 gpgcheck参数,改为gpgcheck=0
3)查看 ext4 文件系统模块
# ls -l /lib/modules/2.6.18-308.el5/kernel/fs/ext4/
total 424
-rwxr--r-- 1 root root 422976 Jan 28 2012 ext4.ko
4)加载模块,并查看
# modprobe ext4
# lsmod |grep -i ext4
ext4 302521 0
jbd2 97865 1 ext4
crc16 35137 1 ext4
5)安装相应的rpm
# yum install e4fsprogs
6)rpm安装完后就可以使用 mkfs.ext4 格式化,并检查下
# mkfs.ext4 -c /dev/vgoradata/lvoradata01
# e4fsck -f /dev/vgoradata/lvoradata01
7)挂载并查看
# mount /dev/vgoradata/lvoradata01 /u02
# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
ext3 45G 2.3G 40G 6% /
/dev/sda1 ext3 99M 13M 82M 14% /boot
tmpfs tmpfs 1006M 0 1006M 0% /dev/shm
/dev/hdc iso9660 3.9G 3.9G 0 100% /mnt/cdrom
/dev/mapper/vgoradata-lvoradata01
ext4 20G 172M 19G 1% /u02
8)写入 /etc/fstab
# vi /etc/fstab
/dev/vgoradata/lvoradata01 /u02 ext4 defaults 0 0