Erro de LVM Dispositivo não encontrado (ou ignorado por filtragem), mas não existem partições no dispositivo

1

Eu deletei todas as partições em dois discos locais e estou configurando o LVM nesses dois discos. Eu criei com sucesso um volume físico em /dev/sda , mas fazê-lo em /dev/sdb falha conforme descrito abaixo. Eu estou trabalhando de um instalador USB linux mint (por exemplo, nenhum disco está montado).

Tentativa de criar um volume físico:

mint ~ # pvcreate /dev/sdb
  Device /dev/sdb not found (or ignored by filtering).

Verifique se não há partições

mint ~ # fdisk /dev/sdb

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/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 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: gpt
Disk identifier: 785CAD57-8930-43D2-A61E-572453B74805

Command (m for help): q

Veja /proc/partitions - isso foi solicitado em um guia de solução de problemas que tentei seguir.

mint ~ # cat /proc/partitions 
major minor  #blocks  name

   7        0    1799560 loop0
   8        0  125034840 sda
   8       16  976762584 sdb
   8       32    1966080 sdc
   8       33    1966030 sdc1

Adicionado detalhes dos comentários:

Nenhuma saída de:

grep -n '^[^#]*filter' /etc/lvm/lvm*.conf

Strace resulta perto da mensagem de erro (a saída foi muito longa):

strace pvcreate /dev/sdb

stat("/dev/sdb", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 16), ...}) = 0
open("/dev/sdb", O_RDONLY|O_DIRECT|O_NOATIME) = 4
fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 16), ...}) = 0
ioctl(4, BLKBSZGET, [4096])             = 0
ioctl(4, BLKPBSZGET, [512])             = 0
lseek(4, 0, SEEK_SET)                   = 0
read(4, "
mint ~ # pvcreate /dev/sdb
  Device /dev/sdb not found (or ignored by filtering).
mint ~ # fdisk /dev/sdb

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/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 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: gpt
Disk identifier: 785CAD57-8930-43D2-A61E-572453B74805

Command (m for help): q
mint ~ # cat /proc/partitions 
major minor  #blocks  name

   7        0    1799560 loop0
   8        0  125034840 sda
   8       16  976762584 sdb
   8       32    1966080 sdc
   8       33    1966030 sdc1
grep -n '^[^#]*filter' /etc/lvm/lvm*.conf
strace pvcreate /dev/sdb

stat("/dev/sdb", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 16), ...}) = 0
open("/dev/sdb", O_RDONLY|O_DIRECT|O_NOATIME) = 4
fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 16), ...}) = 0
ioctl(4, BLKBSZGET, [4096])             = 0
ioctl(4, BLKPBSZGET, [512])             = 0
lseek(4, 0, SEEK_SET)                   = 0
read(4, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 4096) = 4096
close(4)                                = 0
write(2, "  ", 2  )                       = 2
write(2, "Device /dev/sdb not found (or ig"..., 52Device /dev/sdb not found (or ignored by filtering).) = 52
%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 4096) = 4096 close(4) = 0 write(2, " ", 2 ) = 2 write(2, "Device /dev/sdb not found (or ig"..., 52Device /dev/sdb not found (or ignored by filtering).) = 52
    
por David Parks 05.05.2018 / 20:55

1 resposta

1

Encontrou a resposta enquanto analisava detalhadamente a documentação:

link

dd if=/dev/zero of=/dev/sdb bs=512 count=1

Da documentação mencionada acima:

4.2.1.1. Setting the Partition Type

If you are using a whole disk device for your physical volume, the disk must have no partition table. For DOS disk partitions, the partition id should be set to 0x8e using the fdisk or cfdisk command or an equivalent. For whole disk devices only the partition table must be erased, which will effectively destroy all data on that disk. You can remove an existing partition table by zeroing the first sector with the following command:

Depois de executar esse comando, consegui criar o volume físico.

    
por 05.05.2018 / 22:31

Tags