Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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
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.
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"
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.
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"
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")
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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.