Ok so I will be going through both of the items listed.

But my problem is our xenserver is with iSCSI SAN's so we do not have any VHD 
files.

# ls 
VG_XenStorage--469b6dcd--8466--3d03--de0e--cc3983e1b6e2-VHD--f5aabea5--2a18--4f24--9f8d--d750a907a699
VG_XenStorage--469b6dcd--8466--3d03--de0e--cc3983e1b6e2-VHD--f5aabea5--2a18--4f24--9f8d--d750a907a699

Now I've tried to run a dd on that file to export and try to recover from that 
its corrupted.  

I'm grasping here and will be looking at more information.  I need to recover 
data from this VG_XenStorage file.

Thank you in advance.  Just wanted to let you know where I am sitting.

Jeremy


-----Original Message-----
From: Dag Sonstebo [mailto:dag.sonst...@shapeblue.com] 
Sent: Monday, September 25, 2017 3:16 AM
To: users@cloudstack.apache.org
Subject: Re: Corrupted HDD

Hi Jeremy,

In addition to Adrian’s walk-through – take a look at the following blog 
article from last year – it should give you some more options to try - 
http://www.shapeblue.com/recovery-of-vms-to-new-cloudstack-instance/ 

Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue

On 25/09/2017, 03:49, "Adrian Sender" <asen...@testlabs.com.au> wrote:

    Hi Jeremy,
    
    Some time ago I worked with Citrix in creating a article to mount and 
recover
    LVMoHBA.
    
    How to Mount Linux LVM Partition in a XenServer Host
    
    http://support.citrix.com/article/CTX117791
    
    The above CTX article only applies to raw LVM LV. In our case the VDIs are 
LVs
    with VHD headers in it. We'll have to use blktap to create tapdisks to open
    the VHD LV before we can create device maps for the partitions / LVs within
    the VDI.
    
    Up to activating the VG, the article still applies. After activating the
    VG/LVs, we'll need to manually create tapdisk to open the VHD LV before 
using
    kpartx to create maps from partition tables.
    
    NOTE: I've included output from my test environment for your reference
    
    1. Create tapdisk
    
    # tap-ctl allocate /dev/xen/blktap-2/tapdev0
    
    2. Spawn a new process
    
    # tap-ctl spawn
    
    tapdisk spawned with pid 30383
    
    # tap-ctl list
    30383 - - - -
    - 0 - - -
    
    4. Attach the tapdisk to the process
    
    tap-ctl attach -p PID -m minor
    
    # tap-ctl attach -p 30383 -m 0
    # tap-ctl list
    30383 0 0 - -
    
    
    5. Open the VHD LV
    
    Note you may need to activate the LVM first with lvchange -ay
    
    # tap-ctl open -p 30383 -m 0 -a
    
vhd:/dev/VG_XenStorage-b1415cf5-07e2-14fa-cbf8-6490751da242/VHD-182ce043-bf98-45d9-926b-595bbd82ed8a
    
    6. Verify
    
    # tap-ctl list 
    30383 0 0 vhd
    
/dev/VG_XenStorage-b1415cf5-07e2-14fa-cbf8-6490751da242/VHD-182ce043-bf98-45d9-926b-595bbd82ed8a
    
    7. Create device maps from partition tables using kpartx
    
    kpartx -av /dev/xen/blktap-2/tapdev0
    
    # kpartx -av /dev/xen/blktap-2/tapdev0
    add map tapdev0p1 (252:5): 0 1024000 linear /dev/xen/blktap-2/tapdev0 2048
    add map tapdev0p2 (252:6): 0 32872448 linear /dev/xen/blktap-2/tapdev0 
1026048
    
    NOTE: in this case, it is a CentOS 7 VDI, contains a /boot partition and VG 
-
    linux and 2 LVs (root, home).
    
    Device maps were created in
    /dev/mapper/tapdev0pN
    
    8. Mount 1st partition
    
    # mount /dev/mapper/tapdev0p1 /mnt/boot
    
    9. Activate VG
    
    # vgchange -a y
    2 logical volume(s) in volume group "linux" now active
    
    # lvscan
    ACTIVE '/dev/linux/root' [13.67 GB] inherit
    ACTIVE '/dev/linux/home' [2.00 GB] inherit
    
    
    10. Mount root and home LVs
    
    mount -t xfs /dev/linux/root /mnt/root
    
    NOTE: XenServer 6.2 kernel does NOT support XFS
    
    mount -t ext4 /dev/linux/home /mnt/home
    
    11. After backing up data, reverse the procedure to release resources
    
    List partition mappings
    
    # kpartx -lv /dev/xen/blktap-2/tapdev0
    tapdev0p1 : 0 1024000 /dev/xen/blktap-2/tapdev0 2048
    tapdev0p2 : 0 32872448 /dev/xen/blktap-2/tapdev0 1026048
    
    De-active the VG (all LVs)
    
    # vgchange -an linux
    0 logical volume(s) in volume group "linux" now active
    
    Delete partition mappings
    
    # kpartx -dv /dev/xen/blktap-2/tapdev0
    del devmap : tapdev0p2
    del devmap : tapdev0p1
    
    12. Release the blktap resources
    
    # tap-ctl list
    30383 0 0 vhd
    
/dev/VG_XenStorage-b1415cf5-07e2-14fa-cbf8-6490751da242/VHD-182ce043-bf98-45d9-926b-595bbd82ed8a
    
    # tap-ctl close -p 30383 -m 0
    [root@xenserver-zilblqhl /]# tap-ctl list
    30383 0 0x2 - -
    
    # tap-ctl destroy -p 30383 -m 0
    [root@xenserver-zilblqhl /]# tap-ctl list
    
    Regards,
    Adrian Sender
    
    
    
    -----
dag.sonst...@shapeblue.com
www.shapeblue.com
53 Chandos Place, Covent Garden, London  WC2N 4HSUK @shapeblue
  
 

----- Original Message -----------
    From: Jeremy Peterson <jpeter...@acentek.net>
    To: "users@cloudstack.apache.org" <users@cloudstack.apache.org>
    Sent: Sun, 24 Sep 2017 22:38:29 +0000
    Subject: Corrupted HDD
    
    > So I need to know if anyone can drop a hint on this.
    > 
    > How can i recover data from cloudstack with xenserver.  One of the 
    > storage LUN's got 100% full.  I was carefully deleting un-associated 
    > disks from the LUN.  A disk that had no VM attached.  Then when one 
    > of the VM's rebooted it came online with no bootable disk found.
    > 
    > Now I'm thinking this over that one of those disks were the a master 
    > UUID and thats why my VM's wont boot.  Can that been fixed?
    > 
    > I look in primary storage and can find the UUID of a disk matches a 
    > volume in /dev/mapper/VG.....
    > 
    > Can I pull that disk down and create a VHD to deploy a template and 
    > deploy a new vm from that vhd file?
    > 
    > Can I dd that disk to export to anything to try and recover data?  
    > Office files or PDF's are critical.
    > 
    > Does anyone know if there are any good consulting companies with 
    > Citrix or if Citrix can help with this?
    > 
    > Jeremy
    ------- End of Original Message -------
    
    

Reply via email to