fdisk로 4K 섹터 정렬된 파티션 생성

parted나 fdisk나 4K 정렬을 지원하지만 그냥 생성한다고해서 정렬 된 파티션으로 생성되지않는다. 정렬되지 않았다고 그냥 경고 메시지만 출력할 뿐(…) 직접 계산하여 생성할 수 있겠지만 그럴 필요성까지는 느껴지지않는다. parted같은 경우 정렬 된 파티션을 생성하려면 이전에 남긴 “Parted 사용정리” 글을 보면 될것이고 fdisk는 실행할 때 옵션을 주면 된다.

1. fdisk 버전 2.17.1 미만일경우
# fdisk -S 32 -H 64 disk.img

2. fdisk 버전 2.17.1 이상일경우
# fdisk -c -u disk.img

이렇게 실행하여 경우 결과는 아래와같다.

Welcome to fdisk (util-linux 2.30.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-262143, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-262143, default 262143): +10K

Created a new partition 1 of type 'Linux' and of size 10 KiB.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (2-4, default 2):
First sector (2068-262143, default 4096):
Last sector, +sectors or +size{K,M,G,T,P} (4096-262143, default 262143):

Created a new partition 2 of type 'Linux' and of size 126 MiB.

Command (m for help): p
Disk disk.img: 128 MiB, 134217728 bytes, 262144 sectors
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: dos
Disk identifier: 0xe765896f

Device     Boot Start    End Sectors  Size Id Type
disk.img1        2048   2067      20   10K 83 Linux
disk.img2        4096 262143  258048  126M 83 Linux

Command (m for help):

그런데 정렬된 파티션을 생성할 때 왜 2048섹터가 시작점이 되는지 모르겠다. 섹터당 512 bytes라면 8섹터가 4096바이트, 2048섹터는 1메가바이트인데… 구글링해도 시원한 답이 안보인다. 그냥 넘어가야겠다.

추가내용) 4K 섹터 정렬에 대한 잘 설명된 글은 데스게이트의 글인 고급 포맷 4K 섹터 하드 드라이브로의 전환에서 볼 수 있다. (왜 데스게이트라고 불리는지는 나무위키 Seagate 페이지의 돌연사 항목을 보자. 나중에 번호가 바뀌더라도 돌연사 항목을 찾아서 보면 될것이다. WD는 자회사인 HGST보다 안정성 떨어져 불량이 많이 늘어 마찬가지로 신뢰 안하는 중. 모든 하드가 다 마찬가지긴 한데 쓰려면 최소한 RAID-1을 써야 나중에 피 안본다.)

참고페이지: Partition Alignment

3 Comments

    zer0

    2048 섹터인 이유는 파티션 정렬 때문에 그렇습니다.

      iruis

      정렬된 파티션을 사용하도록 옵션을 주어서 생성한 결과가 2048 섹터가 나왔으니 파티션 정렬 때문이란건 알지만, 왜 2048섹터인지 시원한 답이 안나온다는 것이였습니다.

zer0에 답글 남기기 응답 취소

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

*
*

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.