LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 11-19-2009, 04:48 AM   #1
jeg1972
LQ Newbie
 
Registered: Nov 2009
Location: Gateshead, UK
Distribution: Oracle Enterprise Linux
Posts: 11

Rep: Reputation: 0
Viewing data within a Volume Group


Hi everyone

We're working on Oracle Enterprise Linux (RedHat clone) and I've been given a hard drive (in reality its a virtual hard drive) with an LVM volume group on it, quite simply I need to get the data off one of the physical volumes in the group.

The situation is this, I've created another Linux install and added the LVM disc to it so that I can at least get to the data and what I see is;


#lvscan
ACTIVE /dev/VolGroup01/LogVol00 [15.22 GB]inherit
ACTIVE /dev/VolGroup01/LogVol01 [768.00 MB] inherit


and

#pvscan
PV /dev/sdb3 VG VolGroup01 lvm2 [15.00 GB / 0 free]
PV /dev/sdb2 VG VolGroup01 lvm2 [288.00 GB / 0 free]
PV /dev/sdb1 VG VolGroup01 lvm2 [704.00 MB / 0 free]


Now, I can mount /dev/sdb1, which is the boot partition, but the one I really need access to is /dev/sdb3.

When I try and mount that I get;

mount: you must specify the filesystem type

Which of course I can't do, as lvm2 is not a valid filesystem for mount -t

Does anyone have any ideas?

Thanks in advance.

John

Last edited by jeg1972; 11-19-2009 at 04:49 AM.
 
Old 11-19-2009, 07:44 AM   #2
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 14,972

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
You mount the logical volumes that are on the LVM volume. Look through your /dev/ directory. If you don't have the logical volume nodes, use vgmknodes to create them.
 
Old 11-19-2009, 03:19 PM   #3
jeg1972
LQ Newbie
 
Registered: Nov 2009
Location: Gateshead, UK
Distribution: Oracle Enterprise Linux
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
You mount the logical volumes that are on the LVM volume. Look through your /dev/ directory. If you don't have the logical volume nodes, use vgmknodes to create them.
Thanks for this...

I didn't have Logical Volume in /dev/ so I ran vgmknodes and they appeared, then I tried to mount;

mount /dev/VolGroup01/LogVol00 /mnt/tmp

But I still get the message; "mount: you must specify the filesystem type"

So, can I go anywhere from here?

Thanks in advance

John
 
Old 11-19-2009, 08:00 PM   #4
seaking1
LQ Newbie
 
Registered: Jan 2009
Posts: 21

Rep: Reputation: 16
Before you can mount the drive, you must lay a filesystem on it.
For a basic ext3 filesystem you would use the command:

mke2fs -j 'device path'

This creates an ext3 fs on your device which you can then proceed to mount with the mount auto-detect fs type.
 
Old 11-20-2009, 02:55 AM   #5
chiragrk
Member
 
Registered: Nov 2009
Location: India
Distribution: Xandros, Ubuntu
Posts: 72

Rep: Reputation: 16
Quote:
Originally Posted by seaking1 View Post
mke2fs -j 'device path'

This creates an ext3 fs on your device which you can then proceed to mount with the mount auto-detect fs type.
Be careful while formatting any partition(s) as you _will_ lose data on it. Its best to try and identify if the partition is already formatted with a filesystem - most usually by trial and error if you dont remember exactly.
 
Old 11-20-2009, 03:48 AM   #6
jeg1972
LQ Newbie
 
Registered: Nov 2009
Location: Gateshead, UK
Distribution: Oracle Enterprise Linux
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by seaking1 View Post
Before you can mount the drive, you must lay a filesystem on it.
For a basic ext3 filesystem you would use the command:

mke2fs -j 'device path'

This creates an ext3 fs on your device which you can then proceed to mount with the mount auto-detect fs type.
Mmm... So, I carried out mke2fs -j /dev/VolGroup01/LogVol00

I now get;

"Device size reported to be zero. Invalid partition specified, or partition table wasn't read after running fdisk, due to a modified partition being busy and in use. You may need to reboot to re-read your partition table"

So after I reboot, I'm now in a similar situation, /dev/VolGroup01/LogVol00 doesn't exist, so I need to run vgmknodes again, then mke2fs -j /dev/VolGroup01/LogVol00 and I get the same message once more...

"Device size reported to be zero. Invalid partition specified, or partition table wasn't read after running fdisk, due to a modified partition being busy and in use. You may need to reboot to re-read your partition table"

As always, all help is gratefully received.

John
 
Old 11-20-2009, 04:17 PM   #7
seaking1
LQ Newbie
 
Registered: Jan 2009
Posts: 21

Rep: Reputation: 16
Quote:
Originally Posted by chiragrk View Post
Be careful while formatting any partition(s) as you _will_ lose data on it. Its best to try and identify if the partition is already formatted with a filesystem - most usually by trial and error if you dont remember exactly.
Of course - but in this case he appears to be making a new device so I didn't mention it. If one creates a new logical volume without some specific D:S:T info or extends it is going to be an ordeal finding data on it anyway.

Reply to main question:

What was the output from your mke2fs command?
What is the version of your lvm stuff? (cmd = "lvm version")
 
Old 11-20-2009, 07:51 PM   #8
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 14,972

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
Quote:
been given a hard drive (in reality its a virtual hard drive) with an LVM volume group on it, quite simply I need to get the data off one of the physical volumes in the group.

Quote:
Originally Posted by seaking1 View Post
Before you can mount the drive, you must lay a filesystem on it.
For a basic ext3 filesystem you would use the command:

mke2fs -j 'device path'

This creates an ext3 fs on your device which you can then proceed to mount with the mount auto-detect fs type.
This is very bad. Why did you tell him to format a partition when he wants to get data off it? The LVM disk he added to the Linux installation is on the physical disk he was give with the oracle database files on it.

The logical partitions are the ones that contain the filesystems. If you want to check what filesystem a device has on it, use "sudo file -s /dev/<node>".

You have 3 physical partitions on the hard drive that make up VG 01. It in turn has two logical volumes on it Vol00 and Vol01. You formatted Vol00. You should have run:
sudo file -s /dev/VolGroup01/LogVol00
and
sudo file -s /dev/VolGroup01/LogVol01
to find out what filesystem is being used.

You may need to resort to a program such as photorec to try to recover what files were on it, but you may not get the filenames. You may want to image LogVol00 so that you don't damage it further.

Last edited by jschiwal; 11-20-2009 at 08:04 PM.
 
Old 11-20-2009, 10:11 PM   #9
seaking1
LQ Newbie
 
Registered: Jan 2009
Posts: 21

Rep: Reputation: 16
Woops.
I glazed over that detail. Sorry - hopefully putting the filesystem shouldn't be too destructive to the data.
I will refrain from attempting to give aid.
 
Old 11-21-2009, 02:37 AM   #10
jeg1972
LQ Newbie
 
Registered: Nov 2009
Location: Gateshead, UK
Distribution: Oracle Enterprise Linux
Posts: 11

Original Poster
Rep: Reputation: 0
Don't worry everybody! It's not has bad as that, it turns out we did have a backup of the files as well, so we restored from that.

I decided I wanted to continue to try and get the data from the Logical Volume in case I needed to do it in a real life situation.

I hope nobody is upset :-(

John
 
Old 11-21-2009, 06:20 AM   #11
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 14,972

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
That is a relief. I actually got a bit upset over it. You could try "sudo file -s /dev/VolGroup01/LogVol01" to check what was in the smaller Logical Volume. You may be disappointed. It could be a partition for /tmp, or maybe a swap partition (which doesn't have a filesystem). A separate partition for /tmp allows mounting with more secure options such as noexec & nodev, and prevents bringing the server down by flooding the logs.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
upgrade system with lvm on software raid-1 data volume w/o losing data BinWondrin Linux - General 1 01-13-2009 04:25 PM
partition and volume group bravored Linux - Server 3 01-12-2009 12:27 PM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 12:26 PM
viewing the volume label of a cd? minm Linux - Newbie 2 12-25-2004 03:27 AM
Volume group data missing Smthian AIX 1 07-28-2004 03:01 PM


All times are GMT -5. The time now is 11:31 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration