[Linux] ROOT Disk 증설

김봉남·2024년 1월 19일
0

Linux

목록 보기
8/36
post-thumbnail

가상화 서버 ROOT Disk 증설

  • LVM 구성이 아닌 할당 받은 Disk 자체를 ROOT로 생성하여 증설

작업 순서

[root@test ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0  150G  0 disk 
├─sda1            8:1    0    1G  0 part /boot
├─sda2            8:2    0    2G  0 part [SWAP]
└─sda3            8:3    0   27G  0 part /
sdb               8:16   0   10G  0 disk 
└─sdb1            8:17   0   10G  0 part 
  └─vg01-lvol01 253:0    0  150G  0 lvm  /test_home
sdc               8:32   0  140G  0 disk 
└─sdc1            8:33   0  140G  0 part 
  └─vg01-lvol01 253:0    0  150G  0 lvm  /test_home
sr0              11:0    1 1024M  0 rom  

[root@test ~]# blkid
/dev/sda1: UUID="3a123922-f0ec-4744-8645-17c1f91b2246" TYPE="xfs" 
/dev/sda2: UUID="8449df3f-b78f-4d5a-9a2b-7b5da02f29ee" TYPE="swap" 
/dev/sda3: UUID="f81b791a-05eb-492d-a933-37d13bfb4615" TYPE="xfs" 
/dev/sdb1: UUID="UdlKsE-8KDS-J8vF-NmrB-Nekr-oNu3-lIUQTg" TYPE="LVM2_member" 
/dev/sdc1: UUID="FHeH5O-h9mf-isrH-QULa-1QFK-bYD1-JhjMmV" TYPE="LVM2_member" 
/dev/mapper/vg01-lvol01: UUID="d1558fbe-be67-4573-b3f3-75d3514f028e" TYPE="xfs" 


[root@test ~]# fdisk -l

Disk /dev/sda: 161.1 GB, 161061273600 bytes, 314572800 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: 0x000b2a45

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200     6295551     2098176   82  Linux swap / Solaris
/dev/sda3         6295552    62914559    28309504   83  Linux

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 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: 0x2d3f3f95

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    20971519    10484736   8e  Linux LVM

Disk /dev/sdc: 150.3 GB, 150323855360 bytes, 293601280 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: 0x16b84fad

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   293601279   146799616   8e  Linux LVM

Disk /dev/mapper/vg01-lvol01: 161.1 GB, 161052884992 bytes, 314556416 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


[root@test ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p

Disk /dev/sda: 161.1 GB, 161061273600 bytes, 314572800 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: 0x000b2a45

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200     6295551     2098176   82  Linux swap / Solaris
/dev/sda3         6295552    62914559    28309504   83  Linux

Command (m for help): d
Partition number (1-3, default 3): 3
Partition 3 is deleted

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p
Partition number (3,4, default 3): 3
First sector (6295552-314572799, default 6295552): 
Using default value 6295552
Last sector, +sectors or +size{K,M,G} (6295552-314572799, default 314572799): 
Using default value 314572799
Partition 3 of type Linux and of size 147 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.


[root@test ~]# df
Filesystem              1K-blocks    Used Available Use% Mounted on
/dev/sda3                28295684 6504600  21791084  23% /
/dev/sda1                 1038336  129424    908912  13% /boot
/dev/mapper/vg01-lvol01 157267968   35836 157232132   1% /test_home

[root@test ~]# reboot

[root@test /]# xfs_growfs /
meta-data=/dev/sda3              isize=512    agcount=4, agsize=1769344 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=7077376, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=3455, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 7077376 to 38534656


[root@test /]# df
Filesystem              1K-blocks    Used Available Use% Mounted on
/dev/sda3               154124804 6505812 147618992   5% /
/dev/sda1                 1038336  129424    908912  13% /boot
/dev/mapper/vg01-lvol01 157267968   35836 157232132   1% /test_home

profile
남자다

0개의 댓글