본문 바로가기

리눅스

[리눅스] 2TB 이상의 디스크를 사용하기 위한 방법(GPT 파티션 설정)

반응형

2TB 이상의 디스크를 사용하기 위한 방법(GPT 파티션 설정)

2TB 이상의 디스크를 사용하기 위해서는 GPT (GUID Partition Table) 파티션 스키마를 사용해야 합니다. MBR (Master Boot Record) 파티션 스키마는 2TB 이상의 디스크를 지원하지 않습니다.

 

디스크 확인

fdisk -l
$ 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

GPT 파티션 생성

  • 디스크 선택
parted /dev/sdb
$ 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
(parted) mklabel gpt
  • 파티션 구성 확인
print
(parted) 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)
  • 파티션 생성
mkpart [파티션 타입] [시작 위치] [끝 위치]
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
(parted) 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
  • 종료
quit
(parted) quit
Information: You may need to update /etc/fstab.
728x90

디스크 파티션 정보 확인

$ 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

 

xfs 파일 시스템 생성(xfs 포맷)

mkfs.xfs /dev/sdb1
$ 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
$ 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

 

마운트 포인트 생성

mkdir /app

 

디스크 파티션 UUID 확인

blkid
$ blkid
/dev/sdb1: UUID="5057d9a7-fd7c-4897-b50b-94f217869222" BLOCK_SIZE="512" TYPE="xfs" PARTLABEL="primary" PARTUUID="4036e1ec-7cec-44a5-b323-b73f8ac0c6c5"

(또는)

ls -l /dev/disk/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

 

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

 

마운트

mount -av
$ mount -av
...
/app                     : successfully mounted

 

파일시스템 정보 확인

$ df -Th | egrep /dev/sdb1
/dev/sdb1             xfs    6.6T   47G  6.6T   1% /app

 

728x90
반응형