본문으로 건너뛰기

CentOS 5.x에서 ext4 파일 시스템을 사용하는 방법은 무엇인가요?

💡 요약 정리

  • CentOS 5.x에는 기본적으로 ext4 파일 시스템이 지원되지 않으므로, 별도 패키지를 설치해야 합니다.
  • e4fsprogs 패키지를 설치하여 ext4 관련 명령어를 사용할 수 있도록 합니다.
  • /sbin/mkfs.ext4 명령어가 생성되었는지 확인 후 파일 시스템을 생성하고 마운트합니다.

설치 환경

  • CentOS 5.x (64bit)

1. ext4 패키지 설치

  • yum 명령어로 간단히 설치한다.
[root@cafe24 ~]# yum install e4fsprogs
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.tt.co.kr
 * epel: ftp.neowiz.com
 * extras: centos.tt.co.kr
 * updates: centos.tt.co.kr
base                                                                 | 1.1 kB     00:00
epel                                                                 | 3.7 kB     00:00
extras                                                               | 2.1 kB     00:00
updates                                                              | 1.9 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package e4fsprogs.x86_64 0:1.41.12-3.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================
 Package                 Arch            Version                            Repository             Size
=========================================================================================================
Installing:
 e4fsprogs               x86_64          1.41.12-3.el5                      base                  1.1 M

Transaction Summary
=========================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 1.1 M
Is this ok [y/N]: Exiting on user Command
Complete!
[root@cafe24 ~]#

2. ext4 명령어 확인

  • /sbin/mkfs.ext4 명령어가 생성된 것을 확인한다.
[root@cafe24 ~]# ll /sbin/mkfs*
-rwxr-xr-x 1 root root  10000 Mar 10  2011 /sbin/mkfs
-rwxr-xr-x 1 root root  21544 Mar 10  2011 /sbin/mkfs.cramfs
-rwxr-xr-x 3 root root  49624 Nov 12  2010 /sbin/mkfs.ext2
-rwxr-xr-x 3 root root  49624 Nov 12  2010 /sbin/mkfs.ext3
-rwxr-xr-x 3 root root 210296 Jan  9 14:06 /sbin/mkfs.ext4
-rwxr-xr-x 3 root root 210296 Jan  9 14:06 /sbin/mkfs.ext4dev
-rwxr-xr-x 3 root root  28216 Jan 27  2010 /sbin/mkfs.msdos
lrwxrwxrwx 1 root root     12 Feb 12 10:39 /sbin/mkfs.ntfs -> /sbin/mkntfs
-rwxr-xr-x 3 root root  28216 Jan 27  2010 /sbin/mkfs.vfat
[root@cafe24 ~]#

3. ext4 파일 시스템 생성 및 마운트

  • ext4 파일 시스템으로 포맷한 후 마운트한다.
[root@cafe24 ~]# mkfs.ext4 /dev/xvde1
mke4fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6111232 inodes, 24412767 blocks
1220638 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
746 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

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

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.  Use tune4fs -c or -i to override.
[root@cafe24 ~]# mount /dev/xvde1 /mnt
[root@cafe24 ~]# mount
/dev/xvda3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/xvda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/xvde1 on /mnt type ext4 (rw)
[root@cafe24 ~]#