M
M
Maxim Ryazanov2017-10-23 12:12:49
linux
Maxim Ryazanov, 2017-10-23 12:12:49

How to restore LVM?

Tell me, in what sequence is it correct to reinitialize one LVM disk so as not to affect others that are currently running?
There is / dev / sdd
On it, the / dev / sdd1 partition, declared as pv
On this pv, one vg: vg-backup
On this vg, one lv: vg-backup / data
The disk was pulled, apparently. The logs show that it stops, and then start. It seems that the uuid has changed or the letter (there was sdc, it's not immediately clear yet - there is no direct access to the logs)
In general, how to initialize from scratch, saving the information if possible?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Ryazanov, 2017-10-23
@Gaernebjorn

Found the answer. Everything worked out. Indeed, if you take out a live sata disk in debian, and then insert it (observing all power off and on), it will change both ata#, scsi 0:0:#:0 and UUID (I’m not sure about UUID, multi-book, could not carefully evaluate)
Here is the solution https://www.linuxtechi.com/fixing-lvm-io-errors/
If the link ever goes sour, here's the gist:
Deactivate lv, then vg. Then back scan and activate vg and finally scan and activate lv.

1) Check which Volume Group have the issue , run “vgscan” command .
2) Find out the Logical Volumes attached with that Volume Group .
3) Inactive the logical volumes as :
  # lvchange -an <lv-name>
4) Inactive Volume group as :
 #  vgchange -an <vg-name>
5) Again Scan Volume group using “vgscan” .
6) Now activate the Volume Group :
# vgchange -ay <volume-group-name>
7) Run command “lvscan” , the error should be gone now .
8) Now activate the Logical Volume Name :
# lvchange -ay <lv-name>

If it was with a suddenly detached device, like mine, then this may not work right away.
Then carefully extinguish it again
echo 1 > /sys/block/sdX/device/delete
Physically disable (remove)
Physically enable (insert)
Run
echo 0 0 0 > /sys/class/scsi_host/hostY/scan
And dance all the top dances with a tambourine again.
X is easily determined, it shouldn't change, but I didn't understand how, I had from 0 to 4. I went through everyone, they say it's not too dangerous :) I didn't even understand on which disk it suddenly appeared - I'm faster than them fingered what he answered. Like this:
Oct 23 16:29:53 node2 kernel: ata11.00: ATA-8: Hitachi HUA722010CLA330, JP4OA3EA, max UDMA/133
Oct 23 16:29:53 node2 kernel: ata11.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
Oct 23 16:29:53 node2 kernel: ata11.00: configured for UDMA/133
Oct 23 16 :29:53 node2 kernel: scsi 0:0:6:0: Direct-Access ATA Hitachi HUA72201 JP4O PQ: 0 ANSI: 5
Oct 23 16:29:53 node2 kernel: sd 0:0:6:0: [sdd ] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
Oct 23 16:29:53 node2 kernel: sd 0:0:6:0: Attached scsi generic sg2 type 0
Oct 23 16:29:53 node2 kernel: sd 0:0:6:0: [sdd] Write Protect is off
Oct 23 16:29:53 node2 kernel: sd 0:0:6:0: [sdd] Write cache: enabled, read cache: enabled, doesn't t support DPO or FUA
Oct 23 16:29:53 node2 kernel:sdd:sdd1

X
xp3, 2017-10-23
@xp3

vgscan && vgchange -ay vg-backup to start

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question