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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-13-2006, 11:51 PM
|
#1
|
Member
Registered: Nov 2005
Distribution: CentOS-4
Posts: 41
Rep:
|
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. 
|
|
|
05-14-2006, 12:25 AM
|
#2
|
Senior Member
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337
|
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
|
|
|
05-14-2006, 07:19 AM
|
#3
|
Member
Registered: May 2005
Distribution: Fedora Core Since version 3
Posts: 193
Rep:
|
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.
|
|
|
05-14-2006, 09:37 AM
|
#4
|
Member
Registered: Nov 2005
Distribution: CentOS-4
Posts: 41
Original Poster
Rep:
|
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..
|
|
|
05-14-2006, 11:17 AM
|
#5
|
Senior Member
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337
|
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:
|
|
|
05-14-2006, 12:41 PM
|
#6
|
Member
Registered: Nov 2005
Distribution: CentOS-4
Posts: 41
Original Poster
Rep:
|
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.
|
|
|
05-15-2006, 08:17 PM
|
#7
|
Member
Registered: Nov 2005
Distribution: CentOS-4
Posts: 41
Original Poster
Rep:
|
Can anybody help me remove my corrupt logical volumes?
|
|
|
05-17-2006, 02:19 AM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,639
Rep: 
|
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 02:20 AM.
|
|
|
All times are GMT -5. The time now is 03:48 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|