CentOS 5.6
파일시스템 ext3 -> ext4 변경하기
[root@test ~]# uname -a
Linux test 2.6.18-238.el5PAE #1 SMP Thu Jan 13 17:10:20 EST 2011 i686 i686 i386 GNU/Linux
1. e4fsprogs 설치
[root@test ~]# yum install e4fsprogs
Loaded plugins: dellsysid, fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.tt.co.kr
* extras: centos.tt.co.kr
* updates: centos.tt.co.kr
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package e4fsprogs.x86_64 0:1.41.12-2.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================
Installing:
e4fsprogs x86_64 1.41.12-2.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]: y
Downloading Packages:
e4fsprogs-1.41.12-2.el5.x86_64.rpm | 1.1 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : e4fsprogs 1/1
Installed:
e4fsprogs.x86_64 0:1.41.12-2.el5
Complete!
2.파일시스템 및 UUID 확인
[root@test ~]# blkid
/dev/sda3: LABEL="/home" UUID="6db96611-dc04-4ec4-a077-1a49eea31ae6" TYPE="ext3"
/dev/sda2: LABEL="SWAP-sda2" TYPE="swap"
/dev/sda1: LABEL="/1" UUID="2fd889d4-0967-4716-95ba-5672ee65e1fb" TYPE="ext3"
/dev/sdb2: UUID="171a0f2f-011f-4b39-9285-27e728fe1f5d" TYPE="ext3"
[root@test ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 ext3 9.7G 1.6G 7.7G 17% /
/dev/sda3 ext3 201G 188M 190G 1% /home
tmpfs tmpfs 16G 0 16G 0% /dev/shm
/dev/sdb2 ext3 229G 25G 193G 12% /data
[root@test ~]# cat /etc/fstab
LABEL=/1 / ext3 defaults 1 1
LABEL=/home /home ext3 defaults 1 2
LABEL=/data /data ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
3. 변경할 파티션 해제
[root@test /]# umount /dev/sdb2
[root@test /]#
[root@test /]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 ext3 9.7G 1.6G 7.7G 17% /
/dev/sda3 ext3 201G 188M 190G 1% /home
tmpfs tmpfs 16G 0 16G 0% /dev/shm
[root@test /]#
4. tune4fs를 이용하여 ext4 파일시스템으로 변경
[root@test /]# tune4fs -O extents,uninit_bg,dir_index /dev/sdb2
tune4fs 1.41.12 (17-May-2010)
Please run e4fsck on the filesystem.
[root@test /]# e4fsck -pfDC0 /dev/sdb2
/dev/sdb2: 70/30457856 files (0.0% non-contiguous), 7382227/60914455 blocks
>> 위와같이 e4fsck가 정상적으로 안나오고 fsck 돌리라고 나오면 #e4fsck /dev/sdb2 를 실행한 후 위의 명령줄을 실행한다.
5. ext4로 변경되었는지 확인하기 위해 /dev/sdb2 를 /data로 마운트
[root@test /]# mount /dev/sdb2 /data
[root@test /]#
[root@test /]#
[root@test /]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 ext3 9.7G 1.6G 7.7G 17% /
/dev/sda3 ext3 201G 188M 190G 1% /home
tmpfs tmpfs 16G 0 16G 0% /dev/shm
/dev/sdb2 ext4 229G 25G 193G 12% /data
[root@test /]#
[root@test /]# blkid
/dev/sda3: LABEL="/home" UUID="6db96611-dc04-4ec4-a077-1a49eea31ae6" TYPE="ext3"
/dev/sda2: LABEL="SWAP-sda2" TYPE="swap"
/dev/sda1: LABEL="/1" UUID="2fd889d4-0967-4716-95ba-5672ee65e1fb" TYPE="ext3"
/dev/sdb2: UUID="171a0f2f-011f-4b39-9285-27e728fe1f5d" TYPE="ext4"
6. /etc/fstab 파일 수정
[root@test ~]# vi /etc/fstab
LABEL=/1 / ext3 defaults 1 1
LABEL=/home /home ext3 defaults 1 2
LABEL=/data /data ext4 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
댓글 없음:
댓글 쓰기