비대화형 parted 명령에서 파티션 유형 설정

비대화형 parted 명령에서 파티션 유형 설정

Linux(Centos)에 새 디스크가 있습니다.

# fdisk -l /dev/sdb

Disk /dev/sdb: 536 MB, 536870912 bytes, 1048576 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

다음 명령을 사용하여 GPT 파티션 테이블과 새 파티션을 만듭니다.

# parted -a optimal --script /dev/sdb mklabel gpt mkpart primary 0% 100%

fdisk -l보여주다:

# fdisk -l /dev/sdb
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sdb: 536 MB, 536870912 bytes, 1048576 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
Disk label type: gpt
Disk identifier: 332CB746-DE7D-4FB0-AE34-D9B5CB008473


#         Start          End    Size  Type            Name
 1         2048      1046527    510M  Microsoft basic primary

parted명령이 유형을 " "로 설정하는 이유는 무엇 입니까 Microsoft basic? Linux filesystem위의 명령줄(비대화형) 명령을 사용하여 parted""로 설정하려면 어떻게 해야 합니까 ?

현재 이를 변경하려면 " gdisk /dev/sdb"을(를) 수동으로 실행한 다음 t코드를 선택 해야 합니다 8300.

Command (? for help): t
Using 1
Current type is 'Microsoft basic data'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'

또 다른 질문은, 위 명령을 사용하여 파티션을 생성 하고 크기를 parted사용할 때 명령을 사용하여 파티션을 생성할 때보다 크기가 1MB 작아지는 이유는 무엇입니까?100%gdisk

분리된:

#         Start          End    Size  Type            Name
 1         2048      1046527    510M  Linux filesyste primary

g 디스크:

#         Start          End    Size  Type            Name
 1         2048      1048542    511M  Linux filesyste Linux filesystem

관련 정보