LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-03-2011, 05:11 PM   #1
marcelvl
LQ Newbie
 
Registered: Feb 2010
Posts: 9

Rep: Reputation: 0
lvm partition moved to other system, errors


Hi,

I have two 1TB drive partitioned as LVM. Now i moved these two drives to another system. If i try to mount this LVM partition i'll get the following error:

Code:
mount: special device /dev/backup/backup does not exist
Some other information:

Code:
pvscan
Couldn't find device with uuid zlSlGO-0Rgk-I9EJ-Qc5H-8L9o-d6tQ-325x9y.
PV /dev/sdc1        VG backup          lvm2 [931.51 GB / 0    free]
PV unknown device   VG backup          lvm2 [931.51 GB / 0    free]
PV /dev/sdb1        VG cosfileserver   lvm2 [1.82 TB / 0    free]
Total: 3 [3.64 TB] / in use: 3 [3.64 TB] / in no VG: 0 [0   ]
The problem is the unknown device if i'm correct.

Code:
vgscan
Reading all physical volumes.  This may take a while...
Couldn't find device with uuid zlSlGO-0Rgk-I9EJ-Qc5H-8L9o-d6tQ-325x9y.
Found volume group "backup" using metadata type lvm2
Found volume group "cosfileserver" using metadata type lvm2
Code:
lvscan
Couldn't find device with uuid zlSlGO-0Rgk-I9EJ-Qc5H-8L9o-d6tQ-325x9y.
inactive          '/dev/backup/backup' [1.82 TB] inherit
ACTIVE            '/dev/cosfileserver/btmusic' [1.82 TB] inherit
Code:
vgdisplay
Couldn't find device with uuid zlSlGO-0Rgk-I9EJ-Qc5H-8L9o-d6tQ-325x9y.
--- Volume group ---
VG Name               backup
System ID
Format                lvm2
Metadata Areas        1
Metadata Sequence No  6
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                1
Open LV               0
Max PV                0
Cur PV                2
Act PV                1
VG Size               1.82 TB
PE Size               4.00 MB
Total PE              476932
Alloc PE / Size       476932 / 1.82 TB
Free  PE / Size       0 / 0
VG UUID               z6e0k5-b8jR-DORr-nr5z-Ekg7-KT6q-Du0ySB
   --- Volume group ---
VG Name               cosfileserver
System ID
Format                lvm2
Metadata Areas        1
Metadata Sequence No  2
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                1
Open LV               0
Max PV                0
Cur PV                1
Act PV                1
VG Size               1.82 TB
PE Size               4.00 MB
Total PE              476931
Alloc PE / Size       476931 / 1.82 TB
Free  PE / Size       0 / 0
VG UUID               LDIgzc-Xo56-5OVS-xDLy-aS2E-Pux0-V6j3T5
How do i solve this problem?
 
Old 12-04-2011, 05:38 PM   #2
_bsd
Member
 
Registered: Jan 2010
Location: Velveeta, USA
Distribution: Xen, Gentoo,Ubuntu,openSUSE,Debian,pfSense
Posts: 98

Rep: Reputation: 8
first of all you didn't specify the distro/version you're using, most/all of the recent distros are using LVM but it would be important to know if you were switching from one to another.

When you initialize a physical volume for use with pvcreate, the UUID is written on disk.
VG metadata is stored on disk as well.

The fact that you're getting the "unknown device" implies either the OS or BIOS isn't seeing the disk.

Re-seat the disk connectors, make sure the devices are seen from the bios, and try again.

If you still have errors, please post the output of
Code:
dmesg |grep ata
and
Code:
lshw -class disk -class volume

Last edited by _bsd; 12-04-2011 at 07:15 PM.
 
Old 12-05-2011, 02:43 PM   #3
marcelvl
LQ Newbie
 
Registered: Feb 2010
Posts: 9

Original Poster
Rep: Reputation: 0
First thank you for your time.

I'll checked the disk connectors and the BIOS. The BIOS sees the two drives. Also when i do "fdisk -l" fdisk is reporting the two drives.

Output of dmesg | grep ata

Code:
dmesg | grep ata
Memory: 763968k/778176k available (2205k kernel code, 13600k reserved, 921k data, 236k init, 0k highmem)
ksign: Installing public key data
Write protecting the kernel read-only data: 417k
libata version 3.00 loaded.
ata_piix 0000:00:1f.2: version 2.12
ata_piix 0000:00:1f.2: MAP [ P0 -- P1 -- ]
scsi0 : ata_piix
scsi1 : ata_piix
ata1: SATA max UDMA/133 cmd 0x24f8 ctl 0x2810 bmdma 0x24d0 irq 169
ata2: SATA max UDMA/133 cmd 0x2800 ctl 0x2814 bmdma 0x24d8 irq 169
ata1.00: ATA-8: SAMSUNG HM320JI, 2SS00_01, max UDMA7
ata1.00: 625142448 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata1.00: configured for UDMA/133
ata2.00: ATA-7: Hitachi HDT725050VLA360, V56OA73A, max UDMA/133
ata2.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata2.00: configured for UDMA/133
EXT3-fs: mounted filesystem with ordered data mode.
sata_sil 0000:05:09.0: version 2.3
scsi2 : sata_sil
scsi3 : sata_sil
ata3: SATA max UDMA/100 mmio m512@0xfc510000 tf 0xfc510080 irq 169
ata4: SATA max UDMA/100 mmio m512@0xfc510000 tf 0xfc5100c0 irq 169
ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata3.00: ATA-8: WDC WD10EACS-00ZJB0, 01.01B01, max UDMA/133
ata3.00: 1953525168 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata3.00: configured for UDMA/100
ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata4.00: ATA-8: WDC WD10EACS-00ZJB0, 01.01B01, max UDMA/133
ata4.00: 1953525168 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata4.00: configured for UDMA/100
EXT3-fs: mounted filesystem with ordered data mode.
EXT3-fs: mounted filesystem with ordered data mode.
output of lshw -class disk -class volume

Code:
 lshw -class disk -class volume
  *-disk:0
       description: ATA Disk
       product: WDC WD10EACS-00Z
       vendor: Western Digital
       physical id: 0
       bus info: scsi@2:0.0.0
       logical name: /dev/sdc
       version: 01.0
       serial: WD-WCASJ0732776
       size: 931GiB (1TB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=000c0b96
     *-volume
          description: Linux LVM Physical Volume partition
          physical id: 1
          bus info: scsi@2:0.0.0,1
          logical name: /dev/sdc1
          serial: Y2ZtLn-PiyM-wiVm-fPdS-0G69-Ig3C-D0xT3u
          size: 931GiB
          capacity: 931GiB
          capabilities: primary multi lvm2
  *-disk:1
       description: ATA Disk
       product: WDC WD10EACS-00Z
       vendor: Western Digital
       physical id: 1
       bus info: scsi@3:0.0.0
       logical name: /dev/sdd
       version: 01.0
       serial: WD-WCASJ1774844
       size: 931GiB (1TB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=000e85c9
     *-volume
          description: Linux LVM Physical Volume partition
          physical id: 1
          bus info: scsi@3:0.0.0,1
          logical name: /dev/sdd1
          capacity: 931GiB
          capabilities: primary multi
  *-disk:0
       description: ATA Disk
       product: SAMSUNG HM320JI
       physical id: 0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: 2SS0
       serial: S16LJ90S719567
       size: 298GiB (320GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=95c56198
     *-volume:0
          description: EXT3 volume
          vendor: Linux
          physical id: 1
          bus info: scsi@0:0.0.0,1
          logical name: /dev/sda1
          logical name: /boot
          version: 1.0
          serial: 2fcf089f-9982-4492-b55b-6abbe133685b
          size: 101MiB
          capacity: 101MiB
          capabilities: primary bootable journaled extended_attributes ext3 ext2 initialized
          configuration: created=2011-12-04 14:36:39 filesystem=ext3 label=/boot1 modified=2011-12-05 20:12:58 mount.fstype=ext3 mount.options=rw,data=ordered mounted=2011-12-04 20:52:41 state=mounted
     *-volume:1
          description: EXT3 volume
          vendor: Linux
          physical id: 2
          bus info: scsi@0:0.0.0,2
          logical name: /dev/sda2
          logical name: /
          version: 1.0
          serial: fbf05a5a-1db1-4f9a-9299-49d022385d18
          size: 97GiB
          capacity: 97GiB
          capabilities: primary journaled extended_attributes large_files recover ext3 ext2 initialized
          configuration: created=2011-12-04 14:32:19 filesystem=ext3 label=/1 modified=2011-12-05 20:20:16 mount.fstype=ext3 mount.options=rw,data=ordered mounted=2011-12-05 20:20:16 state=mounted
     *-volume:2
          description: Linux swap volume
          physical id: 3
          bus info: scsi@0:0.0.0,3
          logical name: /dev/sda3
          version: 1
          size: 2000MiB
          capacity: 2000MiB
          capabilities: primary nofs swap initialized
          configuration: filesystem=swap label=SWAP-sda3 pagesize=4096
     *-volume:3
          description: Extended partition
          physical id: 4
          bus info: scsi@0:0.0.0,4
          logical name: /dev/sda4
          size: 198GiB
          capacity: 198GiB
          capabilities: primary extended partitioned partitioned:extended
        *-logicalvolume
             description: Linux filesystem partition
             physical id: 5
             logical name: /dev/sda5
             logical name: /var/flexshare/shares
             capacity: 198GiB
             configuration: mount.fstype=ext3 mount.options=rw,data=ordered state=mounted
  *-disk:1
       description: ATA Disk
       product: Hitachi HDT72505
       vendor: Hitachi
       physical id: 1
       bus info: scsi@1:0.0.0
       logical name: /dev/sdb
       version: V56O
       serial: VFB400R4CUM7EA
       size: 465GiB (500GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=00026cb9
     *-volume
          description: Linux LVM Physical Volume partition
          physical id: 1
          bus info: scsi@1:0.0.0,1
          logical name: /dev/sdb1
          capacity: 465GiB
          capabilities: primary bootable multi
It's about the two Western Digital's. This is the LVM partition with the problem. I used this two drives with ClearOS 5.2 / CentOS. I just moved this two drives to a new install.

If i check the output of lshw i see that i miss the "volume serial" of the disk WD-WCASJ1774844. I suppose this is the problem. Correctly?
 
Old 12-06-2011, 06:54 AM   #4
_bsd
Member
 
Registered: Jan 2010
Location: Velveeta, USA
Distribution: Xen, Gentoo,Ubuntu,openSUSE,Debian,pfSense
Posts: 98

Rep: Reputation: 8
It appears that your second volume is missing its UUID.
Somehow, when moving/installing your disk, data may have been written to the drive.

Luckily, you have a backup of the data, right?

The pvcreate command initializes the disk and writes the UUID.

If you're using a complete device as a PV (recommended) you wouldn't have a partition table, then pvcreate would initialize the first two blocks of a device.
If a disk's first block is accidentily overwritten, for example by partitioning, then it's easy to recover/restore the missing UUID.

Since you're creating your physical devices in a partition, I'm not sure what could have touched that, so you may have more than the LVM label missing.

Regardless, if it's the former, the disk's LVM label was clobbered, you can restore this by recreating the PV with the --uuid switch and specifying the missing UUID zlSlGO-0Rgk-I9EJ-Qc5H-8L9o-d6tQ-325x9y

Code:
pvcreate --uuid zlSlGO-0Rgk-I9EJ-Qc5H-8L9o-d6tQ-325x9y /dev/sdd1
Ignore most of the output, except for the last line, which should read
Physical volume "/dev/sdd1" successfully created

After recreating the PV UUID your volume group will still be inactive and you'll have to reactivate with
Code:
vgchange -ay backup
Please read my comments carefully, re-read your error.
Make certain on your own that I've got the correct missing UUID and associated device/partition.
Do NOT execute these commands without reading through and verifying the commands I've given.

Do you have any idea what may have touched your partition? Clearly data is missing.
 
Old 12-06-2011, 02:30 PM   #5
marcelvl
LQ Newbie
 
Registered: Feb 2010
Posts: 9

Original Poster
Rep: Reputation: 0
I'll verified your commands and it looks alright to me. So i'll executed the command "pvcreate --uuid zlSlGO-0Rgk-I9EJ-Qc5H-8L9o-d6tQ-325x9y /dev/sdd1" I'll get the following output.

Code:
pvcreate --uuid zlSlGO-0Rgk-I9EJ-Qc5H-8L9o-d6tQ-325x9y /dev/sdd1
  --restorefile is required with --uuid
  Run `pvcreate --help' for more information.
So it's complaining about a restore file. Not a good sign i suppose.

I'll use two complete device's to create the physical volume's and the created a volume group. After that i'll created the logical volume what has the total size of the volume group. I'll must admit i'm a beginner with LVM. I'll use Linux for 4 years now but i'll have lot's too learn.

About the backup i don't have a complete one. It's my library with ripped compact disc's. I have a part of that library on my desktop pc but not everything.

What's happened to my data? I've haven't the slightest idea...
 
Old 12-06-2011, 03:57 PM   #6
_bsd
Member
 
Registered: Jan 2010
Location: Velveeta, USA
Distribution: Xen, Gentoo,Ubuntu,openSUSE,Debian,pfSense
Posts: 98

Rep: Reputation: 8
The restorefile is located in /etc/lvm/backup, which is where LVM stores backups of metadata.

Since your VG was named backup the restore file should be named /etc/lvm/backup/backup

I don't believe this should have been required if only one PV was dropped.
Me thinks you may have installed something and clobbered more than metadata.

I hope you have a complete system backup, but try again specifying the restorefile of /etc/lvm/backup/backup

Last edited by _bsd; 12-06-2011 at 04:00 PM.
 
Old 12-08-2011, 04:40 PM   #7
marcelvl
LQ Newbie
 
Registered: Feb 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Pfff... i need more time for my hobby!

So i could restore the LVM partition with the restorefile. After that i could mount the LVM partition. The partition has two directories. One directory was okay and i copied it to a other location but the other directory is corrupt. See this:

Code:
 ls -al
total 39811145
drwxr-xr-x     5 root       root         147456 Dec  2 13:44 .
drwxr-xr-x     4 root       root           4096 Dec  7 18:40 ..
?rwsr-S-w- 64464 3713606668 771745210 483393376 Sep 19  1981 Music
drwxr-xr-x   893 root       root          61440 Dec  2 13:14 Compact-disc
drwx------     2 root       root          16384 Dec  1 20:15 lost+found
The directory Music is also marked red.

There is certainly happened something to that LVM partition. I think i screw up trying to restore it. Is it possible to solve this error? I'm thankful for your help _bsd.

Last edited by marcelvl; 12-08-2011 at 04:42 PM.
 
Old 12-08-2011, 06:48 PM   #8
_bsd
Member
 
Registered: Jan 2010
Location: Velveeta, USA
Distribution: Xen, Gentoo,Ubuntu,openSUSE,Debian,pfSense
Posts: 98

Rep: Reputation: 8
If you don't have a backup, or any other source I suggest searching the net for commercial data recovery software. There are some very affordable, shareware style recovery apps, that do a fairly decent job. I've had good luck with this one
I "lost" some files and it found them, though it did not recover the name.
It also cannot recover "in place" so you need another disk to copy the recovered files to.

You will have much better luck recovering data if you only overwrite the filesystem metadata, the recovery software will scan block by block and look for file data.

Good luck.

Last edited by _bsd; 12-08-2011 at 06:51 PM.
 
  


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
Moved system files and system crashed soofi Linux - Newbie 4 02-03-2011 12:42 AM
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 01:59 AM
Invalid partition table for swap partition that I moved with Gparted keith9e Linux - Hardware 16 02-10-2010 01:21 PM
Copy Contents of LVM Partition to Another Partition With a Different File System tmort Linux - General 3 03-07-2008 06:00 AM
cloning partition (using dd) also clones file system errors? Thoddy Linux - General 4 08-31-2007 03:37 AM


All times are GMT -5. The time now is 04:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration