help
Hi all,
I've just got a new 250G hard drive and have been trying to add it to an
exitiing lvm2 setup on my system. However, I've screwed something up
and now I can't mount the volume which is /dev/HOME_VG/HOME_LV and contains an XFS file system.
My question is this: how I can I restore the original configuration so that I can see the contents of the logical volume?
I've included a transcript of the commands I've run to make this mess.
I'm running
# lvm version LVM version: 2.01.04 (2005-02-09) Library version: 1.01.00-ioctl (2005-01-17) Driver version: 4.4.0
on Linux 2.6.11.7 SMP i686 on a Debian/testing system
The transcript of commands I've run is as follows
461 pvcreate /dev/hdd 462 pvscan 463 mount 464 vgextend HOME_VG /dev/hdd 465 pvscan 466 man xfs_growfs 467 df -h 468 xfs_growfs /home
468 didn't work since I hadn't extended the logical volume.
469 df -h 470 pvscan 471 man pvscan 472 pvscan -v 473 pvscan -vv 474 lvscan 475 man lvextend 476 man lvextend 477 mount 478 lvextend /dev/HOME_VG/HOME_LV /dev/hdd 479 lvextend /dev/HOME_VG/HOME_LV 480 lvextend -L250G /dev/HOME_VG/HOME_LV 481 lvscan 482 mount 483 df -h
At this point I got a bit concerned that I had added 250G to the logical volume but pvdisplay only reported a capicity of 232.88G even though hdd is a 250G hard drive. So I started to try to remove the
484 lvreduce -L250G /dev/HOME_VG/HOME_LV 485 lvreduce -L-250G /dev/HOME_VG/HOME_LV
None of these reduction attempts worked. lvreduce complained that it was unable to reduce below 1 extent.
486 pvdisplay 487 lvdisplay 488 lvscan 489 vgreduce /dev/HOME_VG/HOME_LV /dev/hdd 490 vgreduce /dev/HOME_VG /dev/hdd 491 ls /var/lock/lvm/ 492 lvscan 493 lvdisplay 494 lvresize 495 lvresize -L-250G /dev/HOME_VG/HOME_LV 496 lvreduce -L-250G /dev/HOME_VG/HOME_LV
Neither of these commands worked either.
497 man lvmchange 498 man lvs 499 lvs 500 pvs 501 lvmdiskscan 502 lvmreduce -L -250G /dev/HOME_VG/HOME_LV 503 /sbin/lvmreduce -L -250G /dev/HOME_VG/HOME_LV 504 which lvmreduce 505 which lvm 506 ls /sbin/lvm* 507 ls -l /sbin/lvm* 508 lvreduce -L -250G /dev/HOME_VG/HOME_LV 509 lvscan 510 lvmdiskscan 511 pvdisplay 512 pvdisplay /dev/hdd 513 man pvmove 514 pvmove -v /dev/hdd 515 man lvchange 516 lvscan 517 lvscan -vv 518 lvreduce -L-250G /dev/HOME_VG/HOME_LV 519 mount -oro /home 520 mount 521 df -h 522 umount /home 523 lvscan 524 lvdisplay 525 pvdisplay
Up to this point I could mount /dev/HOME_VG/HOME_LV on /home no problem
526 lvreduce -L -232.88G /dev/HOME_VG/HOME_LV
This command worked and the volume group was reduced. But from now this point on I can no longer mount the volume group
527 lvscan 528 lvdisplay 529 mount -oro /home 530 lvscan 531 lvmdiskscan 532 pvscan 533 man xfs_repair 534 man xfs_check 535 xfs_check /dev/HOME_VG/HOME_LV
can't seek in filesystem at bb 36633600 can't read superblock for ag 30 can't seek in filesystem at bb 37854720 can't read superblock for ag 31
536 h|grep mount
537 mount -oro /home
This command reports
mount: /dev/mapper/HOME_VG-HOME_LV: can't read superblock
538 man vgcfgrestore 539 cd /etc/lvm/ 540 sl 541 cd backup/ 542 ls 543 less HOME_VG 544 less HOME_VG 545 man vgcfgrestore 546 vgcfgrestore -v HOME_VG 547 mount -o ro /home/
This command reports
mount: /dev/mapper/HOME_VG-HOME_LV: can't read superblock
At this point I've stopped. I can't figure out how to undo the damage I've done. And I really need to recover the original setup. There is stuff on the logical volume for which I have no backup. How I wish I'd taken my own advice and backed the important stuff up.
Right now pvscan reports
PV /dev/hdc1 VG HOME_VG lvm2 [9.32 GB / 0 free] PV /dev/hda5 VG HOME_VG lvm2 [8.82 GB / 1.01 GB free] PV /dev/hdd VG HOME_VG lvm2 [232.88 GB / 232.88 GB free]
Total: 3 [251.02 GB] / in use: 3 [251.02 GB] / in no VG: 0 [0 ]
and
# lvmdiskscan /dev/hda1 [ 47.03 MB] /dev/hdc1 [ 9.32 GB] LVM physical volume /dev/hda2 [ 8.79 GB] /dev/hda3 [ 1019.75 MB] /dev/hda5 [ 8.82 GB] LVM physical volume /dev/hdd [ 232.89 GB] LVM physical volume /dev/hdb1 [ 6.01 GB] 0 disks 4 partitions 1 LVM physical volume whole disk 2 LVM physical volumes root@darwin:/etc/lvm/backup# lvs lvs lvscan root@darwin:/etc/lvm/backup# lvscan ACTIVE '/dev/HOME_VG/HOME_LV' [17.12 GB] inherit
root@darwin:/etc/lvm/backup# pvdisplay --- Physical volume --- PV Name /dev/hdc1 VG Name HOME_VG PV Size 9.32 GB / not usable 0 Allocatable yes (but full) PE Size (KByte) 4096 Total PE 2385 Free PE 0 Allocated PE 2385 PV UUID XzBfoB-cV7O-hIzQ-3Tjn-jam0-IBXw-MJKV5W
--- Physical volume ---
PV Name /dev/hda5 VG Name HOME_VG PV Size 8.82 GB / not usable 0 Allocatable yes PE Size (KByte) 4096 Total PE 2257 Free PE 259 Allocated PE 1998 PV UUID NIO6ey-B8gt-APxD-BEOP-cmpd-UCBf-KY2rLB
--- Physical volume ---
PV Name /dev/hdd VG Name HOME_VG PV Size 232.88 GB / not usable 0 Allocatable yes PE Size (KByte) 4096 Total PE 59618 Free PE 59618 Allocated PE 0 PV UUID 2hYdvL-9I7I-tz01-Rhza-ZLyp-tsTp-niP5pJ
Any help most gratefully appreciated.
Thanks in advance,
Signature · 4 lines
Colm G. Connolly, Tel: +353-1-716-2855 Dept. of Computer Science, Fax: +353-1-269-7262 University College Dublin, MSN: [email protected] Belfield, Dublin 4, �ire. Web: http://inismor.ucd.ie/~colmconn/
Hello Colm,
Quoted 8 lines · Colm G. Connolly
I've just got a new 250G hard drive and have been trying to add it to an [...]
482 mount
483 df -hAt this point I got a bit concerned that I had added 250G to the logical volume but pvdisplay only reported a capicity of 232.88G even though hdd is a 250G hard drive. So I started to try to remove the
I know that this is *not* your main concern but I think it worth noting that the size of your 250G harddisk was correctly reported as being 232.88G. The reason being that harddisk vendors use 1G = 1000^3 while computer science defines 1G = 1024^3. (Note: I think there are some standard definition by the IEEE(?) but I don't have a URL for that.)
So 250*1000^3 = 250.000.000.000 ~ 232.8*1024^3
Wish you all the luck for the problems remaining!
Kind regards
Martin Eisenhardt
Signature · 8 lines
Dipl.Wirtsch.Inf.(Univ.) Martin Eisenhardt Bamberg University Media Informatics D - 96045 Bamberg fon: +49 (951) 863 - 2856 fax: +49 (951) 863 - 2852
your first error: don't made backup.
your second error:
# From LVM how to
xfs
There is no way to shrink XFS file systems.
If your are touch lvm2 you must know that about 250Gx1000 and 233x1024.
try use xfs_repair -n for see the reparis..
I use (but it is only a personal opinion, this is very dangerous) (use again the first commands).
vgextend my_volume_group /dev/hdc1
lvextend -L250G /dev/HOME_VG/HOME_LV
lvscan
In this point use xfs_repair -n
If you see good, use xfs_repair (pray)....
if you don't have luck try xfs_repair -d (after of this reboot) (read man xfs_repair)
try to mount. (pray again).....
good luck
On Thu, 05 May 2005 13:26:43 +0100, Colm G. Connolly wrote
Quoted 210 lines
Hi all,
I've just got a new 250G hard drive and have been trying to add it
to an exitiing lvm2 setup on my system. However, I've screwed
something up and now I can't mount the volume which is/dev/HOME_VG/HOME_LVand contains an XFS file system.My question is this: how I can I restore the original configuration so that I can see the contents of the logical volume?
I've included a transcript of the commands I've run to make this mess.
I'm running
# lvm version LVM version: 2.01.04 (2005-02-09) Library version: 1.01.00-ioctl (2005-01-17) Driver version: 4.4.0on Linux 2.6.11.7 SMP i686 on a Debian/testing system
The transcript of commands I've run is as follows
461 pvcreate /dev/hdd 462 pvscan 463 mount 464 vgextend HOME_VG /dev/hdd 465 pvscan 466 man xfs_growfs 467 df -h 468 xfs_growfs /home468 didn't work since I hadn't extended the logical volume.
469 df -h 470 pvscan 471 man pvscan 472 pvscan -v 473 pvscan -vv 474 lvscan 475 man lvextend 476 man lvextend 477 mount 478 lvextend /dev/HOME_VG/HOME_LV /dev/hdd 479 lvextend /dev/HOME_VG/HOME_LV 480 lvextend -L250G /dev/HOME_VG/HOME_LV 481 lvscan 482 mount 483 df -hAt this point I got a bit concerned that I had added 250G to the logical volume but pvdisplay only reported a capicity of 232.88G even though hdd is a 250G hard drive. So I started to try to remove the
484 lvreduce -L250G /dev/HOME_VG/HOME_LV 485 lvreduce -L-250G /dev/HOME_VG/HOME_LVNone of these reduction attempts worked. lvreduce complained that it was unable to reduce below 1 extent.
486 pvdisplay 487 lvdisplay 488 lvscan 489 vgreduce /dev/HOME_VG/HOME_LV /dev/hdd 490 vgreduce /dev/HOME_VG /dev/hdd 491 ls /var/lock/lvm/ 492 lvscan 493 lvdisplay 494 lvresize 495 lvresize -L-250G /dev/HOME_VG/HOME_LV 496 lvreduce -L-250G /dev/HOME_VG/HOME_LVNeither of these commands worked either.
497 man lvmchange 498 man lvs 499 lvs 500 pvs 501 lvmdiskscan 502 lvmreduce -L -250G /dev/HOME_VG/HOME_LV 503 /sbin/lvmreduce -L -250G /dev/HOME_VG/HOME_LV 504 which lvmreduce 505 which lvm 506 ls /sbin/lvm* 507 ls -l /sbin/lvm* 508 lvreduce -L -250G /dev/HOME_VG/HOME_LV 509 lvscan 510 lvmdiskscan 511 pvdisplay 512 pvdisplay /dev/hdd 513 man pvmove 514 pvmove -v /dev/hdd 515 man lvchange 516 lvscan 517 lvscan -vv 518 lvreduce -L-250G /dev/HOME_VG/HOME_LV 519 mount -oro /home 520 mount 521 df -h 522 umount /home 523 lvscan 524 lvdisplay 525 pvdisplayUp to this point I could mount
/dev/HOME_VG/HOME_LVon /home no problem526 lvreduce -L -232.88G /dev/HOME_VG/HOME_LVThis command worked and the volume group was reduced. But from now this point on I can no longer mount the volume group
527 lvscan 528 lvdisplay 529 mount -oro /home 530 lvscan 531 lvmdiskscan 532 pvscan 533 man xfs_repair 534 man xfs_check 535 xfs_check /dev/HOME_VG/HOME_LVcan't seek in filesystem at bb 36633600
can't read superblock for ag 30
can't seek in filesystem at bb 37854720
can't read superblock for ag 31536 h|grep mount
537 mount -oro /homeThis command reports
mount:/dev/mapper/HOME_VG-HOME_LV: can't read superblock538 man vgcfgrestore 539 cd /etc/lvm/ 540 sl 541 cd backup/ 542 ls 543 less HOME_VG 544 less HOME_VG 545 man vgcfgrestore 546 vgcfgrestore -v HOME_VG 547 mount -o ro /home/This command reports
mount:/dev/mapper/HOME_VG-HOME_LV: can't read superblockAt this point I've stopped. I can't figure out how to undo the damage I've done. And I really need to recover the original setup. There is stuff on the logical volume for which I have no backup. How I wish I'd taken my own advice and backed the important stuff up.
Right now pvscan reports
PV /dev/hdc1 VG HOME_VG lvm2 [9.32 GB / 0 free] PV /dev/hda5 VG HOME_VG lvm2 [8.82 GB / 1.01 GB free] PV /dev/hdd VG HOME_VG lvm2 [232.88 GB / 232.88 GB free]Total: 3 [251.02 GB] / in use: 3 [251.02 GB] / in no VG: 0 [0 ]
and
# lvmdiskscan /dev/hda1 [ 47.03 MB] /dev/hdc1 [ 9.32 GB] LVM physical volume /dev/hda2 [ 8.79 GB] /dev/hda3 [ 1019.75 MB] /dev/hda5 [ 8.82 GB] LVM physical volume /dev/hdd [ 232.89 GB] LVM physical volume /dev/hdb1 [ 6.01 GB] 0 disks 4 partitions 1 LVM physical volume whole disk 2 LVM physical volumes root@darwin:/etc/lvm/backup# lvs lvs lvscan root@darwin:/etc/lvm/backup# lvscan ACTIVE '/dev/HOME_VG/HOME_LV' [17.12 GB] inheritroot@darwin:/etc/lvm/backup# pvdisplay --- Physical volume --- PV Name /dev/hdc1 VG Name HOME_VG PV Size 9.32 GB / not usable 0 Allocatable yes (but full) PE Size (KByte) 4096 Total PE 2385 Free PE 0 Allocated PE 2385 PV UUID XzBfoB-cV7O-hIzQ-3Tjn-jam0-IBXw-MJKV5W--- Physical volume ---
PV Name /dev/hda5 VG Name HOME_VG PV Size 8.82 GB / not usable 0 Allocatable yes PE Size (KByte) 4096 Total PE 2257 Free PE 259 Allocated PE 1998 PV UUID NIO6ey-B8gt-APxD-BEOP-cmpd-UCBf-KY2rLB--- Physical volume ---
PV Name /dev/hdd VG Name HOME_VG PV Size 232.88 GB / not usable 0 Allocatable yes PE Size (KByte) 4096 Total PE 59618 Free PE 59618 Allocated PE 0 PV UUID 2hYdvL-9I7I-tz01-Rhza-ZLyp-tsTp-niP5pJ
Quoted 15 lines
Any help most gratefully appreciated.
Thanks in advance,
Signature · 10 lines
Colm G. Connolly, Tel: +353-1-716-2855 Dept. of Computer Science, Fax: +353-1-269-7262 University College Dublin, MSN: [email protected] Belfield, Dublin 4, �ire. Web: http://inismor.ucd.ie/~colmconn/ _______________________________________________ linux-lvm mailing list [email protected] https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
=======================================================================================
El otro regalo de los viejos.
=======================================================================================
Hi,
Quoted 8 lines · Eduardo
# From LVM how to
xfs
There is no way to shrink XFS file systems.If your are touch lvm2 you must know that about 250Gx1000 and 233x1024.
try use
xfs_repair-n for see the reparis..
I don't think that's an issue here because the history that was posted did not include an xfs_grow after he grew the LV. As such this should IMO be a pure LVM issue, because XFS was not grown.
Quoted 5 lines
I use (but it is only a personal opinion, this is very dangerous) (use again the first commands).
vgextendmy_volume_group/dev/hdc1
lvextend -L250G/dev/HOME_VG/HOME_LV
lvscan
Hmm, I agree that it sounds a bit "dangerous" but it might be worth a shot.
Quoted 5 lines
In this point use
xfs_repair-n
If you see good, usexfs_repair(pray)....
if you don't have luck tryxfs_repair-d (after of this reboot) (read manxfs_repair)
try to mount. (pray again).....
See above, should not be necessary.
~David
Quoted 9 lines · David Mohr
Hi,
Quoted 5 lines · Eduardo
# From LVM how to
xfs
There is no way to shrink XFS file systems.
Quoted 8 lines
Quoted 3 lines
If your are touch lvm2 you must know that about 250Gx1000 and 233x1024.
try use
xfs_repair-n for see the reparis..I don't think that's an issue here because the history that was posted did not include an
xfs_growafter he grew the LV. As such this should IMO be a pure LVM issue, because XFS was not grown.
Yep. I never changed the size of teh XFS filesystem. The issue was with the underlying LVM geometry.
Quoted 10 lines
Quoted 7 lines
I use (but it is only a personal opinion, this is very dangerous) (use again the first commands).
vgextendmy_volume_group/dev/hdc1
lvextend -L250G/dev/HOME_VG/HOME_LV
lvscanHmm, I agree that it sounds a bit "dangerous" but it might be worth a shot.
Well it worked. I've since copied everything off the logical volume and recreated it with the correct size.
Quoted 10 lines
Quoted 7 lines
In this point use
xfs_repair-n
If you see good, usexfs_repair(pray)....
if you don't have luck tryxfs_repair-d (after of this reboot) (read manxfs_repair)
try to mount. (pray again).....See above, should not be necessary.
Thanks to all for the help.
Regards,
Signature · 4 lines
Colm G. Connolly | Tel : +353-1-716-2855 Department of Computer Science | Fax : +353-1-269-7262 University College Dublin (UCD) | Web : http://inismor.ucd.ie/~colmconn Belfield, Dublin 4, �ire | MSN : [email protected]
begin:vcard
fn:Colm G. Connolly
n:Connolly;Colm
org:University College Dublin;Computer Science
adr:;;Belfield;Dublin;;4;Ireland
email;internet:[email protected]
title:Dr
tel;work:+353-1-716-2855
tel;fax:+353-1-269-7262
tel;cell:+353-86-307-8186
x-mozilla-html:FALSE
url:http://inismor.ucd.ie/~colmconn
version:2.1
end:vcard