cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag Sonstebo <>
Subject Re: Corrupted HDD
Date Mon, 25 Sep 2017 08:15:46 GMT
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 -

Dag Sonstebo
Cloud Architect

On 25/09/2017, 03:49, "Adrian Sender" <> wrote:

    Hi Jeremy,
    Some time ago I worked with Citrix in creating a article to mount and recover
    How to Mount Linux LVM Partition in a XenServer Host
    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
    6. Verify
    # tap-ctl list 
    30383 0 0 vhd
    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
    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
    # 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
    Adrian Sender
53 Chandos Place, Covent Garden, London  WC2N 4HSUK

----- Original Message -----------
    From: Jeremy Peterson <>
    To: "" <>
    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 -------

View raw message