물리 볼륨을 생성할 때 장치 /dev/sda4를 찾을 수 없음 오류

물리 볼륨을 생성할 때 장치 /dev/sda4를 찾을 수 없음 오류

현재 디스크를 확장하려고 하는데 pvcreate최신 파티션을 사용하면 아래에 명령 세부 정보를 찾을 수 없다는 메시지가 나타납니다.

내가 알아차린 한 가지는 파티션을 나눈 후 디스크 레이블 유형이 DOS에서 GPT로 변경되었다는 것입니다. 이것이 무엇을 의미하는지 잘 모르겠습니다.

login as: root
[email protected]'s password:
Last login: Wed Oct 11 01:03:01 2017 from 10.10.222.122
[root@dpnjsv2-centos7-base ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.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 (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (2-4, default 2): 4
First sector (41943040-73400319, default 41943040):
Using default value 41943040
Last sector, +sectors or +size{K,M,G} (41943040-73400319, default 73400319):
Using default value 73400319
Partition 4 of type Linux and of size 15 GiB is set




Command (m for help): t


Partition number (1,4, default 4): 4


Hex code (type L to list all codes): 8e


Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): p

Disk /dev/sda: 37.6 GB, 37580963840 bytes, 73400320 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: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1    41943039    20971519+  ee  GPT
/dev/sda4        41943040    73400319    15728640   8e  Linux LVM


Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
You have new mail in /var/spool/mail/root


[root@dpnjsv2-centos7-base ~]# partprobe


[root@dpnjsv2-centos7-base ~]# pvcreate /dev/sda4
  **Device /dev/sda4 not found (or ignored by filtering).**
You have new mail in /var/spool/mail/root
[root@dpnjsv2-centos7-base ~]# fdisk /dev/sda
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Welcome to fdisk (util-linux 2.23.2).

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: 37.6 GB, 37580963840 bytes, 73400320 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


#         Start          End    Size  Type            Name
 1         2048       411647    200M  EFI System      EFI System Partition
 2       411648      1435647    500M  Microsoft basic
 3      1435648     41940991   19.3G  Linux LVM

Command (m for help): pvcreate 1

Disk /dev/sda: 37.6 GB, 37580963840 bytes, 73400320 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


#         Start          End    Size  Type            Name
 1         2048       411647    200M  EFI System      EFI System Partition
 2       411648      1435647    500M  Microsoft basic
 3      1435648     41940991   19.3G  Linux LVM

답변1

게시한 출력이 약간 일관성이 없어 보입니다. 먼저 /dev/sda4 파티션을 생성했지만 목록에 표시되지 않았습니다. 실제로 존재합니까?

그렇다면 /dev/sda4 파티션 시작 부분에 약간의 쓰레기가 있고 pvcreate가 이를 받아들일 수 없을 가능성이 높습니다. 예를 들어 처음 몇 메가바이트를 정리해 보십시오.

dd if=/dev/zero of=/dev/sda4 bs=1M count=20

최근에 전체 /dev/sdb 디스크를 새 VG로 사용하려고 시도한 비슷한 상황이 발생했습니다.


아직 sda2/3은 없지만 sda4를 만들었습니다.

Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (2-4, default 2): 4

이는 동일한 이름을 가진 두 개의 다른 노드처럼 보입니다.

관련 정보