PDA

View Full Version : mount lvm from rescue?


daviddoria
2008-05-09, 07:19 AM CDT
I booted to rescue mode of the install cd. Then I ran
lvm vgscan

and it tells me "Reading all physical volumes. This may take a while..."

And goes back to a prompt without telling me anything. To make sure it didn't find anything i ran
lvm vgdisplay

and indeed nothing was displayed.

How can I mount my drive so I can get the data off??

Thanks!

Dave

surkum
2008-05-09, 09:05 AM CDT
Give try to a fedora live cd, It comes with system-config-lvm.

enter77
2008-05-09, 09:33 AM CDT
Try a vgchange -a y [group name] to activate the volume group first.

daviddoria
2008-05-09, 09:36 AM CDT
so assuming I didn't know it was called VolGrouop00 - which command would I have run to "see" it before trying to activate it with vgchange -a

brunson
2008-05-09, 09:56 AM CDT
ebrunsonlx(~)$ sudo lvs
Password:
LV VG Attr LSize Origin Snap% Move Log Copy%
LogVol00 VolGroup00 -wi-ao 35.28G
LogVol01 VolGroup00 -wi-ao 1.94G
For a brief summary of the commands available you can do this:
ebrunsonlx(~)$ lvm
lvm> help
Available lvm commands:
Use 'lvm help <command>' for more information

dumpconfig Dump active configuration
formats List available metadata formats
help Display help for commands
lvchange Change the attributes of logical volume(s)
lvconvert Change logical volume layout
lvcreate Create a logical volume
lvdisplay Display information about a logical volume
lvextend Add space to a logical volume
lvmchange With the device mapper, this is obsolete and does nothing.
lvmdiskscan List devices that may be used as physical volumes
lvmsadc Collect activity data
lvmsar Create activity report
lvreduce Reduce the size of a logical volume
lvremove Remove logical volume(s) from the system
lvrename Rename a logical volume
lvresize Resize a logical volume
lvs Display information about logical volumes
lvscan List all logical volumes in all volume groups
pvchange Change attributes of physical volume(s)
pvresize Resize physical volume(s)
pvck Check the consistency of physical volume(s)
pvcreate Initialize physical volume(s) for use by LVM
pvdata Display the on-disk metadata for physical volume(s)
pvdisplay Display various attributes of physical volume(s)
pvmove Move extents from one physical volume to another
pvremove Remove LVM label(s) from physical volume(s)
pvs Display information about physical volumes
pvscan List all physical volumes
segtypes List available segment types
vgcfgbackup Backup volume group configuration(s)
vgcfgrestore Restore volume group configuration
vgchange Change volume group attributes
vgck Check the consistency of volume group(s)
vgconvert Change volume group metadata format
vgcreate Create a volume group
vgdisplay Display volume group information
vgexport Unregister volume group(s) from the system
vgextend Add physical volumes to a volume group
vgimport Register exported volume group with system
vgmerge Merge volume groups
vgmknodes Create the special files for volume group devices in /dev
vgreduce Remove physical volume(s) from a volume group
vgremove Remove volume group(s)
vgrename Rename a volume group
vgs Display information about volume groups
vgscan Search for all volume groups
vgsplit Move physical volumes into a new volume group
version Display software and driver version information

surkum
2008-05-09, 11:23 AM CDT
/sbin/lvm vgchange -a y --ignorelockingfailure , from /etc/rc.sysinit so I think it should work.

daviddoria
2008-05-10, 06:52 AM CDT
the problem is still that

lvm lvs

doesn't show anything. And then hence

lvm vgchange

doesn't do anything.

Any other thoughts?

daviddoria
2008-05-10, 10:33 AM CDT
so i think somehow when i was in rescue mode messing with lvm i messed up the lvm setup. Now i have booted a live-cd and run system-config-lvm and lvm doesn't seem to be setup at all. Is all hope lost? Or is there some way I can mount the drive and get some data off?

Thanks,

Dave

surkum
2008-05-10, 10:52 AM CDT
I don't know for sure, but my experience tells me that messing with an lvm vg don't ends in good port. Lvm stores lv configuration into the vg, if you have messed up your vg is almost as lossing your partition table, take a look at this http://www.linuxjournal.com/article/8874 , perhaps it would help you.

another http://codeworks.gnomedia.com/archives/2005/general/lvm_recovery/ .

daviddoria
2008-05-11, 11:15 AM CDT
ahhh great - i haven't tried it yet but the dd command in the first link to read the "lvm table" at the beginning of the disk seems like it may be what i was looking for!

also, the second link doesn't seem to work for me..?

Thanks!

Dave

surkum
2008-05-11, 01:24 PM CDT
seems the site has just passed by, try google cache.

daviddoria
2008-05-12, 06:02 AM CDT
The only plain text I see when I do
sudo dd if=/dev/sdc bs=512 count=255 skip=1 of=/home/dave/Desktop/lvm.tmp

is

GRUB loading, please wait...
^@internal error: the second sector of Stage 2 is unknown

surkum
2008-05-12, 06:24 AM CDT
actualy you should see nothing after issuing that command :),

well the interesting info is after that.. try:

sudo dd if=/dev/sdc bs=512 count=255 skip=1 of=/home/dave/Desktop/lvm.tmp

strings /home/dave/Desktop/lvm.tmp > /home/dave/Desktop/lvm.tmp.txt

cat /home/dave/Desktop/lvm.tmp.txt

the information you ar looking if right after : internal.... and begins with LABELONE
LVM2

daviddoria
2008-05-12, 06:43 AM CDT
haha of course i didn't see anything right away - i meant when i looked in the file lol

but i still don't see "internal..." - here is the entire output:


[dave@davedesktop Desktop]$ strings lvm.tmp
pPf1
Loading stage1.5
Geom
Read
Error
0.97
/boot/grub/stage2 /boot/grub/menu.lst
^_[]
t<<%t
_t 9u
[^_]
[^_]
[^_]
8WEV
[^_]
PARTu==EFI u6
[^_]
F(+F @
[^_]
8WEV
[^_]
Yteh
[^_]
[^_]
WVSSS
[^_]
[^_]
[^_]
tejR
[^_]
Error %u
ext2fs
GRUB loading, please wait...
internal error: the second sector of Stage 2 is unknown.
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
&tevU
E(cF
iVS,j
beIn
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
2$8)
KZ}{
p-I)
u".Cw
f(TX
/boot

surkum
2008-05-13, 01:33 AM CDT
well that means the lvm header config is overwriten in the disk (it seem to me like a format pattern or the like your output)... bad luck, are you sure that the vg was on that disk?

daviddoria
2008-05-13, 05:44 AM CDT
yea, there was only one disk! haha

At this point I am prepared to give up the data - but it may be a good exercise in case I ever have a similar problem with important data. Is there no way to do a more "raw" mount and just see what is on the disk?