티스토리 뷰

CentOS 5.4 버전 이상에는 아래와 같이 기본적으로  kernel module에 ext4를 지원하도록 lib가 포함되어 있다.

 

[root@s-node01 dev]#
[root@s-node01 dev]# modprobe -l | grep ext4
/lib/modules/2.6.18-308.el5/kernel/fs/ext4/ext4.ko
[root@s-node01 dev]#

 

 

하지만 ext4 파일시스템을 관리하고 생성하는 명령어는 기본적으로 설치되어 있지 않기 때문에 아래와 같이 yum repository를 통해 해당 패키지를 찾아 설치 할 수 있다.

 

[root@s-node01 dev]#
[root@s-node01 dev]# yum provides /sbin/e4fsck
Loaded plugins: fastestmirror, priorities, security
Determining fastest mirrors
 * base: centos.mirror.cdnetworks.com
 * extras: centos.mirror.cdnetworks.com
 * rpmforge: ftp.riken.jp
 * updates: centos.mirror.cdnetworks.com
base                                                                                                                                                                                                      | 1.1 kB     00:00    
extras                                                                                                                                                                                                    | 2.1 kB     00:00    
rpmforge                                                                                                                                                                                                  | 1.9 kB     00:00    
updates                                                                                                                                                                                                   | 1.9 kB     00:00    
e4fsprogs-1.41.12-3.el5.x86_64 : Utilities for managing the fourth extended (ext4) filesystem
Repo        : base
Matched from:
Filename    : /sbin/e4fsck

 

e4fsprogs-1.41.12-4.el5_10.x86_64 : Utilities for managing the fourth extended (ext4) filesystem
Repo        : updates
Matched from:
Filename    : /sbin/e4fsck

 

[root@s-node01 dev]#
[root@s-node01 dev]# yum install -y e4fsprogs*
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
 * base: centos.mirror.cdnetworks.com
 * extras: centos.mirror.cdnetworks.com
 * rpmforge: ftp.riken.jp
 * updates: centos.mirror.cdnetworks.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package e4fsprogs.x86_64 0:1.41.12-4.el5_10 set to be updated
---> Package e4fsprogs-devel.i386 0:1.41.12-4.el5_10 set to be updated
---> Package e4fsprogs-devel.x86_64 0:1.41.12-4.el5_10 set to be updated
Transaction Test Succeeded

.

.

생략

.

.
Complete!

 

패키지를 설치한 후 디스크에 대한 파티셔닝 후 아래와 같이  새로 추가된 mkfs.ext4 명령을 통해 파일시스템을 작성 한다.

 

[root@s-node01 dev]#
[root@s-node01 dev]# mkfs.ext4 -L /archive /dev/sdd2
mke4fs 1.41.12 (17-May-2010)
Filesystem label=/archive
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
36160 inodes, 144585 blocks
7229 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=150994944
5 block groups
32768 blocks per group, 32768 fragments per group
7232 inodes per group
Superblock backups stored on blocks:
 32768, 98304

Writing inode tables: done                           
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune4fs -c or -i to override.
[root@s-node01 dev]#

 

 

ext4 파일시스템은 기존 ext2,3 를 관리하는 명령어로 컨트롤 할 경우 아래와 같이 인식할 수 없는 상태로 나타난다.

 

[root@s-node01 dev]#
[root@s-node01 dev]# tune2fs -l /dev/sdd2
tune2fs 1.39 (29-May-2006)
tune2fs: Filesystem has unsupported feature(s) while trying to open /dev/sdd2
Couldn't find valid filesystem superblock.

[root@s-node01 dev]#

[root@s-node01 dev]# e2label /dev/sdd2
e2label: Filesystem has unsupported feature(s) while trying to open /dev/sdd2
Couldn't find valid filesystem superblock.
[root@s-node01 dev]#

 

생성된 ext4 파일시스템의 상태를 확인하기 위해 아래와 같이 ext4 를 지원하는 명령을 통해 확인토록 한다.

 

[root@s-node01 dev]#

[root@s-node01 dev]#
[root@s-node01 dev]# e4label /dev/sdd2
/archive
[root@s-node01 dev]#
[root@s-node01 dev]#

[root@s-node01 dev]# tune4fs -l /dev/sdd2
tune4fs 1.41.12 (17-May-2010)
Filesystem volume name:   /archive
Last mounted on:          <not available>
Filesystem UUID:          88296184-9b62-41fe-afd6-2889555617e8
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              36160
Block count:              144585
Reserved block count:     7229
Free blocks:              138102
Free inodes:              36149
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      35
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         7232
Inode blocks per group:   452
Flex block group size:    16
Filesystem created:       Tue Jan 14 13:46:39 2014
Last mount time:          n/a
Last write time:          Tue Jan 14 13:46:40 2014
Mount count:              0
Maximum mount count:      30
Last checked:             Tue Jan 14 13:46:39 2014
Check interval:           15552000 (6 months)
Next check after:         Sun Jul 13 13:46:39 2014
Lifetime writes:          25 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      d6912746-daa0-4f57-b045-f6e52cbd9e7e
Journal backup:           inode blocks
[root@s-node01 dev]#

 

 

 

 

반응형
반응형
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday