LVM2: vgcfgrestore lvm behavior
I had originally posted this issue over on the Fedora Forums but it really belongs here.
---------------
I have an LVM backup stored in a file that now I would like to list using vgcfgrestore.
================================================
Under LVM1 all I needed was:
# vgcfgrestore -ll -f /tmp/.mgwork/Volume00.conf vgcfgrestore -- this is a backup of volume group "Volume00" --- Volume group --- VG Name Volume00 VG Access read/write VG Status NOT available/resizable VG # 0 MAX LV 256 Cur LV 2 Open LV 0 MAX LV Size 255.99 GB Max PV 256 Cur PV 1 Act PV 1 VG Size 50.77 GB PE Size 4 MB Total PE 12998 Alloc PE / Size 2500 / 9.77 GB Free PE / Size 10498 / 41.01 GB VG UUID e8Z7pY-n4os-xpVe-L9V8-t13M-g6RC-xv65cy
--- Logical volume ---
LV Name /dev/Volume00/LogVol00
VG Name Volume00
LV Write Access read/write
LV Status available
LV # 1
# open 0 LV Size 4.88 GB Current LE 1250 Allocated LE 1250 Allocation next free Read ahead sectors 10000 Block device 58:1
--- Logical volume ---
LV Name /dev/Volume00/LogVol01
VG Name Volume00
LV Write Access read/write
LV Status available
LV # 2
# open 0 LV Size 4.88 GB Current LE 1250 Allocated LE 1250 Allocation next free Read ahead sectors 10000 Block device 58:6
--- Physical volume ---
PV Name /dev/hdc5
VG Name Volume00
PV Size 50.78 GB [106494822 secs] / NOT usable 4.19 MB [LVM: 178 KB] PV# 1
PV Status available
Allocatable yes
Cur LV 2
PE Size (KByte) 4096
Total PE 12998
Free PE 10498
Allocated PE 2500
PV UUID vC0Rl6-A3u0-RhjN-2B4n-DQEx-llBB-lVTt19
================================================
Under LVM2 when I try this I get this output:
# vgcfgrestore -ll -f /tmp/.mgwork/VolGroup00 Please specify a *single* volume group to restore. # vgcfgrestore -ll -f /tmp/.mgwork/VolGroup00 -n VolGroup00 Please specify a *single* volume group to restore. # vgcfgrestore -ll -f /tmp/.mgwork/VolGroup00 VolGroup00
File: /etc/lvm/archive/VolGroup00_00000.vg VG name: VolGroup00
Description: Created *before* executing 'vgdisplay --ignorelockingfailure -v VolGroup00' Backup Time: Sat Oct 28 13:29:00 2006
File: /etc/lvm/backup/VolGroup00
VG name: VolGroup00
Description: Created *after* executing 'vgdisplay
--ignorelockingfailure -v VolGroup00'
Backup Time: Sat Oct 28 13:29:00 2006
Hmm... Ok, but I'm not interested in those files. I'm interested in the file I declared on the command line with the -f flag.
================================================
as you can see under LVM2 it does not dump the backup VolGroup00 stored in my backup file. I can 'cat' the file and it looks normal:
# cat /tmp/.mgwork/VolGroup00 # Generated by LVM2: Sat Oct 28 13:29:00 2006
contents = "Text Format Volume Group"
version = 1
description = "Created *after* executing 'vgdisplay --ignorelockingfailure -v VolGroup00'"
creation_host = "localhost.localdomain" # Linux localhost.localdomain 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2
006 i686creation_time = 1162056540 # Sat Oct 28 13:29:00 2006
VolGroup00 {
id = "RZOOeA-hKQ7-MCDq-7NH9-S8sE-g5ec-dlrHZE"
seqno = 3
status = ["RESIZEABLE", "READ", "WRITE"]extent_size = 65536 # 32 Megabytesmax_lv = 0max_pv = 0
physical_volumes {
pv0 {
id = "DWhnOR-emk3-dlHj-2QzW-V41j-pgoh-CdXRtf"
device = "/dev/hdc3" # Hint only
status = ["ALLOCATABLE"]pe_start = 384pe_count = 2434 # 76.0625 Gigabytes
}
pv1 {
id = "NWfOu4-8kQC-D3uc-hw14-d5bi-Sa2o-JgVH4f"
device = "/dev/hde1" # Hint only
status = ["ALLOCATABLE"]pe_start = 384pe_count = 2454 # 76.6875 Gigabytes
}
}
logical_volumes {
LogVol00 {
id = "skZ1EI-9lKu-2sWj-heaj-W41X-kyJh-tHtkvA"
status = ["READ", "WRITE", "VISIBLE"]segment_count = 2
segment1 {start_extent = 0extent_count = 2454 # 76.6875 Gigabytes
type = "striped"stripe_count = 1 # linear
stripes = [
"pv1", 0
]
}
segment2 {start_extent = 2454extent_count = 2400 # 75 Gigabytes
type = "striped"stripe_count = 1 # linear
stripes = [
"pv0", 0
]
}
}
LogVol01 {
id = "1JDMbX-qLqX-TIn6-MsPD-ErE5-mFwz-TAmBkH"
status = ["READ", "WRITE", "VISIBLE"]segment_count = 1
segment1 {start_extent = 0extent_count = 32 # 1024 Megabytes
type = "striped"stripe_count = 1 # linear
stripes = [
"pv0", 2400
]
}
}
}
}
================================================
Is there some undocumented syntax change for vgcfgrestore under LVM2?
According to the man page it should work the way I am using it.
??:(
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 7 lines · Gerry Reno
Is there some undocumented syntax change for vgcfgrestore under LVM2?
According to the man page it should work the way I am using it.
??:(
Hi Gerry,
Under LVM2, the --file option is only used when you are actually restoring metadata. For example:
vgcfgrestore --file /tmp/vg0_backup.vg vg0
Would restore the vg0 volume group's metadata from /tmp/vg0_backup.vg.
Currently, -l and -ll will only look at the backups in the /etc/lvm/archive directory.
Regards,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFFa0fq6YSQoMYUY94RAsPhAJ9xRBkcU5Z59zBBp7Vlk4F+9D/7KgCfb+0p 5VIEC7yyu5pglNZJQBWip/w=
=9L+j
-----END PGP SIGNATURE-----
Quoted 8 lines · --- "Bryn M. Reeves
Hi Gerry,
Under LVM2, the --file option is only used when you are actually restoring metadata. For example:
vgcfgrestore --file
/tmp/vg0_backup.vgvg0
Quoted 9 lines
Would restore the vg0 volume group's metadata from
/tmp/vg0_backup.vg.Currently, -l and -ll will only look at the backups in the
/etc/lvm/archivedirectory.Regards,
Bryn.
Bryn,
The ability to use -l and -ll to review an LVM backup file is very
useful when used with -f. I'm sure I'm not the only one that keeps LVM backup files in locations other than /etc/lvm/archive. What if you lose /etc and are booted from rescue? Can RedHat please restore the lost functionality? This was very useful under LVM1.
thx,
Gerry