참고
[CenOS7] 새로운 하드디스크 추가하기.
https://zero-gravity.tistory.com/297
# fdisk -l
Disk /dev/vda: 53.7 GB, 53687091200 bytes, 104857600 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: 0x000ce797
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 976895 487424 83 Linux
/dev/vda2 976896 2928639 975872 82 Linux swap / Solaris
/dev/vda3 2928640 104857566 50964463+ 83 Linux
Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 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
# fdisk /dev/vdb
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.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x7baf295d.
Command (m for help): n <----
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p <----
Partition number (1-4, default 1): 1 <----
First sector (2048-419430399, default 2048): <----
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-419430399, default 419430399): <----
Using default value 419430399
Partition 1 of type Linux and of size 200 GiB is set
Command (m for help): w <----
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk -l
Disk /dev/vda: 53.7 GB, 53687091200 bytes, 104857600 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: 0x000ce797
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 976895 487424 83 Linux
/dev/vda2 976896 2928639 975872 82 Linux swap / Solaris
/dev/vda3 2928640 104857566 50964463+ 83 Linux
Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 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: 0x7baf295d
Device Boot Start End Blocks Id System
/dev/vdb1 2048 419430399 209714176 83 Linux <------------
# mkfs -t xfs /dev/vdb1
centos 7부터 기본 지원되는 파일시스템 xfs의 장단점 https://idchowto.com/?p=11593
# mount -t xfs /dev/vdb1 /home
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 49G 1.3G 48G 3% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 17M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/vda1 473M 176M 298M 38% /boot
tmpfs 379M 0 379M 0% /run/user/0
/dev/vdb1 200G 33M 200G 1% /home
# blkid
/dev/vda1: UUID="19988f0b-3cb1-428f-9df2-eaa432f7b252" TYPE="xfs"
/dev/vda2: UUID="3390f939-74c7-4de8-9f99-4e476db28672" TYPE="swap"
/dev/vda3: UUID="71c352fc-333d-4a39-a299-0c9f8da5c7b2" TYPE="xfs"
/dev/vdb1: UUID="52ea8acf-2160-4781-a547-70237c51e501" TYPE="xfs" <-------
# vi /etc/fstab
UUID=71c352fc-333d-4a39-a299-0c9f8da5c7b2 / xfs defaults 0 0
UUID=19988f0b-3cb1-428f-9df2-eaa432f7b252 /boot xfs defaults 0 0
UUID=3390f939-74c7-4de8-9f99-4e476db28672 swap swap defaults 0 0
UUID=52ea8acf-2160-4781-a547-70237c51e501 /home xfs defaults 0 0 <------ 추가
재부팅 후
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 49G 1.3G 48G 3% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 17M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/vdb1 200G 33M 200G 1% /home
/dev/vda1 473M 165M 308M 35% /boot
tmpfs 379M 0 379M 0% /run/user/0