LinuxQuestions.org
Review your favorite Linux distribution.
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 02-19-2005, 11:33 AM   #1
idris
LQ Newbie
 
Registered: Sep 2004
Distribution: Debian Sarge
Posts: 5

Rep: Reputation: 0
unknown device with lvm


I had a working LVM setup with two physical volumes (entire disks) in one volume group, and a separate system disk. Then the processor died and I had to change it and the motherboard, and in the process the lvm disks had to be moved from hde and hdf to hdc and hdd. Shouldn't be a problem, right?

However, now pvscan doesn't find /dev/hdd correctly but calls it an unknown device, and
all lvm tools complain about not finding its uuid:

indigo:~# vgscan
Reading all physical volumes. This may take a while...
Couldn't find device with uuid 'p4YzIv-Ntiq-NxPo-J4tw-UDXF-4w4V-FiXqLl'.
Couldn't find all physical volumes for volume group storage.
Volume group "storage" not found
indigo:~# pvscan
Couldn't find device with uuid 'p4YzIv-Ntiq-NxPo-J4tw-UDXF-4w4V-FiXqLl'.
PV unknown device VG storage lvm2 [233.72 GB / 0 free]
PV /dev/hdc VG storage lvm2 [233.75 GB / 768.00 MB free]
Total: 2 [467.47 GB] / in use: 2 [467.47 GB] / in no VG: 0 [0 ]


Attempting to fix this, I did something rather stupid: I created a new physical volume on /dev/hdd with pvcreate -ff, and now pvdisplay returns three entries:


indigo:~# pvdisplay
Couldn't find device with uuid 'p4YzIv-Ntiq-NxPo-J4tw-UDXF-4w4V-FiXqLl'.
--- Physical volume ---
PV Name unknown device
VG Name storage
PV Size 233.72 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 7479
Free PE 0
Allocated PE 7479
PV UUID p4YzIv-Ntiq-NxPo-J4tw-UDXF-4w4V-FiXqLl

--- Physical volume ---
PV Name /dev/hdc
VG Name storage
PV Size 233.75 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 7480
Free PE 24
Allocated PE 7456
PV UUID 7DNebf-aFtA-7bCq-ywZq-qJ32-DAj8-UU6hK5

--- NEW Physical volume ---
PV Name /dev/hdd
VG Name
PV Size 233.76 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 0deIQh-yFLO-KEb2-zn06-7fee-uKmY-UrYlRg



Please, is there's any way to fix this? I'm afraid of tinkering with
it more without knowing what I'm doing since I'd really rather not lose the
data (it's only partially backed up...)

Idris in trouble
 
Old 02-21-2005, 02:54 PM   #2
idris
LQ Newbie
 
Registered: Sep 2004
Distribution: Debian Sarge
Posts: 5

Original Poster
Rep: Reputation: 0
Please, does anyone have any pointers on how to proceed? I'd really really appreciate it (can you tell I'm getting desperate)

Idris
 
Old 05-28-2005, 10:22 AM   #3
ManishChopra
LQ Newbie
 
Registered: May 2005
Location: Bangalore, India
Distribution: RHEL 3
Posts: 1

Rep: Reputation: 0
Red face LVM Problem (related to pvcreate only)

This is somewhat related to what Idris has gone thru but is relatively a simpler problem than his. Well for Idris, its a long gone problems, and if is'nt able to add these volumes to any other VG, then bad luck.

I have a small query on LVM's pvcreate command, if anyone might have an idea on it.

Can we undo the change caused by command pvcreate /dev/hda8 that was a Win 32 FAT partition, in order to get back the lost information ?

Originally this command was intended to be as :

[root@localhost]# pvcreate /dev/hdb8

However, it was a typo mistake that the command got executed on /dev/hda8, and that was a windows logical partition. The drive can be seen on windows, but does not show any information stored on it.

--------------------
Error displayed as :

G:\is not accessible

A device attached to the system is not functioning.

---------------------------------------------------

pvcreate has initialized /dev/hda8 as a physical volume, and I want to know if it can be un-done.

I have gone through all other related commands on LVM, but none seem to help me in this case.

e2fsadm(8), lvchange(8), lvcreate(8), lvdisplay(8),
lvextend(8), lvmchange(8), lvmdiskscan(8),
lvmcreate_initrd(8), lvmsadc(8), lvmsar(8),
lvreduce(8), lvremove(8), lvrename(8),
lvscan(8), pvchange(8), pvcreate(8), pvdata(8),
pvdisplay(8), pvmove(8), pvscan(8), vgcfgbackup(8),
vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8),
vgrename(8), vgscan(8), vgsplit(8)

From the above commands, pvmove is'nt an option on RHEL 3, hence no good.

If there are any workaround on this problem, please suggest me the way to resolve it, and get the contents of Win32 FAT partition.

Warm regards,

Manish Chopra
(Homepage www.TechTheRightWay.net)

(Formerly with IBM, for their technical support center, and currently researching on technology trends and scenarios changing the IT landscape. Have also appeared for RHCE exam today, without a pass.)

PS. Please help get the open source stabilized and standardized
 
Old 06-20-2005, 10:59 PM   #4
Golovko
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 9
Posts: 23

Rep: Reputation: 15
Missing drives in a volume group have caused me a lot of problems. If you just want to excommunicate the drive from your vg, the following works:

vgreduce --removemissing vg00

where vg00 is your vg. Of course this doesn't solve the problem of recovering any data on the pv you are removing.

Gol
 
Old 07-09-2007, 02:24 AM   #5
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 10.04
Posts: 198

Rep: Reputation: 33
Quote:
Missing drives in a volume group have caused me a lot of problems. If you just want to excommunicate the drive from your vg, the following works:

vgreduce --removemissing vg00
I'm now testing LVM-Mirror on CentOS4.5, and the package is lvm2-2.02.21. First, make /dev/sdf and /dev/sdg as pv, then build vg(named milan) across these two PVs. Create LVM-moirror by executing the following command:
Code:
# pvscan
  PV /dev/sdf   VG milan    lvm2 [30.00 GB / 29.90 GB free]
  PV /dev/sdg   VG milan    lvm2 [30.00 GB / 29.90 GB free]

# vgdisplay
  --- Volume group ---
  VG Name               milan
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               59.99 GB
  PE Size               4.00 MB
  Total PE              15358
  Alloc PE / Size       50 / 200.00 MB
  Free  PE / Size       15308 / 59.80 GB
  VG UUID               j0SkJN-5Y2A-PFm2-UJOA-srXO-DImb-fk3kUy

# lvcreate -L 100M -m1 -n mirror milan
# gfs_mkfs -p lock_dlm -t my_cluster:gfs -J 32M -j 2 /dev/milan/mirror
# mount -t gfs -o acl /dev/milan/mirror /mnt
# dd if=/dev/zero of=/mnt/1.iso bs=1M count=100
There will be creating 1.iso on the /dev/milan/mirror, What I want to do is verify the mirror function when one leg(underlying PV) crashes. Hence, I deactivate the lv(# lvchagne -an /dev/milan/mirror) first and destory the PV /dev/sdg by "mkfs.ext3 /dev/sdg".
Code:
# pvscan
  Couldn't find device with uuid 'pQMQJ3-Rq3M-kQD9-M6DB-UWLi-Dyk4-3pWoa7'.
  Couldn't find device with uuid 'pQMQJ3-Rq3M-kQD9-M6DB-UWLi-Dyk4-3pWoa7'.
  PV unknown device   VG milan    lvm2 [30.00 GB / 29.90 GB free]
  PV /dev/sdg         VG milan    lvm2 [30.00 GB / 29.90 GB free]

# vgscan
  Reading all physical volumes.  This may take a while...
  Couldn't find device with uuid 'pQMQJ3-Rq3M-kQD9-M6DB-UWLi-Dyk4-3pWoa7'.
  Couldn't find all physical volumes for volume group milan.
  Couldn't find device with uuid 'pQMQJ3-Rq3M-kQD9-M6DB-UWLi-Dyk4-3pWoa7'.
  Couldn't find all physical volumes for volume group milan.
  Volume group "milan" not found

# lvscan
  Couldn't find device with uuid 'pQMQJ3-Rq3M-kQD9-M6DB-UWLi-Dyk4-3pWoa7'.
  Couldn't find all physical volumes for volume group milan.
  Couldn't find device with uuid 'pQMQJ3-Rq3M-kQD9-M6DB-UWLi-Dyk4-3pWoa7'.
  Couldn't find all physical volumes for volume group milan.
  Volume group "milan" not found
As Golovko's comments, "vgreduce --removemissing milan" resolves the complains caused by lossing uuid. Activate the lv again:
Code:
# lvchange -ay /dev/milan/mirror

# pvscan
  PV /dev/sdf   VG milan    lvm2 [30.00 GB / 29.90 GB free]

# lvscan
  ACTIVE            '/dev/milan/mirror' [100.00 MB] inherit

# vgdisplay
--- Volume group ---
  VG Name               milan
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  12
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               30.00 GB
  PE Size               4.00 MB
  Total PE              7679
  Alloc PE / Size       25 / 100.00 MB
  Free  PE / Size       7654 / 29.90 GB
  VG UUID               j0SkJN-5Y2A-PFm2-UJOA-srXO-DImb-fk3kUy
Yes, "vgdisplay" shows there's only a Current PV, and it is really the another leg identified during creating LVM mirror:
Code:
# pvs -a
/dev/sdf     milan  lvm2 a-    30.00G 29.90G
mount this lv and find the 1.iso still exists, it indicates the mirror function runs well and the left lv is linear.


Hope this helpful when you meet the same issue.

Phillip

Last edited by PhillipHuang; 07-09-2007 at 02:26 AM.
 
  


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
Unknown Device?! muppski Linux - Hardware 2 06-03-2005 04:10 AM
LVM problems, device-mapper missing dworkin Linux - Newbie 3 03-22-2004 05:54 PM
unknown device speedyhot Linux - General 1 03-05-2004 02:39 PM
lvm 2 device-mapper Kroenecker Linux - Newbie 4 12-29-2003 12:19 PM
LVM and device-mapper instalation- Help zick Linux - General 0 10-29-2003 11:56 PM


All times are GMT -5. The time now is 03:00 PM.

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