FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 01-08-2011, 08:50 PM
Lamar Owen
 
Default LiveCD System recovery - Mounting LVM?

On Saturday, January 08, 2011 04:27:39 pm Johan Martinez wrote:

> Now I am booting of CentOS live cd for system restore. I recreated
> partitions like previous system using fdisk and then used dd to dump all the
> data onto it. I would like to mount sda2 as LVM, but I don't know how to do
> that. Any steps or howto mount LVM manually would be really helpful. I think
> I can recover the system once I am able to access sda1 and sda2. Any help?

pvscan
vgscan
vgchange -ay
lvscan

(It has been awhile since I have done this; I know the vgchange -ay is required, but I don't recall if pvscan and lvscan were required or if I just used them for information....but I do think the vgscan was required.)

In the lvscan output you should see the logical volumes; mount to the desired mountpoint with
mount /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT

Or you can reboot the CentOS disk in rescue mode and have it find your system as part of its bootup. In that case your system will be mounted under /mnt/sysimage and you can do a 'chroot /mnt/sysimage' and essentially get a command line inside that system.

Hope that helps.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-08-2011, 10:03 PM
Robert Heller
 
Default LiveCD System recovery - Mounting LVM?

At Sat, 8 Jan 2011 15:27:39 -0600 CentOS mailing list <centos@centos.org> wrote:

>
>
>
> Hi,
>
> I am trying to recover data from my old system which had LVM. The disk had
> two partitions - /dev/sda1 (boot, Linux) and /dev/sda2 (Linux LVM). I had
> taken a backup of both partitions using dd.
>
> Now I am booting of CentOS live cd for system restore. I recreated
> partitions like previous system using fdisk and then used dd to dump all the
> data onto it. I would like to mount sda2 as LVM, but I don't know how to do
> that. Any steps or howto mount LVM manually would be really helpful. I think
> I can recover the system once I am able to access sda1 and sda2. Any help?

You will need to do a vgscan to scan for the LVM volumn you created.
Once scanned, you can then mount the file system(s) there, either using
the mapper files (/dev/mapper/volumegroup-volumn) or the mount labels
(LABEL=label). If this was a stock CentOS install, the root file system
will be labeled '/' and the /boot file system will be labeled '/boot':

mkdir /mnt/sysimage
mount -v LABEL=/ /mnt/sysimage
mount -v LABEL=/boot /mnt/sysimage/boot


>
> jM.
>
> MIME-Version: 1.0
>
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>

--
Robert Heller -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software -- http://www.deepsoft.com/
() ascii ribbon campaign -- against html e-mail
/ www.asciiribbon.org -- against proprietary attachments



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-09-2011, 12:17 AM
Johan Martinez
 
Default LiveCD System recovery - Mounting LVM?

On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen <lowen@pari.edu> wrote:

On Saturday, January 08, 2011 04:27:39 pm Johan Martinez wrote:



> Now I am booting of CentOS live cd for system restore. I recreated

> partitions like previous system using fdisk and then used dd to dump all the

> data onto it. I would like to mount sda2 as LVM, but I don't know how to do

> that. Any steps or howto mount LVM manually would be really helpful. I think

> I can recover the system once I am able to access sda1 and sda2. Any help?



pvscan

vgscan

vgchange -ay

lvscan



(It has been awhile since I have done this; I know the vgchange -ay is required, but I don't recall if pvscan and lvscan were required or if I just used them for information....but I do think the vgscan was required.)




In the lvscan output you should see the logical volumes; mount to the desired mountpoint with

mount */dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT



Or you can reboot the CentOS disk in rescue mode and have it find your system as part of its bootup. *In that case your system will be mounted under /mnt/sysimage and you can do a 'chroot /mnt/sysimage' and essentially get a command line inside that system.




Hope that helps.

_______________________________________________

CentOS mailing list

CentOS@centos.org

http://lists.centos.org/mailman/listinfo/centos



Thanks for the reply Lamar and Robert.*
I had tried pvscan and vgscan before sending out my first mail,*but it didn't show up any physical volumes and vol grpups.*

I didn't do lvscan though.*
I will try again and see how it goes.*
jM.*

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-11-2011, 04:49 PM
Johan Martinez
 
Default LiveCD System recovery - Mounting LVM?

On Sat, Jan 8, 2011 at 7:17 PM, Johan Martinez <jmartiee@gmail.com> wrote:



On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen <lowen@pari.edu> wrote:


On Saturday, January 08, 2011 04:27:39 pm Johan Martinez wrote:



> Now I am booting of CentOS live cd for system restore. I recreated

> partitions like previous system using fdisk and then used dd to dump all the

> data onto it. I would like to mount sda2 as LVM, but I don't know how to do

> that. Any steps or howto mount LVM manually would be really helpful. I think

> I can recover the system once I am able to access sda1 and sda2. Any help?



pvscan

vgscan

vgchange -ay

lvscan



(It has been awhile since I have done this; I know the vgchange -ay is required, but I don't recall if pvscan and lvscan were required or if I just used them for information....but I do think the vgscan was required.)





In the lvscan output you should see the logical volumes; mount to the desired mountpoint with

mount */dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT



Or you can reboot the CentOS disk in rescue mode and have it find your system as part of its bootup. *In that case your system will be mounted under /mnt/sysimage and you can do a 'chroot /mnt/sysimage' and essentially get a command line inside that system.





Hope that helps.

_______________________________________________

CentOS mailing list

CentOS@centos.org

http://lists.centos.org/mailman/listinfo/centos



Thanks for the reply Lamar and Robert.*
I had tried pvscan and vgscan before sending out my first mail,*but it didn't show up any physical volumes and vol grpups.*


I didn't do lvscan though.*
I will try again and see how it goes.*
jM.*


I can see PVs sda1 and sda2 with pvscan, but they are not getting mounted as lvm. Also, I see sda2 listed as LVM although I didn't partition it that way. e.g. fdisk shows it as Linux type and pvscan is showing it as lvm2. That's somewhat confusing me.*

Also, the real problem for me is recovery. I don't see LVM mounted after doing vgscan and lvscan. Am I missing something here? Any help?
Thanks you..jM


*

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-11-2011, 05:47 PM
Kwan Lowe
 
Default LiveCD System recovery - Mounting LVM?

On Sat, Jan 8, 2011 at 4:27 PM, Johan Martinez <jmartiee@gmail.com> wrote:
> Hi,
> I am trying to recover data from my old system which had LVM. The disk had
> two partitions - /dev/sda1 (boot, Linux) and /dev/sda2 (Linux LVM).*I had
> taken a backup of both partitions using dd.
> Now I am booting of CentOS live cd for system restore. I recreated
> partitions like previous system using fdisk and then used dd to dump all the
> data onto it. I would like to mount sda2 as LVM, but I don't know how to do
> that. Any steps or howto mount LVM manually would be really helpful. I think
> I can recover the system once I am able to access sda1 and sda2. Any help?
> jM.

Once you do the pvscan and vgscan, then vgchange, you should have the
LVs available in /dev/VGNAME/LVNAME. For example, if your volume
group name is VolGroup00, the LVs will be /dev/VolGroup00/lv001, etc..

Keep in mind that you are not mounting sda2 in this case but rather
the LVs associated with the VG associated with the PV on sda2.

For example:
pvscan
vgscan
vgchange -ay VolGroup00
mkdir /mnt/tmp1
mount /dev/VolGroup00/lv01 /mnt/tmp1


Also note that in some cases the lvm tools must be called by
specifying lvm before the command

lvm pvscan
lvm vgchange -ay VolGroup00

etc..
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-11-2011, 07:46 PM
Lamar Owen
 
Default LiveCD System recovery - Mounting LVM?

On Tuesday, January 11, 2011 01:47:54 pm Kwan Lowe wrote:
> Also note that in some cases the lvm tools must be called by
> specifying lvm before the command
>
> lvm pvscan
> lvm vgchange -ay VolGroup00

To have in the archive, note that this is the case in the dracut shell (accessed at boot on error if the RDSHELL argument is passed) that should be in C6 (as it's in F12 and later). Having the RDSHELL boot argument is very nice, as if you get error during boot that won't even allow single user mode (things like can't find root device, or a module failed to load, etc) you can get a rudimentary shell in the initial ramdisk environment.

See http://fedoraproject.org/wiki/How_to_debug_Dracut_problems for a lot more info.

Having said that, I've not tried on a live EL6 system as yet, so YMMV, of course.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 11:38 PM
"Gregory P.. Ennis"
 
Default LiveCD System recovery - Mounting LVM?

On Sat, Jan 8, 2011 at 7:17 PM, Johan Martinez <jmartiee@gmail.com>

wrote:



On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen <lowen@pari.edu>
wrote:
On Saturday, January 08, 2011 04:27:39 pm Johan Martinez
wrote:

> Now I am booting of CentOS live cd for system restore.
I recreated
> partitions like previous system using fdisk and then
used dd to dump all the
> data onto it. I would like to mount sda2 as LVM, but I
don't know how to do
> that. Any steps or howto mount LVM manually would be
really helpful. I think
> I can recover the system once I am able to access sda1
and sda2. Any help?


pvscan
vgscan
vgchange -ay
lvscan

(It has been awhile since I have done this; I know the
vgchange -ay is required, but I don't recall if pvscan
and lvscan were required or if I just used them for
information....but I do think the vgscan was required.)

In the lvscan output you should see the logical volumes;
mount to the desired mountpoint with
mount /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT

Or you can reboot the CentOS disk in rescue mode and
have it find your system as part of its bootup. In that
case your system will be mounted under /mnt/sysimage and
you can do a 'chroot /mnt/sysimage' and essentially get
a command line inside that system.

Hope that helps.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos



Thanks for the reply Lamar and Robert.


I had tried pvscan and vgscan before sending out my first
mail, but it didn't show up any physical volumes and vol
grpups.


I didn't do lvscan though.


I will try again and see how it goes.


jM.




I can see PVs sda1 and sda2 with pvscan, but they are not getting
mounted as lvm. Also, I see sda2 listed as LVM although I didn't
partition it that way. e.g. fdisk shows it as Linux type and pvscan is
showing it as lvm2. That's somewhat confusing me.


Also, the real problem for me is recovery. I don't see LVM mounted after
doing vgscan and lvscan. Am I missing something here? Any help?


Thanks you..
jM

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

Johan,

I have the same circumstance, and have not been able to mount an lvm
volume to a new machine. I have your posts, but have not been able to
mount the lvm either. Did you ever get this resolved? Sure would
appreciate your thoughts, or any one else that has been able to do this.

Greg

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2011, 12:50 AM
"Gregory P.. Ennis"
 
Default LiveCD System recovery - Mounting LVM?

On Sat, Jan 8, 2011 at 7:17 PM, Johan Martinez <jmartiee@gmail.com>

wrote:



On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen <lowen@pari.edu>
wrote:
On Saturday, January 08, 2011 04:27:39 pm Johan Martinez
wrote:

> Now I am booting of CentOS live cd for system restore.
I recreated
> partitions like previous system using fdisk and then
used dd to dump all the
> data onto it. I would like to mount sda2 as LVM, but I
don't know how to do
> that. Any steps or howto mount LVM manually would be
really helpful. I think
> I can recover the system once I am able to access sda1
and sda2. Any help?


pvscan
vgscan
vgchange -ay
lvscan

(It has been awhile since I have done this; I know the
vgchange -ay is required, but I don't recall if pvscan
and lvscan were required or if I just used them for
information....but I do think the vgscan was required.)

In the lvscan output you should see the logical volumes;
mount to the desired mountpoint with
mount /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT

Or you can reboot the CentOS disk in rescue mode and
have it find your system as part of its bootup. In that
case your system will be mounted under /mnt/sysimage and
you can do a 'chroot /mnt/sysimage' and essentially get
a command line inside that system.

Hope that helps.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos



Thanks for the reply Lamar and Robert.


I had tried pvscan and vgscan before sending out my first
mail, but it didn't show up any physical volumes and vol
grpups.


I didn't do lvscan though.


I will try again and see how it goes.


jM.




I can see PVs sda1 and sda2 with pvscan, but they are not getting
mounted as lvm. Also, I see sda2 listed as LVM although I didn't
partition it that way. e.g. fdisk shows it as Linux type and pvscan is
showing it as lvm2. That's somewhat confusing me.


Also, the real problem for me is recovery. I don't see LVM mounted after
doing vgscan and lvscan. Am I missing something here? Any help?


Thanks you..
jM

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

Johan,

I have the same circumstance, and have not been able to mount an lvm
volume to a new machine. I have your posts, but have not been able to
mount the lvm either. Did you ever get this resolved? Sure would
appreciate your thoughts, or any one else that has been able to do this.

Greg
-------------------------------------------
Johan,

I am not sure if this is your problem but what I can determine is that
there may be a conflict with the same names of the lvm volumes; ie the
old volume that I am trying to mount has the same name as the volume on
the machine that is active.

[root@SeVi mnt]# pvscan
PV /dev/hdc2 VG VolGroup00 lvm2 [37.16 GB / 0 free]
PV /dev/hdd1 VG VolGroup00 lvm2 [186.28 GB / 0 free]
PV /dev/sda2 VG VolGroup00 lvm2 [931.41 GB / 0 free]
Total: 3 [1.13 TB] / in use: 3 [1.13 TB] / in no VG: 0 [0 ]
[root@SeVi mnt]# lvchange --available y /dev/VolGroup00/LogVol00
[root@SeVi mnt]# mount /dev/VolGroup00/LogVol00 /mnt/hdc2

This results in mounting the current machine's lvm which is on sda1, but
I am wanting to mount /dev/hdc2.

Any one have any ideas ?

Greg

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2011, 01:27 AM
"compdoc"
 
Default LiveCD System recovery - Mounting LVM?

> I am not sure if this is your problem but what I can determine is that
there may be a conflict with the same names of the lvm volumes; ie the old
volume that I am trying to mount has the same name as the volume on the
machine that is active.


I was wondering if you were running into that problem. I've run into it in
the past. Centos always uses the same logical group and logical volume names
as default for a new install, and you can't mount a foreign LVM if the names
conflict.

I once set up a test system to try to recover some files from an LVM, and
installed centos with no LVM to avoid the conflict, but centos didn't
install the lvm tools automatically . (I like using system-config-lvm)
However, the tools are easy enough to install with yum. Some live CDs let
you install system-config-lvm too.

You can also use unique LVM group and vol names when installing centos to
avoid this...





_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2011, 01:39 AM
Nico Kadel-Garcia
 
Default LiveCD System recovery - Mounting LVM?

On Thu, Feb 3, 2011 at 9:27 PM, compdoc <compdoc@hotrodpc.com> wrote:
>> I am not sure if this is your problem but what I can determine is that
> there may be a conflict with the same names of the lvm volumes; ie the old
> volume that I am trying to mount has the same name as the volume on the
> machine that is active.

Note that CentOS 6 will not. RedHat rewrote anaconda to use the
hostname in the volume groups, which is very helpful to avoid just
this situation.

> I was wondering if you were running into that problem. I've run into it in
> the past. Centos always uses the same logical group and logical volume names
> as default for a new install, and you can't mount a foreign LVM if the names
> conflict.
>
> I once set up a test system to try to recover some files from an LVM, and
> installed centos with no LVM to avoid the conflict, but centos didn't
> install the lvm tools automatically . (I like using system-config-lvm)
> However, the tools are easy enough to install with yum. Some live CDs let
> you install system-config-lvm too.
>
> You can also use unique LVM group and vol names when installing centos to
> avoid this...
>
>
>
>
>
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 11:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org