파티션 / dev / sda5를 확장하려고합니다. 확장 파티션 / dev / sda2 아래의 논리 파티션입니다.

fdisk 를 사용하고 싶습니다.

p>

절차는 두 파티션을 모두 삭제 한 다음 정확히 동일한 시작 섹터 (1001470 & 1001472)로 다시 만드는 것입니다. 최소 시작 섹터가있는 논리 파티션을 만들 때까지 잘 진행됩니다. 필요한 것보다 큽니다 ( 1003518 ).

 $ sudo fdisk /dev/sda Command (m for help): p Disk /dev/sda: 9.8 GiB, 10485760000 bytes, 20480000 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: 0x0cd7105f Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 999423 997376 487M 83 Linux /dev/sda2 1001470 16775167 15773698 7.5G 5 Extended /dev/sda5 1001472 16775167 15773696 7.5G 83 Linux Partition 5 has been deleted. Partition 2 has been deleted. Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): e Partition number (2-4, default 2): First sector (999424-20479999, default 999424): 1001470 Last sector, +sectors or +size{K,M,G,T,P} (1001470-20479999, default 20479999): Created a new partition 2 of type "Extended" and of size 9.3 GiB. Command (m for help): n All space for primary partitions is in use. Adding logical partition 5 First sector (1003518-20479999, default 1003520): 1001472 Value out of range. 

parted 로 해봤지만 fdisk로 어떻게 든 가능할 것입니다.

$ fdisk -V fdisk from util-linux 2.27.1 

Answer

일반 인터페이스에서 Linux의 fdisk는 파티션에 정렬 제약을 적용합니다. 어떤 제약은 fdisk의 버전에 따라 다릅니다. 이전 버전은 LBA 와 호환되지 않는 이전 운영 체제와의 호환성을 위해 실린더 정렬로 기본 설정되었습니다. LBA가 20 년이 조금 넘었을 때 fdisk는 기본적으로 이러한 오래된 시스템을 지원하지 않고 대신 1MB 정렬로 전환하여 최신 스토리지 미디어에서 더 나은 성능을 제공합니다.

현재 버전의 fdisk에서 섹터 (512B) 정렬로 파티션을 생성하려면 먼저 원하는 끝점으로 파티션을 생성 한 다음 전문가 메뉴 (x)로 이동하여 b 파티션의 시작을 조정합니다 (이렇게하면 파티션이 끝나는 곳이 아니라 파티션 크기가 변경됨). 다소 어색해 보입니다.

댓글

  • 매력처럼 작동했습니다. 이 사례 에서 전문가 모드가 필요하지 않은 이유를 설명해 주시겠습니까?
  • @ A.D. 이 경우 파티션이 1MB로 정렬 되었기 때문입니다.
  • 사실, 정렬 된 파티션을 확장하려고했는데 전문가 모드 없이도 작동했습니다.

답변

Gilles “ 답변에 따라 취한 조치 :

 $ sudo fdisk /dev/sda Welcome to fdisk (util-linux 2.27.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/sda: 9.8 GiB, 10485760000 bytes, 20480000 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: 0x0cd7105f Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 999423 997376 487M 83 Linux /dev/sda2 1001470 16775167 15773698 7.5G 5 Extended /dev/sda5 1001472 16775167 15773696 7.5G 83 Linux Command (m for help): d Partition number (1,2,5, default 5): 2 Partition 2 has been deleted. Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): e Partition number (2-4, default 2): First sector (999424-20479999, default 999424): 1001470 Last sector, +sectors or +size{K,M,G,T,P} (1001470-20479999, default 20479999): Created a new partition 2 of type "Extended" and of size 9.3 GiB. Command (m for help): n All space for primary partitions is in use. Adding logical partition 5 First sector (1003518-20479999, default 1003520): Last sector, +sectors or +size{K,M,G,T,P} (1003520-20479999, default 20479999): Created a new partition 5 of type "Linux" and of size 9.3 GiB. Command (m for help): x Expert command (m for help): b Partition number (1,2,5, default 5): New beginning of data (1001471-20479999, default 1003520): 1001472 Expert command (m for help): p Disk /dev/sda: 9.8 GiB, 10485760000 bytes, 20480000 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: 0x0cd7105f Device Boot Start End Sectors Id Type Start-C/H/S End-C/H/S Attrs /dev/sda1 * 2048 999423 997376 83 Linux 0/33/32 62/55/53 80 /dev/sda2 1001470 20479999 19478530 5 Extende 62/23/86 250/23/209 /dev/sda5 1001472 20479999 19478528 83 Linux 62/57/118 250/23/209 

그런 다음 r (주 메뉴로 돌아 가기) 및 w (디스크에 테이블 쓰기).

답변

Fdisk는 오래된 프로그램이며 MBR 파티션 만 이해합니다. 문제는 디스크 구조 (헤드, 트랙 당 섹터 및 트랙)가 변경된 것 같습니다. dd 명령 (섹터 간 복사)을 통해 이전 디스크에서 새 디스크로의 파티션이 트랙의 섹터를 시작하도록 정렬되지 않았습니다. 이것이 fdisk가 트랙 섹터의 시작에 처음 정렬되기 전에 시작 파티션 섹터를 만들 수없는 이유입니다. 오래된 디스크에.

확장 메뉴의 명령을 통해 fdisk 프로그램에서 새 디스크의 지오메트리를 변경할 수는 있지만 잘못된 방법입니다. 이전 fdisk 대신 parted 및 gparted 프로그램을 사용하십시오.

지금 읽고 있습니다. 쓰기 속도는 각 파티션의 트랙 섹터를 시작하도록 정렬하는 것에 의존하지 않습니다.

댓글

  • 최신 버전의 fdisk도 GPT를 이해하지만 ' 여기서는 관련이 없습니다. 문제는 ' 반드시 변경된 디스크 구조가 아니라 fdisk '의 비전문가 인터페이스의 한계 일뿐입니다.
  • MBR : Disklabel type: dos입니다. parted가 ' 정렬되지 않아서 정렬 한 다음 확장 할 수 있다고 불평했던 것을 기억합니다. 저는 ' fdisk에서 동일한 절차가 수행되는 것을 보았고 제대로 작동하고 있다고 확신합니다.

답글 남기기

이메일 주소를 발행하지 않을 것입니다. 필수 항목은 *(으)로 표시합니다