반응형
리눅스에서 2TB 이상의 디스크를 사용하는 방법(GPT 파티션 설정)
2TB 이상의 디스크를 사용하기 위해서는 GPT(GUID Partition Table) 파티션 스키마를 사용해야 합니다. MBR(Master Boot Record) 파티션 스키마는 2TB 이상의 디스크를 지원하지 않습니다.
1. 디스크 확인
시스템에 인식된 디스크를 확인합니다.
fdisk -l
...
Disk /dev/sdb: 6.55 TiB, 7201213407232 bytes, 14064869936 sectors
Disk model: LOGICAL VOLUME
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
- /dev/sdb 디스크가 약 6.5TB 용량으로 인식됨을 확인합니다.
2. GPT 파티션 테이블 생성
디스크 선택
parted /dev/sdb
GNU Parted 3.4
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
GPT 레이블 생성
mklabel gpt
해당 디스크의 기존 파티션 정보는 모두 삭제됩니다.
파티션 테이블 확인
print
Model: HP LOGICAL VOLUME (scsi)
Disk /dev/sdb: 7201GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
(parted)
- GPT가 정상적으로 적용된 것을 확인합니다.
파티션 생성
mkpart [파티션 타입] [시작 위치] [끝 위치]
mkpart primary 1MiB 100%
더보기
---
mkpart primary 0 7201GB
경고 메시지
(parted) mkpart primary 0 7201GB
Warning: The resulting partition is not properly aligned for best performance: 34s % 2048s != 0s
Ignore/Cancel? Ignore
---
파티션 구성 확인
print
Model: HP LOGICAL VOLUME (scsi)
Disk /dev/sdb: 7201GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 17.4kB 7201GB 7201GB primary
parted 종료
quit
Information: You may need to update /etc/fstab.
4. 파티션 정보 확인
fdisk -l
...
Disk /dev/sdb: 6.55 TiB, 7201213407232 bytes, 14064869936 sectors
Disk model: LOGICAL VOLUME
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FC118CD0-24E5-4C73-B245-74D6C45ED48F
Device Start End Sectors Size Type
/dev/sdb1 34 14064869902 14064869869 6.5T Linux filesystem
5. 파일시스템 생성 (XFS)
대용량 디스크에는 XFS 파일시스템을 권장합니다.
mkfs.xfs /dev/sdb1
mkfs.xfs: /dev/sdb1 appears to contain an existing filesystem (ext3).
mkfs.xfs: Use the -f option to force overwrite.
기존 파일시스템이 있을 경우 강제 포맷
mkfs.xfs -f /dev/sdb1
meta-data=/dev/sdb1 isize=512 agcount=7, agsize=268435455 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=0 inobtcount=0
data = bsize=4096 blocks=1758108733, imaxpct=5
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=521728, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
6. 마운트 포인트 생성
mkdir /app
7. 디스크 UUID 확인
blkid 사용
blkid
/dev/sdb1: UUID="5057d9a7-fd7c-4897-b50b-94f217869222" BLOCK_SIZE="512" TYPE="xfs" PARTLABEL="primary" PARTUUID="4036e1ec-7cec-44a5-b323-b73f8ac0c6c5"
(또는) by-uuid 경로 확인
ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Apr 21 13:10 5057d9a7-fd7c-4897-b50b-94f217869222 -> ../../sdb1
8. /etc/fatab 등록(영구 마운트)
vim /etc/fstab
아래 항목 추가
/dev/disk/by-uuid/5057d9a7-fd7c-4897-b50b-94f217869222 /app xfs defaults 0 0
(또는)
UUID=5057d9a7-fd7c-4897-b50b-94f217869222 /app xfs defaults 0 0
fstab 확인
cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
#/dev/disk/by-uuid/5057d9a7-fd7c-4897-b50b-94f217869222 /app xfs defaults 0 0
UUID=5057d9a7-fd7c-4897-b50b-94f217869222 /app xfs defaults 0 0
9. fstab 설정 검증 및 마운트
mount -av
/app : successfully mounted
10. 파일시스템 정보 확인
df -Th | grep /app
/dev/sdb1 xfs 6.6T 47G 6.6T 1% /app
... 디스크 /dev/sdb: 6.55TiB, 7201213407232바이트, 14064869936 섹터 디스크 모델: 논리 볼륨 단위: 1 * 512 = 512바이트 섹터 섹터 크기(논리적/물리적): 512바이트 / 512바이트 I/O 크기(최소/최적): 512바이트 / 512바이트
728x90
반응형
'리눅스' 카테고리의 다른 글
| MySQL에서 root 계정의 패스워드를 잊어버렸을 때 복구하는 방법 (0) | 2013.06.24 |
|---|---|
| MySQL의 일반 로그(general log)를 삭제하는 방법 (0) | 2013.06.24 |
| CentOS 7에서 네트워크 구성을 설정하는 방법(network configuration) (1) | 2013.06.24 |
| CentOS에서 iptables 규칙을 저장하고 적용하는 방법 (0) | 2013.06.23 |
| MySQL 데이터베이스의 백업과 복구를 수행하는 방법 (0) | 2013.06.23 |