리눅스에서 2TB 이상의 파티션 잡기 (parted)

▩Token: /dev/sdX st4000dm004 ST4000DM004

1. 파티션 초기화
# dd if=/dev/zero of=/dev/sdX  bs=4096  count=1


2. 파티션 잡기
# parted /dev/sdX
GNU Parted 3.2
Using /dev/sdX
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt (일반 파티션은 mklabel msdos)
(parted) unit tb
(parted) mkpart st4000dm004 0.00tb 4.50tb
or
(parted) mkpart st4000dm004 0% 100% (일반 파티션은 mkpart primary ext4 0% 100%)

(parted) print
Model: JMicron Generic (scsi)
Disk /dev/sdX: 4.00TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  4.00TB  4.00TB               primary
(parted) quit


3. 파티션 확인
# parted /dev/sdX unit tb print

Model: JMicron Generic (scsi)
Disk /dev/sdX: 4.00TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  4.00TB  4.00TB  ext4         primary


4. 파티션 포맷
# umount /dev/sdX1
# mkfs -t ext4 -L ST4000DM004 /dev/sdX1
or
mkntfs -L ST4000DM004 -f /dev/sdX1

mke2fs 1.44.1 (24-Mar-2018)
Found a gpt partition table in /dev/sdX
Proceed anyway? (y,N) y
Creating filesystem with 976754646 4k blocks and 244195328 inodes
Filesystem UUID: 504af1d1-9e01-43ab-a990-b786dcf276dc
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done

5. 용량 확인
# fdisk -l /dev/sdX

Disk /dev/sdX: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 5A86B36D-819D-4538-AF13-2EB41B3CF573

Device     Start        End    Sectors  Size Type
/dev/sdX1   2048 7814035455 7814033408  3.7T Linux filesystem

위로 스크롤