반응형

ㅁ순서

- 대상 FS; /test

1)FS unmount 


2)FS 검사 

3)FS resize 

4)LV reduce



- 현재 FS사이즈

[root@station ~]# df -k

Filesystem              1K-blocks    Used Available Use% Mounted on

/dev/mapper/centos-root  17811456 4222804  13588652  24% /

/dev/mapper/vg00-lvol0     380533    2062    354305   1% /test


1) FS unmount

[root@station ~]# umount /test


2) FS 검사


[root@station ~]# e2fsck -f /dev/vg00/lvol0

e2fsck 1.42.9 (28-Dec-2013)

Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure

Pass 3: Checking directory connectivity

Pass 4: Checking reference counts

Pass 5: Checking group summary information

/dev/vg00/lvol0: 11/100352 files (0.0% non-contiguous), 22937/401408 blocks


3) FS resize (380M -> 290M)

[root@station ~]# resize2fs /dev/vg00/lvol0 290M

resize2fs 1.42.9 (28-Dec-2013)

Resizing the filesystem on /dev/vg00/lvol0 to 296960 (1k) blocks.

The filesystem on /dev/vg00/lvol0 is now 296960 blocks long.


4) LV reduce (380M -> 295M)

[root@station ~]# lvreduce -L 295M /dev/vg00/lvol0

  Rounding size to boundary between physical extents: 296.00 MiB.

  WARNING: Reducing active logical volume to 296.00 MiB.

  THIS MAY DESTROY YOUR DATA (filesystem etc.)

Do you really want to reduce vg00/lvol0? [y/n]: y

  Size of logical volume vg00/lvol0 changed from 392.00 MiB (98 extents) to 296.00 MiB (74 extents).

  Logical volume vg00/lvol0 successfully resized.


-> FS resize가 먼저 이루어져야함.

    LV를 먼저 reduce 해버릴 경우, FS 내 있던 Data들은 깨지게됨



[root@station ~]# mount -t ext4 /dev/vg00/lvol0 /test


- 결과

[root@station ~]# df -k

Filesystem              1K-blocks    Used Available Use% Mounted on

/dev/mapper/centos-root  17811456 4222828  13588628  24% /

/dev/mapper/vg00-lvol0     279189    2062    258184   1% /test


/test   FS는 약 280M 로 감소확인

반응형

'OS > LINUX' 카테고리의 다른 글

teaming port F/O 테스트  (0) 2017.12.29
teaming 구성  (0) 2017.12.26
nfs 설정  (0) 2017.12.19
vsftp chroot설정  (0) 2017.04.20
chroot명령어 이용 가상home dir생성  (0) 2017.04.20

+ Recent posts