PDA

View Full Version : lvm problems



ianesh
16th May 2008, 02:13 AM
Fairly new linux user here and I am running FC8. i recently installed a new harddrive on a sata/pci card. Everything in thew initial set up went fine. I went into lvm and added the entire drive (one partition) to the volume group VolGroup00, and added it all to a single lv LogVol01.

Anyway, once I restarted, it would not boot - complains of:
Couldn't find physical volume for uuid:xxx-xx-x-x-x-x-x, etc..

When I boot from a rescue disk and run pvscan, lvscan, vgscan - everything looks fine - I can even activate the vg in rescue mode. But regardless, it will not boot normally.

Any idea what i should be looking at or how I can troubleshoot?

Thanks in advance.

algej
16th May 2008, 03:26 AM
Hm. If you originally did a default install, then /dev/VolGroup00/LogVol01 was your swap. You didn't say whether you dropped a filesystem on it or not, but if you did, that's not going to make the system very happy. Something isn't right though, because that shouldn't make the system unable to find a physical volume. I'm thinking either your LVM setup isn't fine after all, or your root filesystem is missing some device entries (and/or lvm nodes) for your new disk.

Let's try to eliminate the LVM setup first. Please post the exact error messages you get when trying to boot and also the output from:

pvdisplay

vgdisplay

lvdisplay --maps

fdisk -l

the contents of your /etc/fstab (on the disk that's not booting)

You should be able to boot a live CD to get network access to make this easier.

ianesh
17th May 2008, 12:52 AM
thanks - I am downloading a liveCD dist right now - should be able to get these details posted soon. I ran the scripts you posted and the data all "looks" fine - don't see anything obvious, but I will post soon.

ianesh
17th May 2008, 03:03 PM
Thanks again for any help you can provide - Here is the dump of the commands:

knoppix@Knoppix:~$ sudo pvdisplay
--- Physical volume ---
PV Name /dev/hdc2
VG Name VolGroup00
PV Size 233.66 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 7477
Free PE 0
Allocated PE 7477
PV UUID I4faAg-9084-7jso-qrpq-b1qc-dG0n-oDqw3C

--- Physical volume ---
PV Name /dev/sda1
VG Name VolGroup00
PV Size 931.50 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 29808
Free PE 0
Allocated PE 29808
PV UUID CmHqSq-IeaJ-MVta-d13P-zFhX-0Hyy-8m8duT

knoppix@Knoppix:~$ sudo vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 1.14 TB
PE Size 32.00 MB
Total PE 37285
Alloc PE / Size 37285 / 1.14 TB
Free PE / Size 0 / 0
VG UUID BIAEBV-ugOC-akft-mGW1-eEcf-vGp0-Bsz1Mi

knoppix@Knoppix:~$ sudo lvdisplay --maps
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID sCfMo7-UV42-S0Ue-lxq1-pVxi-hXuI-Hi16Yi
LV Write Access read/write
LV Status NOT available
LV Size 10.00 GB
Current LE 320
Segments 1
Allocation inherit
Read ahead sectors 0

--- Segments ---
Logical extent 0 to 319:
Type linear
Physical volume /dev/hdc2
Physical extents 0 to 319


--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID 0z9lPc-7uWU-hPPu-pS13-6v5a-407U-ESKB4u
LV Write Access read/write
LV Status NOT available
LV Size 1.13 TB
Current LE 36917
Segments 2
Allocation inherit
Read ahead sectors 0

--- Segments ---
Logical extent 0 to 7108:
Type linear
Physical volume /dev/hdc2
Physical extents 320 to 7428

Logical extent 7109 to 36916:
Type linear
Physical volume /dev/sda1
Physical extents 0 to 29807


--- Logical volume ---
LV Name /dev/VolGroup00/LogVol02
VG Name VolGroup00
LV UUID wqhRkI-McPX-L0vv-wAY5-93Nx-SQr9-ilxH0A
LV Write Access read/write
LV Status NOT available
LV Size 1.50 GB
Current LE 48
Segments 1
Allocation inherit
Read ahead sectors 0

--- Segments ---
Logical extent 0 to 47:
Type linear
Physical volume /dev/hdc2
Physical extents 7429 to 7476


knoppix@Knoppix:~$ fdisk -l
knoppix@Knoppix:~$ sudo fdisk -l

Disk /dev/hdc: 255 heads, 63 sectors, 30515 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 13 104391 83 Linux
/dev/hdc2 14 30515 245007315 8e Linux LVM

Disk /dev/sda: 255 heads, 63 sectors, 121601 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 121602 976762583+ 8e Linux LVM
knoppix@Knoppix:~$


proc /proc proc rw,nosuid,nodev,noexec 0 0
/sys /sys sysfs rw,nosuid,nodev,noexec 0 0
/dev/shm /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
/dev/pts /dev/pts devpts mode=0622 0 0
/dev/fd0 /media/fd0 auto user,noauto,exec,umask=000 0 0
/dev/cdrom /media/cdrom auto user,noauto,exec,ro 0 0
/dev/hdb /media/hdb auto users,noauto,exec,ro 0 0
/dev/hdd /media/hdd auto users,noauto,exec,ro 0 0
/dev/hda /media/hda auto users,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/hdc1 /media/hdc1 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sda /media/sda auto noauto,users,exec 0 0
~
~
~
~
~
"/etc/fstab" [readonly] 13L, 638C

ianesh
18th May 2008, 02:18 AM
the complaint at startup is that it "couldn't find physical volume uuid CmHqSq-IeaJ-MVta-d13P-zFhX-0Hyy-8m8duT". (Which is the new drive I am trying to install, and is on a PCI - SATA card). It prints this twice and then stops booting.

algej
18th May 2008, 02:20 AM
There's a couple things missing I wanted to see: the /etc/fstab that I wanted was the one on your boot disk, not the one on your live CD. To get it, you would need to:
1. lvchange -a y /dev/VolGroup00/LogVol00
2. mount /dev/VolGroup00/LogVol00 /mnt
3. cat /mnt/etc/fstab

I wanted to see your "real" fstab in order to be certain what was what. I also wanted to see the exact error messages you were getting. The part where it says: Couldn't find physical volume for uuid:xxx-xx-x-x-x-x-x, etc.. The exact uuid is critically important for troubleshooting, as are the rest of the errors the system spits out at you when it fails to boot.

Anyway, it looks like you have:

LogVol00 is a 10GB root filesystem
LogVol01 is a ~1TB filesystem, spans /dev/hdc2 and /dev/sda1
LogVol02 is possibly your swap, at 1.5GB

If all of that's right, then I'm guessing either you don't have all of your device nodes in place for VolGroup00, or you're missing the device node for /dev/sda1.

From your live CD (or rescue CD, it shouldn't matter) try this:

1. lvchange -a y /dev/VolGroup00/LogVol00 # activate all logical volumes
2. lvchange -a y /dev/VolGroup00/LogVol01
3. lvchange -a y /dev/VolGroup00/LogVol02
4. mount /dev/VolGroup00/LogVol00 /mnt # mount your root filesystem
5. chroot /mnt # and chroot to it
6. mount -t proc /proc /proc # give yourself a proc filesystem
7. mount -t sysfs /sys /sys # and a sysfs
8. vgscan --mknodes # check and possibly create missing vg device nodes
9. reboot and see if that fixed it.

If that didn't fix it, then you'll have to post the right fstab and the exact error messages you're getting.

As a worst case, you'll have to revert your LVM configuration to when it last worked (without sda1), and try again, but make sure LVM can see the physical device before committing it to using it in a LV.

---
By the way - with over a terabyte of disk space, I strongly recommend you leave at least 30GB unallocated - that way you can create a whole new root filesystem next time you upgrade, plus have about 10G available for growth, plus have the ability to take snapshots. Fedora's a cutting-edge distro and therefore updates have a habit of causing headaches - it's nice to be able to snapshot, update, then just rollback if the update messed you up.

ianesh
18th May 2008, 02:44 AM
Here is the "real" fstab;

I tried the steps you provided, but still have the same issues - complains about not being able to find the new physical device. Thanks so much for your help - any other thoughts on how to make this work?

root@Knoppix:/ramdisk/home/knoppix# cat /mnt/etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol02 swap swap defaults 0 0
/dev/VolGroup00/LogVol01 /storage ext3 defaults1 2

ianesh
18th May 2008, 03:02 AM
Thanks for the suggestion - I tried this and in rescue mode it was able to find the vg and I could browse the entire space. however, when i reboot it still complains that it can't find the physical volume for the sata drive and therefore fails to load the vg.

It just seems that something is different when I run in rescue mode vs a standard install. i am running grub and have the option to change load settings, but I really have no idea if that would help.

Thanks again

algej
18th May 2008, 04:17 AM
ianesh,

The only other thing I can think of at this point is to revert to the last working configuration. Take /dev/sda1 out of your volume group so that the system will boot, then troubleshoot from there.

If /storage (/dev/VolGroup00/LogVol01) has data on it, you'll need to back it up if you want to keep it. If you haven't put a lot of new data on /storage, you might be able to shrink the filesystem (using resize2fs) so that it fits on /dev/hdc2, then lvresize LogVol01 down to fit it and see if lvdisplay --maps confirms that LogVol01 no longer spans over to sda1, but I'd still say back it up first if you can.

Once you've taken /dev/sda1 out of LogVol01, or have backed it up and are prepared to lose it, then run vgreduce VolGroup00 /dev/sda1. Then run pvremove /dev/sda1. If you lost LogVol01, recreate it so the system won't complain about it missing on boot: lvcreate --name LogVol01 --extents 7109 VolGroup00; mkfs -t ext3 /dev/VolGroup00/LogVol01. Reboot.

If it still doesn't boot then something (LVM or UDEV probably) is corrupt and you might be stuck using the live CD to back up whatever you want to keep from the root filesystem and reinstall.

Assuming the system boots, check pvdisplay, vgdisplay, lvdisplay --maps, and fdisk -l again. Fedora 8 uses libata so I would expect /dev/hdc to become /dev/sd<something-or-other> and sda1 may be named something else too. Make sure LVM sees the sata physical device after a reboot, BEFORE putting it into the volume group. Then add it to the volume group (vgextend VolGroup00 /dev/sda1 or whatever it's called), reboot again and make sure everything's consistent. Then you can resize LogVol01 and resize the filesystem sitting on it.