Volume aus Versehen entfernt - wie wiederherstellen?

  • Hallo,


    ich hatte einen akuten Fehler an einer Festplatte und wollte deshalb das Volume unmounten. Leider habe ich entfernen ausgewählt und begriff zu spät, das wohl nicht so gut war.


    Nun die Frage an Euch kann man das Volume wiederherstellen?


    Ich sehe mit lvdisplay ein inaktives Volume. Kann man das wieder aktivieren?

    Oder kann man mit vgcfgrestore eine alte Konfiguration wiederherstellen?


    Vielen Dank für Eure Antworten

  • Der Button ist bei mir ausgegraut. Allerdings ist der Speicherpool also die Volume Group noch da. Die sehe ich auch noch in der Gui.


    Ich hab noch mit vgcfgbackup die aktuelle Konfiguration ausgelesen.


    Code
    # Generated by LVM2 version 2.02.105(2) (2014-01-20): Tue Oct 11 22:20:28 2016contents = "Text Format Volume Group"version = 1description = "vgcfgbackup -f /tmp/vg01 vg1"creation_host = "QNAP569L"	# Linux QNAP569L 3.4.6 #1 SMP Thu Sep 1 06:59:09 CST 2016 x86_64creation_time = 1476217228	# Tue Oct 11 22:20:28 2016vg1 {	id = "o2cNmm-HPTE-aBfi-GNKz-Ub8B-3fxf-bbCW3z"	seqno = 55	format = "lvm2" # informational	status = ["RESIZEABLE", "READ", "WRITE"]	flags = []	extent_size = 8192		# 4 Megabytes	max_lv = 0	max_pv = 0	metadata_copies = 0	physical_volumes {		pv0 {			id = "UAhDX0-WACj-6MZY-K36b-07jE-vgBU-sAodvT"			device = "/dev/md1"	# Hint only			status = ["ALLOCATABLE"]			flags = []			dev_size = 15548474880	# 7.24032 Terabytes			pe_start = 2048			pe_count = 1898007	# 7.24032 Terabytes		}	}	logical_volumes {		lv544 {			id = "qhQpEq-iitN-jDyu-3TEZ-YRxz-ivkM-jBsj2d"			status = ["READ", "WRITE", "VISIBLE"]			flags = []			creation_host = "QNAP569L"			creation_time = 1409486370	# 2014-08-31 13:59:30 +0200			read_ahead = 4096			segment_count = 4			segment1 {				start_extent = 0				extent_count = 2360	# 9.21875 Gigabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 0				]			}			segment2 {				start_extent = 2360				extent_count = 2360	# 9.21875 Gigabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 236036				]			}			segment3 {				start_extent = 4720				extent_count = 400	# 1.5625 Gigabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 472073				]			}			segment4 {				start_extent = 5120				extent_count = 13860	# 54.1406 Gigabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 1423505				]			}		}		tp1 {			id = "oIRzJX-mOPO-XnBX-v60g-zZx4-3qz1-vFs1eB"			status = ["READ", "WRITE", "VISIBLE"]			flags = ["ERROR_WHEN_FULL"]			creation_host = "QNAP569L"			creation_time = 1409486540	# 2014-08-31 14:02:20 +0200			segment_count = 1			segment1 {				start_extent = 0				extent_count = 1874931	# 7.15229 Terabytes				type = "thin-pool"				metadata = "tp1_tmeta"				pool = "tp1_tdata"				transaction_id = 2				chunk_size = 2048	# 1024 Kilobytes				discards = "passdown"				zero_new_blocks = 1			}		}		tp1_tmeta {			id = "xq8Kld-a7iX-BL2D-vJoN-AD8M-bul2-vfbePg"			status = ["READ", "WRITE"]			flags = []			creation_host = "QNAP569L"			creation_time = 1409486540	# 2014-08-31 14:02:20 +0200			segment_count = 1			segment1 {				start_extent = 0				extent_count = 4096	# 16 Gigabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 231940				]			}		}		tp1_tdata {			id = "FQlunS-JuUu-6Itx-VCHp-oXnB-lv2e-PsfvxV"			status = ["READ", "WRITE"]			flags = []			creation_host = "QNAP569L"			creation_time = 1409486540	# 2014-08-31 14:02:20 +0200			segment_count = 4			segment1 {				start_extent = 0				extent_count = 229580	# 896.797 Gigabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 2360				]			}			segment2 {				start_extent = 229580				extent_count = 233677	# 912.801 Gigabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 238396				]			}			segment3 {				start_extent = 463257				extent_count = 951032	# 3.6279 Terabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 472473				]			}			segment4 {				start_extent = 1414289				extent_count = 460642	# 1.75721 Terabytes				type = "striped"				stripe_count = 1	# linear				stripes = [					"pv0", 1437365				]			}		}	}}

    zum Vergleich eine alte Konfiguration:


    In der alten Konfiguration ist noch der lv1 Block enthalten.



    Was bedeutet das?

  • Ja, Du hast recht.


    Ich habe jetzt noch eine config gefunden, da steht drin "Created *before* executing '/sbin/lvremove -f /dev/mapper/vg1-lv1'"


    Der support hat sich nicht sehr bemüht, sondern nur geschrieben, das alles weg wäre.


    Aber ich will das nicht so recht glauben. Oder muß ich das?


    Wie gesagt, ich will ja nicht aufgeben, aber ich habe jetzt mal folgendes ausprobiert.


    Code
    vgcfgrestore vg1 --test --force -f /etc/config/lvm/archive/vg1_00057-844058415.vg 
      TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
      WARNING: Forced restore of Volume Group vg1 with thin volumes.
      Restored volume group vg1

    Das sieht interessant aus, aber ich traue mich nicht so recht es ohne --test auszuführen, da ich nicht verstehe, was da passiert.

  • Mit dem Volumemanagement von QNAP kenne ich mich noch nicht so gut aus. Wahrscheinlich bleibt dir nur Try & Error.
    Du müsstest ja alle Änderungen in der richtigen Reihenfolge rückgängig machen.

  • Siehst Du und ich hatte gehofft Du bist mein lvm-guru. ;)


    Dann probiere das mal aus.


    also bis jetzt sieht es gut aus.

    Code
    lvscan  inactive          '/dev/vg1/lv544' [74.14 GiB] inherit  ACTIVE            '/dev/vg1/tp1' [7.15 TiB] inherit  inactive          '/dev/vg1/lv1' [6.84 TiB] inherit



    dann habe ich lvchange -a y /dev/mapper/vg1-lv ausgeführt.


    Code
    lvchange -a y /dev/mapper/vg1-lv1  WARNING: Thin pool target does not support error if no space (needs version >= 1.10).  device-mapper: reload ioctl on  failed: No data available

    dann sieht es so aus.



    Doch

    Code
    lvscan  inactive          '/dev/vg1/lv544' [74.14 GiB] inherit  ACTIVE            '/dev/vg1/tp1' [7.15 TiB] inherit  ACTIVE            '/dev/vg1/lv1' [6.84 TiB] inherit
    Code
    lvdisplay   --- Logical volume ---  LV Path                /dev/vg1/lv544  LV Name                lv544  VG Name                vg1  LV UUID                qhQpEq-iitN-jDyu-3TEZ-YRxz-ivkM-jBsj2d  LV Write Access        read/write  LV Creation host, time QNAP569L, 2014-08-31 13:59:30 +0200  LV Status              NOT available  LV Size                74.14 GiB  Current LE             18980  Segments               4  Allocation             inherit  Read ahead sectors     4096  --- Logical volume ---  LV Name                tp1  VG Name                vg1  LV UUID                oIRzJX-mOPO-XnBX-v60g-zZx4-3qz1-vFs1eB  LV Write Access        read/write  LV Creation host, time QNAP569L, 2014-08-31 14:02:20 +0200  LV Pool transaction ID 1  LV Pool metadata       tp1_tmeta  LV Pool data           tp1_tdata  LV Pool chunk size     1.00 MiB  LV Zero new blocks     yes  LV Status              available  # open                 0  LV Size                7.15 TiB  Allocated pool data    0.00%  Allocated metadata     0.02%  Allocated pool chunks  0  Current LE             1874931  Segments               1  Allocation             inherit  Read ahead sectors     auto  - currently set to     4096  Block device           253:4  --- Logical volume ---  LV Path                /dev/vg1/lv1  LV Name                lv1  VG Name                vg1  LV UUID                K2mTFP-2y4j-Zrnt-5aSA-20b9-flwg-4TYe5L  LV Write Access        read/write  LV Creation host, time QNAP569L, 2014-08-31 14:02:21 +0200  LV Pool name           tp1  LV Thin device ID      1  LV Status              available  # open                 0  LV Size                6.84 TiB  Mapped sectors         0  Current LE             1792000  Segments               1  Allocation             inherit  Read ahead sectors     4096  - currently set to     256  Block device           253:0

    Doch was brauche ich jetzt noch? Ich vermute ein Mapper-Device? Denn




    Code
    ll /dev/mapper/
    drwxr-xr-x    2 admin    administ       140 Oct 11 19:40 ./
    drwxr-xr-x   14 admin    administ     19.7k Oct 16 17:20 ../
    crw-------    1 admin    administ   10, 236 Oct 11 21:39 control
    brw-------    1 admin    administ  253,   4 Oct 11 19:40 vg1-tp1
    brw-------    1 admin    administ  253,   3 Oct 11 19:40 vg1-tp1-tpool
    brw-------    1 admin    administ  253,   2 Oct 11 19:40 vg1-tp1_tdata
    brw-------    1 admin    administ  253,   1 Oct 11 19:40 vg1-tp1_tmeta

    sieht noch nicht gut aus.



    Kannst du mir bitte sagen was ich alles noch anlegen muß. und wie.

  • Habe ich natürlich sofort ausprobiert.

    Code
    /etc/init.d/init_lvm.shChanging old config name...mv: unable to rename `/etc/config/qdrbd.conf': No such file or directoryReinitialing...Detect disk(8, 0)...dev_count ++ = 0Detect disk(8, 16)...dev_count ++ = 1Detect disk(8, 32)...dev_count ++ = 2Detect disk(8, 48)...dev_count ++ = 3Detect disk(8, 64)...dev_count ++ = 4Detect disk(8, 80)...ignore non-root enclosure disk(8, 80).Detect disk(8, 0)...Detect disk(8, 16)...Detect disk(8, 32)...Detect disk(8, 48)...Detect disk(8, 64)...Detect disk(8, 80)...ignore non-root enclosure disk(8, 80).sys_startup_p2:got called count = -1Done

    aber immer noch kein mapper-Device

    Code
    ll /dev/mapper/
    drwxr-xr-x    2 admin    administ       140 Oct 16 17:50 ./
    drwxr-xr-x   14 admin    administ     19.7k Oct 16 17:50 ../
    crw-------    1 admin    administ   10, 236 Oct 11 21:39 control
    brw-------    1 admin    administ  253,   4 Oct 11 19:40 vg1-tp1
    brw-------    1 admin    administ  253,   3 Oct 11 19:40 vg1-tp1-tpool
    brw-------    1 admin    administ  253,   2 Oct 11 19:40 vg1-tp1_tdata
    brw-------    1 admin    administ  253,   1 Oct 11 19:40 vg1-tp1_tmeta
  • Wieder danke!


    vgmknodes -vvv vg1 hat das mapper device angelegt.


    Aber ich habe das Gefühl, das mir noch einiges fehlt. Wo ist eigentlich dieses Cachedev-Device oder brauche ich das nicht?


    hab nochmal das init_lvm-Skript ausgeführt. In der Gui sehe ich jetzt unter dem Speicherppool ein Volume ohne Namen (-) und den Hinweis entladen.

  • wie folgt:

    Code
    ll /dev/mapper/
    drwxr-xr-x    2 admin    administ       160 Oct 17 00:07 ./
    drwxr-xr-x   14 admin    administ     19.7k Oct 16 17:50 ../
    crw-------    1 admin    administ   10, 236 Oct 11 21:39 control
    brw-------    1 admin    administ  253,   0 Oct 17 00:07 vg1-lv1
    brw-------    1 admin    administ  253,   4 Oct 11 19:40 vg1-tp1
    brw-------    1 admin    administ  253,   3 Oct 11 19:40 vg1-tp1-tpool
    brw-------    1 admin    administ  253,   2 Oct 11 19:40 vg1-tp1_tdata
    brw-------    1 admin    administ  253,   1 Oct 11 19:40 vg1-tp1_tmeta
  • Das ist der aktuelle Stand:


    Code
    cat /etc/config/qlvm.conf [Global]poolIdBitmap=0x2member_1_Pool=1memberIdBitmap=0x2tpIdBitmap=0x2lvIdBitmap=0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002member_1_LV_Bitmap=0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002[POOL_1]poolId=1tpId=1poolName=vg1flag=0x0threshold=0uuid=o2cNmm-HPTE-aBfi-GNKz-Ub8B-3fxf-bbCW3zoverThreshold=nomember_0=1memberBitmap=1[MEMBER_1]memberId=1memberName=/dev/md1uuid=f2b19cf3:41850704:1635a3bf:59cc2f6bmemberUuid=UAhDX0-WACj-6MZY-K36b-07jE-vgBU-sAodvT[TP_1]tpId=1tpName=/dev/mapper/vg1-tp1uuid=oIRzJX-mOPO-XnBX-v60g-zZx4-3qz1-vFs1eBtpSize=15359434752metaSize=33554432metaSpareSize=0[LV_1]lvId=1poolId=1layout=0flag=0x20000threshold=0lvName=/dev/mapper/vg1-lv1uuid=K2mTFP-2y4j-Zrnt-5aSA-20b9-flwg-4TYe5LcompleteFsResize=yesoverThreshold=nolvSize=14680064000member_0=1memberBitmap=1volName=[LV_544]lvId=544poolId=1layout=0flag=0x200000threshold=0lvName=/dev/mapper/vg1-lv544uuid=qhQpEq-iitN-jDyu-3TEZ-YRxz-ivkM-jBsj2dcompleteFsResize=yesoverThreshold=nolvSize=155484160member_0=1memberBitmap=1volName=

    nochzusatzlich der output von /etc/config/ssdcache.conf

    Einmal editiert, zuletzt von RMaTsm1f ()

  • Was bedeutet das?