Results 1 to 3 of 3

Thread: LVM problem after adding new disk

  1. #1
    Join Date
    Jul 2009
    Beans
    54
    Distro
    Ubuntu 14.04 Trusty Tahr

    LVM problem after adding new disk

    Hi,
    In short: adding a new HDD to an LVM group didn't work somehow and now it won't mount the disk(s), and I get this at boot:
    The disk drive for /movies is not ready yet or not present.

    I have a 12.04 installation with 2 hard drives (no RAID) and an LVM setup with a few volumes... I tried to add a new HDD to the machine and add it to the volume group, following the instructions at: http://www.howtogeek.com/howto/40702...ent-in-ubuntu/

    My volume group is called vg,
    the logical volume in question is called vgmovies, mounted at /movies

    Retracing my steps (should be accurate):
    I used fdisk to make a new primary LVM partition the full size of the disk... /dev/sdc1
    then pvcreate for the disk
    then vgextend vg /dev/sdc1
    then lvresize -l +100%FREE /dev/vg/vgmovies
    then resize2fs /dev/vg/vgmovies
    (last command took a long time)

    It all seemed to go well and df -h showed a nice big (3.6TB) volume.
    I restarted and had problems. To begin with, I only had /dev/sdc, not sdc1 (not sure why).
    At one point I added sdc as a PV (mistake), but later recreated the partition and sdc1 has stuck now (and sdc is not in the LVM).

    I've tried 100 different things since and can't fix it. (So some of the current problems are different than the initial issues probably.) Please help
    The current state seems to be that everything is there - the PV is present - but LVM thinks it's missing.
    http://osdir.com/ml/linux-lvm/2013-10/msg00041.html (and other places) suggests that vgextend --restoremissing should do it, but I get "vgextend: unrecognised option '--restoremissing'" !!
    I have not seen this error online, so don't know what to do with it.

    Here are some outputs. Let me know any other commands that would be helpful.

    Code:
    lindsay@htpc:~$ sudo lvm version  LVM version:     2.02.66(2) (2010-05-20)
      Library version: 1.02.48 (2010-05-20)
      Driver version:  4.22.0
    lindsay@htpc:~$ df -h
    Filesystem             Size  Used Avail Use% Mounted on
    /dev/mapper/vg-vgroot   19G  6.2G   12G  35% /
    udev                   1.8G  4.0K  1.8G   1% /dev
    tmpfs                  741M 1008K  740M   1% /run
    none                   5.0M     0  5.0M   0% /run/lock
    none                   1.9G   84K  1.9G   1% /run/shm
    /dev/sdb1              473M   53M  398M  12% /boot
    /dev/mapper/vg-vghome  9.3G  3.0G  5.9G  34% /home
    /dev/sda1               68G   11G   54G  17% /slashDisk1
    /dev/sda5              851G  473G  335G  59% /disk1
    lindsay@htpc:~$ sudo fdisk -l
    
    
    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 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
    Disk identifier: 0x000e55dd
    
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *          63   141837884    70918911   83  Linux
    /dev/sda3       141837885  1953520064   905841090    5  Extended
    /dev/sda5       141837948  1953520064   905841058+  83  Linux
    
    
    Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x000d1e6b
    
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *        2048      976895      487424   83  Linux
    /dev/sdb2          976896  3907028991  1953026048   8e  Linux LVM
    
    
    Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
    81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0xbc04db52
    
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1            2048  3907029167  1953513560   83  Linux
    
    
    Disk /dev/mapper/vg-vgroot: 20.0 GB, 19998441472 bytes
    255 heads, 63 sectors/track, 2431 cylinders, total 39059456 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/mapper/vg-vgroot doesn't contain a valid partition table
    
    
    Disk /dev/mapper/vg-vghome: 9999 MB, 9999220736 bytes
    255 heads, 63 sectors/track, 1215 cylinders, total 19529728 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/mapper/vg-vghome doesn't contain a valid partition table
    
    
    Disk /dev/mapper/vg-vgswap: 4999 MB, 4999610368 bytes
    255 heads, 63 sectors/track, 607 cylinders, total 9764864 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/mapper/vg-vgswap doesn't contain a valid partition table
    lindsay@htpc:~$ sudo pvdisplay -m
      --- Physical volume ---
      PV Name               /dev/sdb2
      VG Name               vg
      PV Size               1.82 TiB / not usable 4.00 MiB
      Allocatable           yes (but full)
      PE Size               4.00 MiB
      Total PE              476812
      Free PE               0
      Allocated PE          476812
      PV UUID               XHeIXt-d3xr-Wo1f-rZF9-7rCm-nvey-AfJ0QU
    
      --- Physical Segments ---
      Physical extent 0 to 4767:
        Logical volume    /dev/vg/vgroot
        Logical extents    0 to 4767
      Physical extent 4768 to 7151:
        Logical volume    /dev/vg/vghome
        Logical extents    0 to 2383
      Physical extent 7152 to 8343:
        Logical volume    /dev/vg/vgswap
        Logical extents    0 to 1191
      Physical extent 8344 to 476811:
        Logical volume    /dev/vg/vgmovies
        Logical extents    0 to 468467
    
      --- Physical volume ---
      PV Name               /dev/sdc1
      VG Name               vg
      PV Size               1.82 TiB / not usable 4.09 MiB
      Allocatable           yes (but full)
      PE Size               4.00 MiB
      Total PE              476931
      Free PE               0
      Allocated PE          476931
      PV UUID               AYUyq4-1YYp-kOK2-FYyB-qRjV-nZKx-vie8lT
    
      --- Physical Segments ---
      Physical extent 0 to 476930:
        Logical volume    /dev/vg/vgmovies
        Logical extents    468468 to 945398
    
    lindsay@htpc:~$ sudo vgdisplay 
      --- Volume group ---
      VG Name               vg
      System ID             
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  19
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                4
      Open LV               3
      Max PV                0
      Cur PV                2
      Act PV                1
      VG Size               3.64 TiB
      PE Size               4.00 MiB
      Total PE              953743
      Alloc PE / Size       953743 / 3.64 TiB
      Free  PE / Size       0 / 0   
      VG UUID               KoLIJC-xIB9-uKKh-Q7Ba-nfQR-Hf8I-OqsXS5
    
    lindsay@htpc:~$ sudo lvdisplay 
      --- Logical volume ---
      LV Name                /dev/vg/vgroot
      VG Name                vg
      LV UUID                iNv6Ss-DDbi-IFdG-dSmB-Ewee-Rxzc-AZvI8L
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                18.62 GiB
      Current LE             4768
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           252:0
    
      --- Logical volume ---
      LV Name                /dev/vg/vghome
      VG Name                vg
      LV UUID                rEKL7X-nsFk-qpu1-jAVG-ENzm-w1la-igpQRb
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                9.31 GiB
      Current LE             2384
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           252:1
    
      --- Logical volume ---
      LV Name                /dev/vg/vgswap
      VG Name                vg
      LV UUID                VfIbym-pFvq-Izkc-G0aa-9Yb4-3EXo-UwwPr4
      LV Write Access        read/write
      LV Status              available
      # open                 2
      LV Size                4.66 GiB
      Current LE             1192
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           252:2
    
      --- Logical volume ---
      LV Name                /dev/vg/vgmovies
      VG Name                vg
      LV UUID                6Xdubx-0I0S-2dWu-cvNz-2jlU-EUWy-dA7qbr
      LV Write Access        read/write
      LV Status              NOT available
      LV Size                3.61 TiB
      Current LE             945399
      Segments               2
      Allocation             inherit
      Read ahead sectors     auto
    Here's the output of dmesg: http://paste.ubuntu.com/7508473/ (I have a failing drive, /dev/sda, which is why I was adding a new one.)

    And here are some of the things I have tried, with their associated messages:

    Code:
    lindsay@htpc:~$ sudo vgcfgrestore -f /etc/lvm/archive/vg_00002.vg vg 
     Cannot restore Volume Group vg with 1 PVs marked as missing.
      Restore failed.
    lindsay@htpc:~$ sudo vgextend --restoremissing vg /dev/sdc1
    vgextend: unrecognised option '--restoremissing'
      Error during parsing of command line.
    lindsay@htpc:~$ sudo vgchange -a y
      Refusing activation of partial LV vgmovies. Use --partial to override.
      3 logical volume(s) in volume group "vg" now active
    lindsay@htpc:~$ sudo vgchange -a y --partial
      Partial mode. Incomplete volume groups will be activated read-only.
      4 logical volume(s) in volume group "vg" now active
    lindsay@htpc:~$ ls /movies/
    lindsay@htpc:~$ sudo pvmove /dev/sdc1  
     Cannot change VG vg while PVs are missing.
      Consider vgreduce --removemissing.
    lindsay@htpc:~$ sudo vgreduce vg /dev/sdc1
      Cannot change VG vg while PVs are missing.
      Consider vgreduce --removemissing.
    lindsay@htpc:~$ sudo vgreduce --removemissing vg
      WARNING: Partial LV vgmovies needs to be repaired or removed. 
      WARNING: There are still partial LVs in VG vg.
      To remove them unconditionally use: vgreduce --removemissing --force.
      Proceeding to remove empty missing PVs.
      Command failed with status code 5.
    lindsay@htpc:~$ sudo vgreduce --removemissing --force vg
      Inconsistent pre-commit metadata copies for volume group vg
      Inconsistent pre-commit metadata copies for volume group vg
      Volume group for uuid not found: KoLIJCxIB9uKKhQ7BanfQRHf8IOqsXS56Xdubx0I0S2dWucvNz2jlUEUWydA7qbr
      Failed to suspend vgmovies
    So... ???
    I don't want to lose the data in vgmovies, but there is nothing on the new disk. I am quite happy to remove it from the VG and start again, but I can't.

    I don't know what else to try. Thank you in advance for your suggestions!
    Last edited by lindsayward; May 24th, 2014 at 07:18 AM.

  2. #2
    Join Date
    Jul 2009
    Beans
    54
    Distro
    Ubuntu 14.04 Trusty Tahr

    Solved!

    Well, after at least 6 hours trying stuff with this (imagine how much more productive I could be if I used Windows ...

    I booted to a live CD (USB) with Ubuntu 14.04 and was able to run

    vgextend --restoremissing vg /dev/sdd1

    (drive letters changed around)... and it was successful. Added PV to VG

    then

    vgchange -a y

    and boot back into my usual system and it's all there!

    My version of LVM2 didn't have that option... not sure how I was 'supposed to' fix this problem without it, but anyway... I'm stoked.

    ... nevyn from IRC, if you see this, post a reply so I can see that you got my "thank you" for helping me today

  3. #3
    Join Date
    Jul 2009
    Beans
    54
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: LVM problem after adding new disk

    Should I be concerned that fdisk -l shows one disk as having a "Linux LVM" partition, but not the new one?

    Code:
    Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x000d1e6b
    
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *        2048      976895      487424   83  Linux
    /dev/sdb2          976896  3907028991  1953026048   8e  Linux LVM
    
    
    Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
    81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0xbc04db52
    
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1            2048  3907029167  1953513560   83  Linux

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •