2

I recently installed LVM on Ubuntu 18.04 running on a physical workstation, and then I created my first LV. After first reboot I found a problem, as I cannot activate it anymore.

I noticed this error:

root@lvrome:/var/log# pvdisplay -v
    Wiping internal VG cache
    Wiping cache of LVM-capable devices
  WARNING: Device /dev/sdb has size of 312573551 sectors which is smaller than corresponding PV size of 312581808 sectors. Was device resized?
  One or more devices used as PVs in VG backup_vg have changed sizes.
  --- Physical volume ---
  PV Name               /dev/sdb
  VG Name               backup_vg
  PV Size               149,05 GiB / not usable <3,84 MiB
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              38156
  Free PE               0
  Allocated PE          38156
  PV UUID               LHDgmj-QGCd-xJnF-QhqH-B61a-iYnd-BpN2ZI

  --- Physical volume ---
  PV Name               /dev/sdd
  VG Name               backup_vg
  PV Size               149,05 GiB / not usable <3,84 MiB
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              38156
  Free PE               0
  Allocated PE          38156
  PV UUID               lXbczN-5bXe-C2lB-2Wq1-khbE-19SO-O3aHdI

Here there are some display commands for VG and PV:

root@lvrome:/media# vgdisplay 
  WARNING: Device /dev/sdb has size of 312573551 sectors which is smaller than corresponding PV size of 312581808 sectors. Was device resized?
  One or more devices used as PVs in VG backup_vg have changed sizes.
  --- Volume group ---
  VG Name               backup_vg
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               298,09 GiB
  PE Size               4,00 MiB
  Total PE              76312
  Alloc PE / Size       76312 / 298,09 GiB
  Free  PE / Size       0 / 0   
  VG UUID               lDCvsV-fOvb-qFWM-hjqF-9xbo-TClo-e0Vzca

root@lvrome:/var/log# lvdisplay 
  WARNING: Device /dev/sdb has size of 312573551 sectors which is smaller than corresponding PV size of 312581808 sectors. Was device resized?
  One or more devices used as PVs in VG backup_vg have changed sizes.
  --- Logical volume ---
  LV Path                /dev/backup_vg/backup
  LV Name                backup
  VG Name                backup_vg
  LV UUID                lu8Jqs-7AD3-KNTH-2NP2-MQfP-zoxr-Ax2rPF
  LV Write Access        read/write
  LV Creation host, time lvrome, 2018-08-29 20:34:43 +0200
  LV Status              suspended
  # open                 0
  LV Size                298,09 GiB
  Current LE             76312
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

I tried to force activation for VG and then for LV, but I cannot go on:

root@lvrome:/media# vgchange -ay
  WARNING: Device /dev/sdb has size of 312573551 sectors which is smaller than corresponding PV size of 312581808 sectors. Was device resized?
  One or more devices used as PVs in VG backup_vg have changed sizes.
  device-mapper: resume ioctl on  (253:0) failed: Argomento non valido
  Unable to resume backup_vg-backup (253:0)
  1 logical volume(s) in volume group "backup_vg" now active
root@lvrome:/media# lvchange -ay backup_vg
  WARNING: Device /dev/sdb has size of 312573551 sectors which is smaller than corresponding PV size of 312581808 sectors. Was device resized?
  One or more devices used as PVs in VG backup_vg have changed sizes.
  device-mapper: resume ioctl on  (253:0) failed: Argomento non valido
  Unable to resume backup_vg-backup (253:0)

I'm sure I haven't resized PVs after installation. By the way, I created them through pvcreate /dev/sdb /dev/sdd, vgcreate backup_vg /dev/sdb /dev/sdd, lvcreate --type striped -i 2 -l 100%FREE -n backup backup_vg.

Here's the output from lsblk:

root@lvrome:~# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 223,6G  0 disk 
├─sda1   8:1    0    50G  0 part 
├─sda3   8:3    0    40G  0 part /
├─sda4   8:4    0     1K  0 part 
├─sda5   8:5    0     4G  0 part [SWAP]
├─sda6   8:6    0    50G  0 part /home
└─sda7   8:7    0  79,3G  0 part /media/Documenti
sdb      8:16   0   149G  0 disk 
sdc      8:32   0 465,8G  0 disk 
└─sdc1   8:33   0 465,8G  0 part /media/Dati
sdd      8:48   0 149,1G  0 disk 
sde      8:64   0 465,7G  0 disk 
└─sde1   8:65   0 465,7G  0 part 
sr0     11:0    1  1024M  0 rom  
sr1     11:1    1  1024M  0 rom  
sr2     11:2    1    30M  0 rom  

SMART status for disks:

/dev/sdb

root@lvrome:~# smartctl -a /dev/sdb
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-33-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.11
Device Model:     ST3160813AS
Serial Number:    
LU WWN Device Id: 5 000c50 015125925
Firmware Version: CC2H
User Capacity:    160.037.658.112 bytes [160 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Fri Sep  7 20:46:40 2018 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (  609) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   1) minutes.
Extended self-test routine
recommended polling time:    (  33) minutes.
Conveyance self-test routine
recommended polling time:    (   2) minutes.
SCT capabilities:          (0x103f) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   111   099   006    Pre-fail  Always       -       30102839
  3 Spin_Up_Time            0x0003   099   098   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   099   099   020    Old_age   Always       -       1698
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   071   060   030    Pre-fail  Always       -       12973048
  9 Power_On_Hours          0x0032   097   097   000    Old_age   Always       -       3276
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   098   098   020    Old_age   Always       -       2892
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       4295032833
189 High_Fly_Writes         0x003a   083   083   000    Old_age   Always       -       17
190 Airflow_Temperature_Cel 0x0022   072   053   045    Old_age   Always       -       28 (Min/Max 27/28)
194 Temperature_Celsius     0x0022   028   047   000    Old_age   Always       -       28 (0 13 0 0 0)
195 Hardware_ECC_Recovered  0x001a   056   033   000    Old_age   Always       -       30102839
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       2567 (25 218 0)
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       3366329622
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       2642615780

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

/dev/sdd

root@lvrome:~# smartctl -a /dev/sdd
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-33-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.11
Device Model:     ST3160813AS
Serial Number:    
LU WWN Device Id: 5 000c50 01507abcc
Firmware Version: CC2H
User Capacity:    160.041.885.696 bytes [160 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Fri Sep  7 20:46:57 2018 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (  625) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   1) minutes.
Extended self-test routine
recommended polling time:    (  38) minutes.
Conveyance self-test routine
recommended polling time:    (   2) minutes.
SCT capabilities:          (0x103f) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   118   099   006    Pre-fail  Always       -       178155821
  3 Spin_Up_Time            0x0003   100   097   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   091   091   020    Old_age   Always       -       9355
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   069   060   030    Pre-fail  Always       -       8117463
  9 Power_On_Hours          0x0032   086   086   000    Old_age   Always       -       12544
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       1
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       88
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   079   079   000    Old_age   Always       -       21
190 Airflow_Temperature_Cel 0x0022   072   055   045    Old_age   Always       -       28 (Min/Max 27/28)
194 Temperature_Celsius     0x0022   028   045   000    Old_age   Always       -       28 (0 17 0 0 0)
195 Hardware_ECC_Recovered  0x001a   054   043   000    Old_age   Always       -       178155821
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       10017 (102 148 0)
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       617191373
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       1792434767

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%      5833         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

That's my LVM version:

root@lvrome:/var/log# lvm version
  LVM version:     2.02.176(2) (2017-11-03)
  Library version: 1.02.145 (2017-11-03)
  Driver version:  4.37.0
  Configuration:   ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking --exec-prefix= --bindir=/bin --libdir=/lib/x86_64-linux-gnu --sbindir=/sbin --with-usrlibdir=/usr/lib/x86_64-linux-gnu --with-optimisation=-O2 --with-cache=internal --with-clvmd=corosync --with-cluster=internal --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --with-default-pid-dir=/run --with-default-run-dir=/run/lvm --with-default-locking-dir=/run/lock/lvm --with-thin=internal --with-thin-check=/usr/sbin/thin_check --with-thin-dump=/usr/sbin/thin_dump --with-thin-repair=/usr/sbin/thin_repair --enable-applib --enable-blkid_wiping --enable-cmdlib --enable-cmirrord --enable-dmeventd --enable-dbus-service --enable-lvmetad --enable-lvmlockd-dlm --enable-lvmlockd-sanlock --enable-lvmpolld --enable-notify-dbus --enable-pkgconfig --enable-readline --enable-udev_rules --enable-udev_sync

Can you help me to find a solution?

8
  • 1
    Can you post the output of lsblk? What are sdb and sdd? Is it a virtual machine? As always on Stack Exhange sites, edit the post with the info, as opposed to pasting it in a comment.
    – Halfgaar
    Sep 5, 2018 at 12:40
  • Ok done, thanks. As I wrote, it's a physical workstation.
    – liv913
    Sep 5, 2018 at 17:59
  • Can you still be more specific what sdb and sdd are? I can see that one is a tad smaller than the other (149.1 GB vs 149 GB). What kind of disks/SSDs are they? As of yet, I have no explanation BTW. I've never seen this. I also would like to point out that by having two PVs in the volume group, you double your changes of data loss; the data is lost when one of the devices fail.
    – Halfgaar
    Sep 5, 2018 at 19:42
  • They are two SATA disks, 160 GB each, and I expected them to be identical. I don't understand the reason of this size difference. I'm using LVM just to create a single logical volume where I store ~200 GB of backup data, so being it a second copy I don't expect a great fault tolerance. If an explanation cannot be found, it's ok for me to erase LV and start again configuration.
    – liv913
    Sep 6, 2018 at 7:49
  • Can you read the SMART status of both drives? Perhaps it shrunk because of bad sectors? I'm also wondering if their firmware have bugs. If you google the type number about this, do you find anything?
    – Halfgaar
    Sep 6, 2018 at 8:17

1 Answer 1

0

The order that disks are enumerated is not persistent between reboots. So /dev/sdb and /dev/sdd could be reversed each time you reboot the system. Or switched with /dev/sda or /dev/sdc. Or something else.

If you are doing something that depends on referring to the same physical disk each time the system boots, it's best to use the symbolic links in /dev/disk/by-id as Linux makes sure these always point to the same physical disks, even if their /dev/sd* specials change.

For example:

pvcreate /dev/disk/by-id/ata-SEAGATE-ST3160813AS_*whatever # you hid the serial number

Technically this shouldn't be necessary with LVM as it uses its own UUIDs internally for everything, at least after the PVs are created, but it's a good habit to get into.

2
  • Thanks, that's a good point. Is there a way to change device name without erasing already done LVM configuration?
    – liv913
    Sep 7, 2018 at 18:52
  • As you also mentioned, it's UUID based. At least with mdadm, I've hustled disks and this poses no problems. It wouldn't here either.
    – Halfgaar
    Sep 8, 2018 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .