2

partx fails to read the partition table of /dev/sdb on this system. Why does it return this 'failed to read partition table' shown below, instead of null/empty ? Will this 'failed' result always mean the device's partition table is damaged?

Notes: here the sdb can work fine as LVM without any partition!

    # pvs
      PV         VG                                        Fmt  Attr PSize    PFree  
      /dev/sda3  vgroot                                    lvm2 a--    89.00g   4.00m
      /dev/sda4  vgroot                                    lvm2 a--   746.78g 746.78g
      /dev/sdb   vgdata                                    lvm2 a--  <836.99g      0 

    # 
    # 
    # sfdisk -l /dev/sdb

    Disk /dev/sdb: 109262 cylinders, 255 heads, 63 sectors/track
    # 
    #
    # sfdisk -l /dev/sda

    Disk /dev/sda: 109262 cylinders, 255 heads, 63 sectors/track
    Units: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

       Device Boot Start     End   #cyls    #blocks   Id  System
    /dev/sda1          0+ 109262- 109263- 877647871+  ee  GPT
    sfdisk:                 start: (c,h,s) expected (0,0,2) found (0,0,1)

    /dev/sda2          0       -       0          0    0  Empty
    /dev/sda3          0       -       0          0    0  Empty
    /dev/sda4          0       -       0          0    0  Empty
    # 
    # 
    # partx -s /dev/sdb 
    partx: /dev/sdb: failed to read partition table
    # 
    # partx -s /dev/sda
    NR     START        END    SECTORS   SIZE NAME                 UUID
     1      2048     411647     409600   200M EFI System Partition 255f05dd-3c30-4eb5-b4ef-e222216eb27e
     2    411648    2508799    2097152     1G                      0eba1772-1106-4a63-bad6-6d20be988dba
     3   2508800  189171711  186662912    89G                      39fab8c9-bd96-47a2-b5db-495e43159055
     4 189171712 1755295710 1566123999 746.8G                      9e3d6237-5c7f-4443-8b60-b258052a8b32

    # 
    # 
    # pvdisplay /dev/sdb
      --- Physical volume ---
      PV Name               /dev/sdb
      VG Name               vgdata
      PV Size               836.99 GiB / not usable 2.00 MiB
      Allocatable           yes (but full)
      PE Size               4.00 MiB
      Total PE              214269
      Free PE               0
      Allocated PE          214269
      PV UUID               IsOr0G-UBTt-Qn1E-bx6R-dzvY-HqSE-bNiCaq

    # 
    # 
    # lsb_release -a
        LSB Version:    :core-4.1-amd64:core-4.1-noarch
        Distributor ID: RedHatEnterpriseServer
        Description:    Red Hat Enterprise Linux Server release 7.4 (Maipo)
        Release:        7.4
        Codename:       Maipo
    # 
    # 

Another system scense:

The following partx can directly output null/empty without any partition, why?
Notes: the following sdb can also work fine as LVM without any partition!

# 
# 
# partx  /dev/sdb
# 
# 
# 
# pvdisplay  /dev/sdb
  --- Physical volume ---
  PV Name               /dev/sdb
  VG Name               vgdoc
  PV Size               600.00 GB / not usable 4.00 MB
  Allocatable           yes (but full)
  PE Size (KByte)       4096
  Total PE              153599
  Free PE               0
  Allocated PE          153599
  PV UUID               mMPvrE-NBP5-9n3J-77w5-57p0-1R7E-ggFCEj

# 
#  
# 
# lsb_release -a
LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Release:        5.5
Codename:       Tikanga
# 
# 

1) My thought is that the partx should not exited with "failed to read ..." if the disk really has no partition.
Notes: as you could see, the partx just only output null/empty in another system with the non-partition disk.

2) It is normal that the PV/LVMs can be created and used on the disk partitions, isn't it ?

 Device Boot Start     End   #cyls    #blocks   Id  System
   /dev/sda1   *      0+     25-     26-    204800   83  Linux
   /dev/sda2         25+  36404-  36380- 292215808   8e  Linux LVM
  • lyklb, would you mind please adding to your question? Please click edit and add the version of Linux of UNIX, and which version it is. Please do not reply with a Comment, as those can overflow quickly. – K7AAY Mar 20 at 15:24
1

partx requires a partition table. The results posted show there is no partition table on sdb.

This is different from a disk which has a partition table, but no partitions. In that case, you could not have an LVM PV on that disk.

Compare the output of

  • blkid -o export /dev/sda
  • blkid -o export /dev/sda3
  • blkid -o export /dev/sdb

You might also find lsblk useful.


sdb cannot be simultaneously formatted as an LVM PV and as a partition table, because they would include conflicting structures in the first sector. To see that they would both include structures in the first sector, compare:

  • wipefs --no-act /dev/sda
  • wipefs --no-act /dev/sda3
  • wipefs --no-act /dev/sdb

The "offset" column of wipefs --no-act is in bytes.

You must be careful if you run wipefs. It does what it sounds like. However it is safe if you run wipefs --no-act.

  • I have updated my post contents, and my actual situation should be inconsistent with your above statement. – lylklb Mar 21 at 14:56
  • @lylklb eh. partx should be provided by util-linux. If you want someone to verify nitpicky details about possibly different versions, you should post output of rpm -q --whatprovides $(which partx) , it should show the version number. – sourcejedi Mar 21 at 15:33
  • 1
    @lylklb I think you mis-read my second paragraph. sdb has no partition table, and that is why you can have an LVM PV directly on sdb. – sourcejedi Mar 21 at 15:40
  • I have updated my post contents again. And also I have used both the native rpm and open source code from kernel.org, but all the same failed results! – lylklb Mar 22 at 2:52
  • 1
    Yes, I have done it! And also the same failed result with the higher version of partx on RHEL 5.5! So the problem should be due to the difference version of partx. – lylklb Mar 26 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.