티스토리 뷰

os/Linux

changing for size of centos root

Jacob_baek 2016. 10. 28. 17:23


centos7.2를 설치하면 default로 size가 centos-root : 50G 나머지는 centos-home(swap제외)으로 사이즈가 지정된다.

만약 centos-home은 size를 줄이고 줄인 사이즈를 centos-root로 변경하고자 할경우 아래와 같이 진행한다.


umount를 수행한다.

umount /home


아래 command로 size를 늘린다.

lvextend -L +200G /dev/mapper/centos-home


아래와 같은 error message가 출력되며 mount가 실패되는 경우가 있다.

mount: /dev/mapper/centos-home: can't read superblock


아래의 작업을 수행한다.

xfs_repair /dev/mapper/centos-home


repair를 했다고 다 해결되지는 않았다. 이런경우 아래 command를 수행하여 format을 수행한다.

mkfs.xfs -f /dev/mapper/centos-home


권장하는 방법은 아니지만 root에 있는 data라도 살릴수 있으니

참고하면 좋을것같다.


추가로실제로 extend 했다고 바로 centos-root가 사이즈가 변경되지 않는다.

아래의 command를 추가로 입력해주면 바로 적용이 된다.

xfs_growfs /


최종적으로 변경된 size

Disk /dev/sda: 1073.7 GB, 1073741824000 bytes, 2097152000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00088ac2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048  2097151999  1048062976   8e  Linux LVM

Disk /dev/mapper/centos-root: 268.4 GB, 268435456000 bytes, 524288000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 8455 MB, 8455716864 bytes, 16515072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-home: 751.6 GB, 751619276800 bytes, 1468006400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes






'os > Linux' 카테고리의 다른 글

PTP  (0) 2018.08.21
dnsmasq  (0) 2018.03.02
linux bridge with hairpin  (0) 2016.08.11
socket option related kernel  (0) 2015.03.09
ssh certification  (0) 2014.09.01
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함