sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #65096
Re: Oedelagt LVM-partition
Kristian.Hogh@xxxxxx wrote:
Hvilket device brugte du som PV?
Jeg brugte hda6, som lå på en logisk partition hda4.
Da det gik galt tog jeg en kopi af partitionen med dd.
Den hedder nu hdb4.
Da hele mit system reelt lå på lvm-partitionen bruger jeg nu en knoppix
til mine redningsforsøg.
Jeg havde dog en rod-partition hvor bla. /etc ligger. Den har jeg adgang
til som hdb2. Derfor har jeg tilføjet -f
/mnt/hdb2/etc/lvmconf/volgroup.conf til lvm-kommandoerne.
Send evt output af "vgcfgrestore -l -l -n volgroup"
root@ttyp0[knoppix]# vgcfgrestore -f /mnt/hdb2/etc/lvmconf/volgroup.conf
-l -l -n volgroup
--- Volume group ---
VG Name volgroup
VG Access read/write
VG Status NOT available/resizable
VG # 0
MAX LV 256
Cur LV 6
Open LV 0
MAX LV Size 255.99 GB
Max PV 256
Cur PV 1
Act PV 1
VG Size 58.65 GB
PE Size 4 MB
Total PE 15014
Alloc PE / Size 13734 / 53.65 GB
Free PE / Size 1280 / 5 GB
VG UUID Fb1hL1-IXBL-zyod-f39g-a1k4-2Yi2-pFPCRu
--- Logical volume ---
LV Name /dev/volgroup/ogg
VG Name volgroup
LV Write Access read/write
LV Status NOT available
LV # 1
# open 0
LV Size 9.27 GB
Current LE 2372
Allocated LE 2372
Allocation next free
Read ahead sectors 10000
Block device 58:0
--- Logical volume ---
LV Name /dev/volgroup/film
VG Name volgroup
LV Write Access read/write
LV Status NOT available
LV # 2
# open 0
LV Size 26.30 GB
Current LE 6732
Allocated LE 6732
Allocation next free
Read ahead sectors 10000
Block device 58:1
--- Logical volume ---
LV Name /dev/volgroup/usr
VG Name volgroup
LV Write Access read/write
LV Status NOT available
LV # 3
# open 0
LV Size 2.50 GB
Current LE 640
Allocated LE 640
Allocation next free
Read ahead sectors 10000
Block device 58:2
--- Logical volume ---
LV Name /dev/volgroup/usrlocal
VG Name volgroup
LV Write Access read/write
LV Status NOT available
LV # 4
# open 0
LV Size 1.20 GB
Current LE 308
Allocated LE 308
Allocation next free
Read ahead sectors 10000
Block device 58:3
--- Logical volume ---
LV Name /dev/volgroup/home
VG Name volgroup
LV Write Access read/write
LV Status NOT available
LV # 5
# open 0
LV Size 8.32 GB
Current LE 2129
Allocated LE 2129
Allocation next free
Read ahead sectors 10000
Block device 58:4
--- Logical volume ---
LV Name /dev/volgroup/iso
VG Name volgroup
LV Write Access read/write
LV Status NOT available
LV # 6
# open 0
LV Size 6.07 GB
Current LE 1553
Allocated LE 1553
Allocation next free
Read ahead sectors 1024
Block device 58:5
--- Physical volume ---
PV Name /dev/hda6
VG Name volgroup
PV Size 58.65 GB [123007185 secs] / NOT usable 4.19 MB
[LVM: 186 KB]
PV# 1
PV Status available
Allocatable yes
Cur LV 6
PE Size (KByte) 4096
Total PE 15014
Free PE 1280
Allocated PE 13734
PV UUID 7ppN6s-YT5R-a3w0-jSr2-WEk2-r5E9-uyqAfW
-
Ovenstående giver meget god mening.
root@ttyp0[knoppix]# vgcfgrestore -f
/mnt/hdb2/etc/lvmconf/volgroup.conf
-t -n volgroup /dev/hdb4
vgcfgrestore -- backup of volume group "volgroup" is consistent
vgcfgrestore -- physical volume "/dev/hdb4" doesn't belong to volume
group "volgroup"
Send output fra "vgcfgrestore -v -n volgroup /dev/hdb4"
root@ttyp0[knoppix]# vgcfgrestore -f /mnt/hdb2/etc/lvmconf/volgroup.conf
-v -n volgroup /dev/hdb4
vgcfgrestore -- locking logical volume manager
vgcfgrestore -- restoring volume group "volgroup" from
"/mnt/hdb2/etc/lvmconf/volgroup.conf"
vgcfgrestore -- checking existence of "/mnt/hdb2/etc/lvmconf/volgroup.conf"
vgcfgrestore -- reading volume group data for "volgroup" from
"/mnt/hdb2/etc/lvmconf/volgroup.conf"
vgcfgrestore -- reading physical volume data for "volgroup" from
"/mnt/hdb2/etc/lvmconf/volgroup.conf"
vgcfgrestore -- reading logical volume data for "volgroup" from
"/mnt/hdb2/etc/lvmconf/volgroup.conf"
vgcfgrestore -- checking volume group consistency of "volgroup"
vgcfgrestore -- checking volume group consistency of "volgroup"
vgcfgrestore -- physical volume "/dev/hdb4" doesn't belong to volume
group "volgroup"
evt. med "-d"
findes ikke
Har du kørt pvcreate?
Ja, i mit oprindelige redningsforsøg, ikke efter at have skrevet til listen.
Har din PV skiftet navn?
Ja, hedder hdb4 mu, hed hda4 før. Tænkte ikke på at det betød noget.
Hvis du ønsker at anvende et andet device som PV skal du bruge "-o"
f.eks.
vgdisplay -v volgroup | grep PV.Name"
root@ttyp0[knoppix]# vgdisplay -v volgroup
vgdisplay -- volume group "volgroup" not found
Da den ikke kan finde volgroup ville jeg ikke prøve de andre.
/dev/hdb3
vgcfgbackup volgroup
pvcreate /dev/hdb4
vgcfgrestore -o /dev/hdb3 -n volgroup /dev/hdb4
hmmm.
Kan det tvinges igennem, eller skal jeg prøve at lave en ny VG der
hedder volgroup hvor jeg tilføjer hdb4.
Nej!
Nej til begge spørgsmål?
Derefter kan du aktivere din VG i RO (vgchange -a r vg01)
Ja, så skal du installere HP-UX først :-)
"vgchange -r y vg01" i stedet.
Der er ikke nogen -r parameter på min vgchange
Nej, så skal du installere HP-UX først :-)
Oki, jeg læser bare ovenstående som om at vgchange -a r vg01 var til
HP-UX, mens vgchange -r y vg01 var til linux.
Mvh, Niels Sandmann
References