LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-22-2014, 03:31 PM   #1
Bentech
LQ Newbie
 
Registered: Apr 2014
Posts: 1

Rep: Reputation: Disabled
Unhappy LVM Problem


Hi,

I've been having some problems with my LVM disk array.

First off i was suspecting a failing hard disk

Code:
smartctl  /dev/sde
# 1 Extended offline Completed: read failure 90% 4861 280578
# 2  Short offline       Completed: read failure       90%      4860         28055778 
# 3  Extended offline    Completed: read failure       90%    4860         2805778
I tried correcting this with

Code:
dd if=/dev/zero of=/dev/sde conv=sync bs=4096 count=1 seek=2805778
Repeated till there were no more errors.

I tried mounting the disk but it still had errors. e.g. Input/Output error when trying ls in the directory. (I could access roughly half my files)

--

I was looking around and noticed my other disk /dev/sdf didn't have a partition label.

Code:
Error: Unable to open /dev/sdf - unrecognised disk label.
I Know This Was A Mistake Now But I corrected it with:

Code:
parted /dev/sdf
mklabel gpt
This cleared my lvm info.

I restored it with?

Code:
parted
mkpart primary 0 3000000 
set 1 boot on
This made my partition appear again.

I assumed everything was okay as it let me mount my lvm array again.

I knew there were problems with the disk so i preformed

Code:
fsck -C -f -y /dev/LVM_SATA/dvd
I Left this going overnight.


I came back to find half my files missing!

I unmounted the LVM.

I have now tried restoring the LVM from a backup i had made before it all went wrong.


I then restored it with
Code:
 pvcreate --uuid I11Uen-ra92-OEt0-h9LZ-Dj9z-l03m-WKapaG --restorefile ./LVM_SATA /dev/sdf1
Now mount gives

Code:
mount: special device /dev/LVM_SATA/dvd does not exist
Code:
sudo blkid/dev/sda1: UUID="IPVKAZ-RO2D-ss8d-OXe7-Pr2r-pJ21-sSlV02" TYPE="LVM2_member"
/dev/sda2: UUID="9hzH98-3Y3S-BY31-bTKO-2W3k-xQxq-jsa3FH" TYPE="LVM2_member"
/dev/sdb1: UUID="fa2fd5bd-39a0-423b-b2e3-55cb228280b1" TYPE="ext4"
/dev/sdb5: UUID="2c4f1c2a-d9cb-487c-a8f7-2836ca3452eb" TYPE="swap"
/dev/sdc1: UUID="z32Xx8-lXBh-1Rr0-XldC-0RCr-geG6-fe8ow2" TYPE="LVM2_member"
/dev/sdd1: UUID="9EjM3Z-igOx-I8P5-mdW2-hkdp-iieI-e2uJzo" TYPE="LVM2_member"
/dev/sde1: UUID="gYDc1O-333e-5eoh-yl4n-FfgW-UBlq-4XK3TL" TYPE="LVM2_member"
/dev/sdf1: UUID="I11Uen-ra92-OEt0-h9LZ-Dj9z-l03m-WKapaG" TYPE="LVM2_member"


Code:
 cat ./LVM_SATA
# Generated by LVM2 version 2.02.66(2) (2010-05-20): Tue Apr 22 08:39:34 2014


contents = "Text Format Volume Group"
version = 1


description = "vgcfgbackup -f /root/LVM_SATA LVM_SATA"


creation_host = "mythserver.local"      # Linux mythserver.local 3.8.0-35-generic #52~precise1-Ubuntu SMP Thu Jan 30 17:27:28 UTC 2014 i686
creation_time = 1398152374      # Tue Apr 22 08:39:34 2014


LVM_SATA {
        id = "xCkZNm-PyI0-3ANq-PRkR-OEk2-Xcmm-CK3L90"
        seqno = 48
        status = ["RESIZEABLE", "READ", "WRITE"]
        flags = []
        extent_size = 8192              # 4 Megabytes
        max_lv = 0
        max_pv = 0


        physical_volumes {


                pv0 {
                        id = "9EjM3Z-igOx-I8P5-mdW2-hkdp-iieI-e2uJzo"
                        device = "/dev/sdd1"    # Hint only


                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 2930272002   # 1.36451 Terabytes
                        pe_start = 384
                        pe_count = 357699       # 1.36451 Terabytes
                }


                pv1 {
                        id = "gYDc1O-333e-5eoh-yl4n-FfgW-UBlq-4XK3TL"
                        device = "/dev/sdg1"    # Hint only


                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 2930272002   # 1.36451 Terabytes
                        pe_start = 384
                        pe_count = 357699       # 1.36451 Terabytes
                }


                pv2 {
                        id = "z32Xx8-lXBh-1Rr0-XldC-0RCr-geG6-fe8ow2"
                        device = "/dev/sdc1"    # Hint only


                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 3907026560   # 1.81935 Terabytes
                        pe_start = 384
                        pe_count = 476931       # 1.81935 Terabytes
                }


                pv3 {
                        id = "9hzH98-3Y3S-BY31-bTKO-2W3k-xQxq-jsa3FH"
                        device = "/dev/sda2"    # Hint only


                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 882269824    # 420.699 Gigabytes
                        pe_start = 384
                        pe_count = 107698       # 420.695 Gigabytes
                }


                pv4 {
                        id = "IPVKAZ-RO2D-ss8d-OXe7-Pr2r-pJ21-sSlV02"
                        device = "/dev/sda1"    # Hint only


                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 2048004096   # 976.564 Gigabytes
                        pe_start = 384
                        pe_count = 250000       # 976.562 Gigabytes
                }


                pv5 {
                        id = "I11Uen-ra92-OEt0-h9LZ-Dj9z-l03m-WKapaG"
                        device = "/dev/sdf1"    # Hint only


                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 5860532784   # 2.72902 Terabytes
                        pe_start = 384
                        pe_count = 715397       # 2.72902 Terabytes
                }
        }


        logical_volumes {


                dvd {
                        id = "M8Nxb5-OfH1-iOiq-Q2Wr-1cHa-hqAz-vwXcIa"
                        status = ["READ", "WRITE", "VISIBLE"]
                        flags = []
                        segment_count = 6


                        segment1 {
                                start_extent = 0
                                extent_count = 357699   # 1.36451 Terabytes


                                type = "striped"
                                stripe_count = 1        # linear


                                stripes = [
                                        "pv0", 0
                                ]
                        }
                        segment2 {
                                start_extent = 357699
                                extent_count = 357699   # 1.36451 Terabytes


                                type = "striped"
                                stripe_count = 1        # linear


                                stripes = [
                                        "pv1", 0
                                ]
                        }
                        segment3 {
                                start_extent = 715398
                                extent_count = 476931   # 1.81935 Terabytes


                                type = "striped"
                                stripe_count = 1        # linear


                                stripes = [
                                        "pv2", 0
                                ]
                        }
                        segment4 {
                                start_extent = 1192329
                                extent_count = 107698   # 420.695 Gigabytes


                                type = "striped"
                                stripe_count = 1        # linear


                                stripes = [
                                        "pv3", 0
                                ]
                        }
                        segment5 {
                                start_extent = 1300027
                                extent_count = 250000   # 976.562 Gigabytes


                                type = "striped"
                                stripe_count = 1        # linear


                                stripes = [
                                        "pv4", 0
                                ]
                        }
                        segment6 {
                                start_extent = 1550027
                                extent_count = 715397   # 2.72902 Terabytes


                                type = "striped"
                                stripe_count = 1        # linear


                                stripes = [
                                        "pv5", 0
                                ]
                        }
                }
        }
}
 
Old 04-23-2014, 07:51 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Bentech View Post
Hi,

I've been having some problems with my LVM disk array.

First off i was suspecting a failing hard disk

[CODE]smartctl /dev/sde
According to the LVM_SATA file, /dev/sde is not part of that volume group, so I guess your problems with /dev/sde are unrelated to the rest.

Quote:
Code:
parted /dev/sdf
mklabel gpt
This cleared my lvm info.
Not really. Since the partitioning information was gone, /dev/sdf1 didn't exist anymore, and LVM could find this physical volume. The information is still on the disk.
Quote:
I restored it with?

Code:
parted
mkpart primary 0 3000000 
set 1 boot on
Well, you recreated a partition /dev/sdf1, and LVM can now access the previously missing physical volume again. If /dev/sdf1 is however not at the exact same location or doesn't have the same size as before, there will be trouble.
Quote:
I then restored it with
Code:
 pvcreate --uuid I11Uen-ra92-OEt0-h9LZ-Dj9z-l03m-WKapaG --restorefile ./LVM_SATA /dev/sdf1
Now mount gives

Code:
mount: special device /dev/LVM_SATA/dvd does not exist
What does vgdisplay -v LVM_SATA tell you?

You might be better off just recreating the whole volume group with vgcfgrestore.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with LVM mirror and failed PV, can't recover -- Debian Squeeze lvm 2.02.66-5 Linux Ninja Linux - Server 2 06-02-2017 04:50 PM
Raid + LVM add new raid device to LVM, problem request Linux - Server 3 08-15-2012 04:06 AM
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 12:59 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM
LVM problem frig_neutron Linux - Software 12 05-13-2003 02:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration