0

I created Volume group on 2TB ISCSI Block device . And on that I created Volume group and added the entry in fstab with options _netdev. But after reboot it didn't come online.

What happened and what actions I took

  1. Iscsi initiator didn't log in, so I had to manually login to target using iscsiadm utlity, and then storage appeared in /dev/disk/by-path and in fdisk

  2. When used fdisk /dev/sdc it showed Partition type was back to gpt not LVMso I had to reset it to "8e" LVM.

  3. When used fdisk /dev/sdc it showed Partition type was back to gpt not LVMso I had to reset it to "8e" LVM.

  4. Looked for pv uuid in /etc/lvm/backup/vg_bacula_backups and created PV using

    # pvcreate --uuid WGCG9m-tl2b-840R-wSFS-w1oI-C1Pw-bcTTl4 --restorefile \
      /etc/lvm/archive/vg_bacula_backups_00000-6260716.vg /dev/sdc1
    

And pv was successfully created using old uuid and it appeared in pvscan

  1. Restore Volume Group using

    # vgcfgrestore -f /etc/lvm/archive/vg_bacula_backups_00001-1157414378.vg vg_bacula_backups
    
  2. Now when I tried to activate the VG using vgdisplay -ay vg_bacula_backups. It says

0 logical volume(s) in volume group "vg_bacula_backups" now active

Now what do I have to do to bring back the LV keeping the data intact ???

fdisk -l output

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 2199.0 GB, 2199023255552 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 1048576 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      267350  2147483647+  8e  Linux LVM
Partition 1 does not start on physical sector boundary.

parted output

Model: FreeBSD iSCSI Disk (scsi)
Disk /dev/sdc: 2199GB
Sector size (logical/physical): 512B/16384B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  2199GB  2199GB               primary  lvm
  • That sounds like you used an old version of fdisk that hadn't been GPT aware, on a disk that used GPT partition table. And then did all the wrong things... please show both fdisk -l and parted -l for this disk. – frostschutz May 8 '16 at 8:25
  • ok one thing , Now this time i just run "# vgcfgrestore vg_bacula_backups " without pointing it to /etc/lvm/archive and run vgchange -ay VG. it activated the volume. But when i tried to mount using "mount -t ext4 /dev/vg_bacula_backups/bacula /SysBackups" , it slapped me with this error "mount: you must specify the filesystem type" – OmiPenguin May 8 '16 at 8:31
  • And another thing there are multiple entries of vg_bacula_backups like "vg_bacula_backups_00000-6260716.vg vg_bacula_backups_00001-1157414378.vg vg_bacula_backups_00002-1768584833.vg vg_bacula_backups_00003-970443479.vg" what are these ??? – OmiPenguin May 8 '16 at 8:34
  • And what's cat /sys/block/sdc/sdc1/start? (It should be 2048.) As for your VG backup files, try vgcfgrestore --list VG it should show a description for each file, that should help you pick the right one (but don't restore until you know you actually need to). – frostschutz May 8 '16 at 8:47
  • For "cat /sys/block/sdc/sdc1/start" output is 1. And for vgcfgrestore --list VG output is No archives found in /etc/lvm/archive – OmiPenguin May 8 '16 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.