LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-14-2006, 12:51 AM   #1
zdenisl
Member
 
Registered: Nov 2005
Distribution: CentOS-4
Posts: 41

Rep: Reputation: 15
LVM hosed


I'm having a lot of problems with LVM.

For reference to my problems:
http://www.linuxquestions.org/questi....php?p=2243499
http://www.linuxquestions.org/questi...d.php?t=443938

I'm at the point where I'm ready to cut my losses and build a new VG for my user data. I'm trying to remove the corrupted LV's and it's failing.

How can I recover the disk space if I cannot remove the LV's?

My command:
lvremove -v -d -f /dev/ramairVG/lvhome

After a few screens of lines, it get this:
Code:
lvremove -- can't remove open  logical volume "/dev/ramairVG/lvhome"
 
<1> lvm_unlock -- CALLED
<1> lvm_unlock -- LEAVING with ret: 0
Here's my config.
Code:
[root@RAMAIR root]# vgdisplay -v
--- Volume group ---
VG Name               ramairVG
VG Access             read/write
VG Status             available/resizable
VG #                  0
MAX LV                256
Cur LV                4
Open LV               4
MAX LV Size           255.99 GB
Max PV                256
Cur PV                1
Act PV                1
VG Size               156.25 GB
PE Size               4 MB
Total PE              40000
Alloc PE / Size       38418 / 150.07 GB
Free  PE / Size       1582 / 6.18 GB
VG UUID               zGJqIv-0xMR-0xG3-A3pw-LrT5-4Dng-zhVxg5
 
--- Logical volume ---
LV Name                /dev/ramairVG/lvhome
VG Name                ramairVG
LV Write Access        read/write
LV Status              available
LV #                   1
# open                 1
LV Size                70 GB
Current LE             17920
Allocated LE           17920
Allocation             next free
Read ahead sectors     1024
Block device           58:0
 
--- Logical volume ---
LV Name                /dev/ramairVG/lvsyslogs
VG Name                ramairVG
LV Write Access        read/write
LV Status              available
LV #                   2
# open                 1
LV Size                1000 MB
Current LE             250
Allocated LE           250
Allocation             next free
Read ahead sectors     1024
Block device           58:1
 
--- Logical volume ---
LV Name                /dev/ramairVG/lvswap
VG Name                ramairVG
LV Write Access        read/write
LV Status              available
LV #                   3
# open                 1
LV Size                512 MB
Current LE             128
Allocated LE           128
Allocation             next free
Read ahead sectors     1024
Block device           58:2
 
--- Logical volume ---
LV Name                /dev/ramairVG/lvhome2
VG Name                ramairVG
LV Write Access        read/write
LV Status              available
LV #                   4
# open                 1
LV Size                78.59 GB
Current LE             20120
Allocated LE           20120
Allocation             next free
Read ahead sectors     1024
Block device           58:3
 
 
--- Physical volumes ---
PV Name (#)           /dev/md1 (1)
PV Status             available / allocatable
Total PE / Free PE    40000 / 1582

[root@RAMAIR root]# fdisk -l
 
Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1      1275  10241406   fd  Linux raid autodetect
/dev/hda2          1276     11474  81923467+  fd  Linux raid autodetect
 
Disk /dev/hdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1   *         1      1275  10241406   fd  Linux raid autodetect
/dev/hdb2          1276     11474  81923467+  fd  Linux raid autodetect

[root@RAMAIR root]# lsraid -R -a /dev/md1 -a /dev/md0
# This raidtab was generated by lsraid version 0.7.0.
# It was created from a query on the following devices:
#       /dev/md1
#       /dev/md0
 
# md device [dev 9, 1] /dev/md1 queried online
raiddev /dev/md1
        raid-level              0
        nr-raid-disks           2
        nr-spare-disks          0
        persistent-superblock   1
        chunk-size              64
 
        device          /dev/hda2
        raid-disk               0
        device          /dev/hdb2
        raid-disk               1
 
# md device [dev 9, 0] /dev/md0 queried online
raiddev /dev/md0
        raid-level              1
        nr-raid-disks           2
        nr-spare-disks          0
        persistent-superblock   1
        chunk-size              64
 
        device          /dev/hda1
        raid-disk               0
        device          /dev/hdb1
        raid-disk               1
 
[root@RAMAIR root]#
Redhat 9 Kernel 2.4.20-8
LVM 1.0.3

I'm running out of options other then reinstall - And lose a lot of work.
 
Old 05-14-2006, 01:25 AM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Sorry to hear you're giving up (not that I know what else you could do!)

I don't think you can remove an active logical volume. Try flagging it as inactive before removing it:
Code:
# umount /dev/ramairVG/lvhome
# lvchange -a n /dev/ramairVG/lvhome
# lvremove /dev/ramairVG/lvhome
 
Old 05-14-2006, 08:19 AM   #3
comptiger5000
Member
 
Registered: May 2005
Distribution: Fedora Core Since version 3
Posts: 193

Rep: Reputation: 30
if you have to reinstall, boot a knoppix cd first, their website tells how to install lvm into the ramdisk. You may be able to recover some data. restore the data after the reinstall if any can be recovered.
 
Old 05-14-2006, 10:37 AM   #4
zdenisl
Member
 
Registered: Nov 2005
Distribution: CentOS-4
Posts: 41

Original Poster
Rep: Reputation: 15
haertig - the lvchange is not working (why should it with my luck!)
Code:
[root@RAMAIR /]# umount /dev/ramairVG/lvhome2
umount: /dev/ramairVG/lvhome2: not mounted
[root@RAMAIR /]# lvchange -a n /dev/ramairVG/lvhome2
lvchange -- operation not permitted for (open) logical volume "/dev/ramairVG/lvh
ome2"

[root@RAMAIR /]#
comptiger5000 -
I don't fully understand what I could do with a bootable knippox CD that I couldn't do with my current running system. Would you mind explaining in a little more detail what I could do with a knippox CD to recover my data? Or, if there is a howto or something online that you could point me to, I'd appreciate it.

Thanks guys..
 
Old 05-14-2006, 12:17 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by zdenisl
the lvchange is not working (why should it with my luck!)
Typical! Try a bigger hammer, ... this one will (attempt!) to flag all your volume groups as inactive.

First, unmount all your logical volumes - I can predict your NEXT problem - then try to run:
Code:
# vgchange -a n
 
Old 05-14-2006, 01:41 PM   #6
zdenisl
Member
 
Registered: Nov 2005
Distribution: CentOS-4
Posts: 41

Original Poster
Rep: Reputation: 15
One of my LV's is mounted on /var (/dev/ramairVG/lvsyslogs)
I unmounted via umount -l /var

here's the failed attempt
I re-mounted /var after the vgchange failed.

Code:
[root@RAMAIR /]# mount
/dev/md0 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
[root@RAMAIR /]# vgchange -a n
vgchange -- can't deactivate volume group "ramairVG" with 3 open logical volumes

[root@RAMAIR /]# mount /var
[root@RAMAIR /]# mount
/dev/md0 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/ramairVG/lvsyslogs on /var type ext3 (rw)
[root@RAMAIR /]#
This isn't looking good for me.
 
Old 05-15-2006, 09:17 PM   #7
zdenisl
Member
 
Registered: Nov 2005
Distribution: CentOS-4
Posts: 41

Original Poster
Rep: Reputation: 15
Can anybody help me remove my corrupt logical volumes?
 
Old 05-17-2006, 03:19 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,623

Rep: Reputation: Disabled
I can't help you either. But if you plan to set up a new LVM system, get the new version of LVM 2.x.y -- that might be more stable...

Last edited by JZL240I-U; 05-17-2006 at 03:20 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is my reiser fs hosed? Hypnotoad Linux - Software 2 01-19-2005 01:01 AM
3c59x Hosed in 2.6.10 Techweenie1 Linux - Networking 1 12-28-2004 08:45 PM
Just Hosed my System sorceran Slackware 1 09-28-2004 01:59 PM
Am I hosed ? lostboy Linux - Hardware 14 03-11-2003 12:45 AM
Hosed once again Cichlid Linux - Hardware 3 11-02-2002 10:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration