Embedded Linux/Storage
parted를 이용하여 파티션을 생성
깍수
2014. 7. 24. 15:43
Frankly speaking, you cannot create a Linux partition larger than 2 TB using the fdisk command. The fdisk won't create partitions larger than 2 TB. This is fine for desktop and laptop users, but on server you need a large partition.
To solve this problem use GNU parted command with GPT. It supports Intel EFI/GPT partition tables. Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk. It is a part of the Extensible Firmware Interface (EFI) standard proposed by Intel as a replacement for the outdated PC BIOS, one of the few remaining relics of the original IBM PC. EFI uses GPT where BIOS uses a Master Boot Record (MBR).
Linux GPT Kernel Support
File Systems Partition Types [*] Advanced partition selection [*] EFI GUID Partition support (NEW) .... |
Set Partition Table to GPT using Parted mklabel
In our case, we need to create a partition >2TB. So, we should use parted command.
Before creating the partition command, we should set the disk label to GPT.
GPT stands for GUID partition table format (GPT).
Use parted’s mklabel command to set disk label to GPT as shown below.
# parted /dev/sdb GNU Parted 2.1 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? yes (parted) |
- 파티션 생성
mkpart 명령을 사용하며 형식은 mkpart <Label> <Start> <End>
(parted) mkpart system 66 1090 |
생성된 원하는 파일 시스템을 적용하여 사용하면된다.(ext4, vfat 생성)
#mkfs.ext4 /dev/sdc2 -L system #mkfs.vfat -F 32 /dev/sdc1 -n media #sync |