Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Getting data off LVM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dbodner
n00b
n00b


Joined: 27 Aug 2007
Posts: 54

PostPosted: Wed Nov 14, 2007 9:39 pm    Post subject: Getting data off LVM Reply with quote

Hey guys,
I have this computer I setup as a samba server, which previously had CentOS installed. I bought a new disk, and installed Gentoo on that. Booted up fine. I then went to mount the previous drive to copy data over to it the new install, and hadn't even realized it was an LVM volume. It's a single partition (sda2) in the lvm. What's the easiest way to mount this and get the data off of it? I've never really worked with an lvm before, so I'm a complete newb in this respect.
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Wed Nov 14, 2007 11:07 pm    Post subject: Reply with quote

emerge lvm2

and then type lvs

The output should be something like

Code:
 # lvs
  LV              VG   Attr   LSize   Origin Snap%  Move Log Copy%
  Images          vg0  -wi-ao 372.96G


What you are looking for is the name of the volume group.

In this case it is vg0

So I then can see if there are device nodes for this:

Code:

dev6 ~ # ls /dev/vg0/ -al
total 0
drwx------  2 root root   100 Oct  2 14:12 .
drwxr-xr-x 21 root root 15080 Nov 11 03:10 ..
lrwxrwxrwx  1 root root    22 Oct  2 14:12 Images -> /dev/mapper/vg0-Images


I see that Images is there so I can mount it

mount /dev/vg0/Images /mnt/temp
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
dbodner
n00b
n00b


Joined: 27 Aug 2007
Posts: 54

PostPosted: Thu Nov 15, 2007 12:22 am    Post subject: Reply with quote

thanks for the help. I've found the volume, but now when I do that, I get:
mount: you must specify the filesystem type
Back to top
View user's profile Send private message
Habbit
Apprentice
Apprentice


Joined: 01 Sep 2007
Posts: 237
Location: 3.7137 W, 40.3873 N

PostPosted: Thu Nov 15, 2007 12:41 am    Post subject: Reply with quote

Well, then by all means do so. Is it ext3? reiserfs? xfs? Usually the kernel is able to figure it out by itself, but if it doesn't have the required modules you'll need to build them (return to kernel config).
Example: this will mount a reiserfs filesystem (-t reiserfs) with block tailing and access time updating disabled (-o notail,noatime)
Code:
mount -t reiserfs -o notail,noatime /dev/vg0/Images /mnt/temp

_________________
Code:
~ $ objdump -d ./habbit_mind
90      xchg %rax, %rax
EB FD   jmp $-3
Back to top
View user's profile Send private message
dbodner
n00b
n00b


Joined: 27 Aug 2007
Posts: 54

PostPosted: Thu Nov 15, 2007 3:33 am    Post subject: Reply with quote

that's the thing that has me puzzled. It was definitely formatted as ext3 :cry:

I thought maybe since it came from a logical volume there was something I missed.
Back to top
View user's profile Send private message
trailnut
n00b
n00b


Joined: 16 Nov 2007
Posts: 21

PostPosted: Fri Nov 16, 2007 11:27 pm    Post subject: Reply with quote

Some LVM recovery info here: http://www.novell.com/coolsolutions/appnote/19386.html
I had a similar problem with a drive that was part of a mdadm mirror that I wanted to mount by itself. I had to fsck it before it would mount.
Back to top
View user's profile Send private message
dbodner
n00b
n00b


Joined: 27 Aug 2007
Posts: 54

PostPosted: Sat Nov 17, 2007 5:35 am    Post subject: Reply with quote

Woohoo! Got the data off the drive.

Thank everyone for their help. It's very much appreciated.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum