반응형

안녕하세요.


리눅스에서 파티션 생성 시 주로 fdisk 를 사용하는데요.


fdisk는 MBR 방식이기 때문에 디스크의 사이즈가 2TB가 넘어가면 용량을 2TB 까지 밖에 사용을 못합니다.


때문에 2TB 이상의 스토리지를 사용할 때는 MBR 방식 대신 GPT 방식을 사용해주어야 합니다.


fdisk 대신 parted를 사용해 주면 됩니다.



1. parted 실행


다음의 명령어로 실행해 주면 됩니다.


# parted Block_Device_경로


저는 /dev/sdc 에 파티션 생성을 해주었습니다.


# parted /dev/sdc

GNU Parted 2.1

Using /dev/sdc

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted)



미리 fdisk를 사용하여 파티션을 1개 full로 생성을 해두었습니다. 


print 명령어로 확인해 보면



(parted) print

Model: LSI 9750-24i4e DISK (scsi)

Disk /dev/sdc: 2400GB

Sector size (logical/physical): 512B/512B

Partition Table: msdos


Number  Start   End     Size    Type     File system  Flags

 1      32.3kB  2199GB  2199GB  primary               lvm


(parted)                                                                   



전체 디스크 사이즈는 2400GB 인데,


생성된 파티션은 2199GB 인 것을 확인할 수 있습니다.


'Partition Table' 의 값이 'msdos' 인 것을 확인 할 수 있습니다.



2. MBR -> GPT 변경


다음 명령어를 사용하여 GPT 방식으로 변경 가능합니다.


(parted) mklabel gpt


변경 후 확인해보면 Partition Table의 값이 변경된 것을 확인 가능합니다.



(parted) mklabel gpt

Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk

will be lost. Do you want to continue?

Yes/No? yes                                                               

(parted)                                                                  

                                                                  

(parted) print                                                            

Model: LSI 9750-24i4e DISK (scsi)

Disk /dev/sdc: 2400GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt


Number  Start  End  Size  File system  Name  Flags


(parted)                                                                  




3. Partition 생성


다음의 명령어로 파티션 생성이 가능합니다.


(parted) mkpart primary 시작위치 끝위치 


파티션을 전체 영역으로 1개만 생성한다면 시작위치는 0, 끝위치는 디스크 용량으로 잡으시면 됩니다.


파티션 생성 후 확인 해보면 fdisk 로 생성한 것과는 다르게 2TB 이상의 파티션이 생성된 것을 확인 가능합니다.



(parted) mkpart primary 0 2400GB                                          

Warning: The resulting partition is not properly aligned for best performance.

Ignore/Cancel? Ignore                                                     

(parted)                                                                  


(parted) print                                                            

Model: LSI 9750-24i4e DISK (scsi)

Disk /dev/sdc: 2400GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt


Number  Start   End     Size    File system  Name     Flags

 1      17.4kB  2400GB  2400GB               primary


(parted) 



4. 종료


q 명령어로 종료를 해주시면 됩니다.

반응형
Posted by 해리팍
BLOG main image

Chanhyun Park (해리팍)
Software Engineer @ SK hynix

Contact Info.
parkch0708@hanmail.net
chanhyun0708@gmail.com
chanhyun.park@sk.com

카테고리

All (1501)
Profile (2)
Park's Life (599)
Computer System (165)
Computer Programming (39)
Computer Study (54)
Computer Etc. (189)
Scuba Diving (137)
Golf (8)
Traveling (245)
생활 정보 (12)
Pokemon GO (50)