티스토리 뷰

System Story/CentOS 5,6

ext3 ->ext4 전환 마이그레이션 수행

불량펭귄 helperchoi 2014. 12. 15. 18:25

Linux OS 를 운영하다보면, 파일시스템의 성능 이슈등으로 ext3 -> ext4 로 전환이 필요할 경우가 있다.

 

통상적으로는 파일시스템 전환시 신규 파일시스템 할당 및 작성후 데이터 마이그레이션을 수반하게 되나,

 

ext3 -> ext4 전환시는 아래와 같이 간단한 과정을 통해 마이그레이션이 가능하다.

 

[root@s-node01 /]# yum -y install e4fsprogs*
[root@s-node01 /]#
[root@s-node01 /]# mount -l | grep data1
/dev/sdc1 on /data1 type ext3 (rw)
[root@s-node01 /]#
[root@s-node01 /]# du -sh /data1
44K /data1
[root@s-node01 /]#
[root@s-node01 /]# find /data1 -type f
/data1/origin/sample.dat.md5
/data1/origin/sample.dat
/data1/copy/sample.dat.md5
/data1/copy/sample.dat
[root@s-node01 /]#
[root@s-node01 /]#
[root@s-node01 /]#
[root@s-node01 /]# df -h | grep data1
/dev/sdc1              40G  177M   38G   1% /data1
[root@s-node01 /]#
[root@s-node01 /]#
[root@s-node01 /]#
[root@s-node01 /]# umount /data1
[root@s-node01 /]#
[root@s-node01 /]# tune4fs -O extents,uninit_bg,dir_index /dev/sdc1
tune4fs 1.41.12 (17-May-2010)

Please run e4fsck on the filesystem.

[root@s-node01 /]# e4fsck -fyDC0 /dev/sdc1
e4fsck 1.41.12 (17-May-2010)
One or more block group descriptor checksums are invalid.  Fix? yes

Group descriptor 0 checksum is invalid.  FIXED.
Group descriptor 1 checksum is invalid.  FIXED.

... 중략

Group descriptor 318 checksum is invalid.  FIXED.
Group descriptor 319 checksum is invalid.  FIXED.
Adding dirhash hint to filesystem.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure                                          
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts                                             
Pass 5: Checking group summary information
                                                                              
/dev/sdc1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdc1: 17/5242880 files (0.0% non-contiguous), 209594/10484412 blocks
[root@s-node01 /]#
[root@s-node01 /]#
[root@s-node01 /]#
[root@s-node01 /]# mount -t ext4 /dev/sdc1 /data1
[root@s-node01 /]#
[root@s-node01 /]# blkid /dev/sdc1
/dev/sdc1: UUID="6fd07d84-7785-43cc-9ba5-0b35a1660876" TYPE="ext4"
[root@s-node01 /]#
[root@s-node01 /]# find /data1 -type f
/data1/origin/sample.dat.md5
/data1/origin/sample.dat
/data1/copy/sample.dat.md5
/data1/copy/sample.dat
[root@s-node01 /]#
[root@s-node01 /]#
[root@s-node01 /]# du -sh /data1
44K /data1
[root@s-node01 /]#
[root@s-node01 /]#

 

 

 

 

반응형
댓글
댓글쓰기 폼