View Full Version : LVM and removable drives
sakshale
2005-06-22, 07:35 PM CDT
This may be simple, or it may be impossible.
I have a system with two disks on a secondary RAID controller that are configured as a RAID mirror. This was done using a clean FC4 install and the default partitioning. They are hda and hdc on ide0 and ide1, respectively.
The system also has two slots for removable disks, connected to the motherboard channels, and that is where the fun begins. When installed, they are hde and hdf on ide2, with the DVD writer sitting as hdg on ide3.
The system boots and runs without problems, with or without a disk in the removable slot.
I have a disk that used to reside on that system in a removable case. It has a default install of FC3 on it.
When I install the disk, it correctly appears as hde and fdisk reports two partitions;
/dev/hde1* Linux (was /boot)
/dev/hde2 Linux LVM (was / )
I can mount /dev/hde1 without any problems. However, I haven't a clue as to what I need to do to
be able to mount /dev/hde2! Nothing I have tried seems to work as "mount" doesn't seem to grok
LVM file systems by itself.
I need to be able to install a disk (rebooting is acceptable), mount it, umount it and uninstall it.
Could some kind soul point me to some LVM documentation that would address my strange setup?
Thanks in advance.
Sakshale
sakshale
2005-06-22, 08:14 PM CDT
/dev/hde2 doesn't show on this scan, just the mirrors, but it does on the next.
# pvdisplay
--- Physical volume ---
PV Name /dev/hdc1
VG Name VolGroup00
PV Size 111.78 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 3577
Free PE 0
Allocated PE 3577
PV UUID o5N4EA-euyA-gcfl-925I-hW2d-7rwA-a2C7yy
--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup00
PV Size 111.69 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 3574
Free PE 2
Allocated PE 3572
PV UUID pd1YXI-cPMQ-RjEp-a0y5-nT5h-tUzN-AjMMdQ
# vgscan -vv
Setting global/locking_type to 1
Setting global/locking_dir to /var/lock/lvm
File-based locking enabled.
Wiping cache of LVM-capable devices
Wiping internal VG cache
Reading all physical volumes. This may take a while...
Finding all volume groups
/dev/hda: size is 234441648 sectors
/dev/md0: size is 0 sectors
/dev/hdc: size is 234441648 sectors
/dev/hde: size is 160836480 sectors
/dev/hda1: size is 208782 sectors
/dev/hda1: size is 208782 sectors
/dev/hda1: No label detected
/dev/hdc1: size is 234436482 sectors
/dev/hdc1: size is 234436482 sectors
/dev/hdc1: lvm2 label detected
/dev/hde1: size is 208782 sectors
/dev/hde1: size is 208782 sectors
/dev/hde1: No label detected
/dev/hda2: size is 234227700 sectors
/dev/hda2: size is 234227700 sectors
/dev/hda2: lvm2 label detected
/dev/hde2: size is 160617870 sectors
/dev/hde2: size is 160617870 sectors
/dev/hde2: lvm2 label detected
Locking /var/lock/lvm/V_VolGroup00 RB
Finding volume group "VolGroup00"
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hde2: lvm2 label detected
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hde2: lvm2 label detected
Found volume group "VolGroup00" using metadata type lvm2
Unlocking /var/lock/lvm/V_VolGroup00
sakshale
2005-06-25, 10:44 AM CDT
Hmmm..... I still haven't found an answer to this question.
fsck
2005-06-25, 10:49 AM CDT
There's a great howto on LVM here: http://www.tldp.org/HOWTO/LVM-HOWTO/, also check the man pages for 'pvscan' and 'lvscan'.
Hope this helps.
C.
sakshale
2005-06-25, 01:09 PM CDT
Hi = Thanks for responding.
Part of the confusion is that the man pages don't appear to match what is on the system. For example, the vgrename man page shows the follow command usage;
vgrename /dev/vg02 /dev/my_volume_group
Unfortunately, on my fully functional FC4 system, there are no devices named /dev/vgXX!!! So, I haven't found anyway to call out the volume on /dev/hde2 in order to rename it.
/dev/mirror exists, but it only shows the mounted volumes from /dev/VolGroup00.
I did discover that pvdisplay also has a -vv option, which shows the unmountable partition; hde2
# pvdisplay -vv|cat
Setting global/locking_type to 1
Setting global/locking_dir to /var/lock/lvm
File-based locking enabled.
Scanning for physical volume names
/dev/hda1: No label detected <------ /boot
/dev/hdc1: lvm2 label detected <------ LVM on second system disk
/dev/hde1: No label detected <------ /boot on disk I'm trying to import
/dev/hda2: lvm2 label detected <------ LVM on first system disk
/dev/hde2: lvm2 label detected <------ LVM on disk I'm trying to import
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hde2: lvm2 label detected
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hde2: lvm2 label detected
--- Physical volume ---
PV Name /dev/hdc1
VG Name VolGroup00
PV Size 111.78 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 3577
Free PE 0
Allocated PE 3577
PV UUID o5N4EA-euyA-gcfl-925I-hW2d-7rwA-a2C7yy
--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup00
PV Size 111.69 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 3574
Free PE 2
Allocated PE 3572
PV UUID pd1YXI-cPMQ-RjEp-a0y5-nT5h-tUzN-AjMMdQ
It seems to me that this could be a common problem with trying to recover data off of a disk from a failed system.
Thanks again for responding.
fsck
2005-06-25, 01:55 PM CDT
/dev/vg02 is only an example. On my system I have /dev/RootVol, /Dev/DataVol, and /dev/Scratch.
You could have /dev/ilikereallylongvolumenames if you wanted (actually, I don't know the max length of volume names off the top of my head.)
anyway, do a 'vgscan' and see if it imports the disks.
C.
(edit) Sorry, meant 'pvscan'!
sakshale
2005-06-25, 03:10 PM CDT
pvscan doesn't seem to change anything. It sees the LVM partition on hde2, but only reacts to the two original disks. My guess is that it doesn't like the fact that the LVM partition hde2 has the same lable at the mounted partion from hda2 and hdc1 - VolGroup00.
# pvscan -vv
Setting global/locking_type to 1
Setting global/locking_dir to /var/lock/lvm
File-based locking enabled.
Wiping cache of LVM-capable devices
Wiping internal VG cache
Walking through all physical volumes
/dev/hda: size is 234441648 sectors
/dev/md0: size is 0 sectors
/dev/hdc: size is 234441648 sectors
/dev/hde: size is 160836480 sectors
/dev/hda1: size is 208782 sectors
/dev/hda1: size is 208782 sectors
/dev/hda1: No label detected
/dev/hdc1: size is 234436482 sectors
/dev/hdc1: size is 234436482 sectors
/dev/hdc1: lvm2 label detected
/dev/hde1: size is 208782 sectors
/dev/hde1: size is 208782 sectors
/dev/hde1: No label detected
/dev/hda2: size is 234227700 sectors
/dev/hda2: size is 234227700 sectors
/dev/hda2: lvm2 label detected
/dev/hde2: size is 160617870 sectors
/dev/hde2: size is 160617870 sectors
/dev/hde2: lvm2 label detected
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hde2: lvm2 label detected
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hdc1: lvm2 label detected
/dev/hda2: lvm2 label detected
/dev/hde2: lvm2 label detected
PV /dev/hdc1 VG VolGroup00 lvm2 [111.78 GB / 0 free]
PV /dev/hda2 VG VolGroup00 lvm2 [111.69 GB / 64.00 MB free]
Total: 2 [223.47 GB] / in use: 2 [223.47 GB] / in no VG: 0 [0 ]
/dev/hde2 appears to be ignored.
The only directoried under /dev that appear to be related to LVM are VolGroup00 and mapper.
fsck
2005-06-25, 03:56 PM CDT
I wonder if it will let us import it, you could try
'pvscan' (don't use the -vv)
or try
'pvscan -n'
'vgimport -a'
'vgs'
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.