recover backup from banwagong

1 minute read

overview

i've ever built my own blog by Wordpress and VPS folowing the the tutorial how to build a website with wordpress and vps.but it was easilly to being attacked by hacker.enventually my host suspended,it only recover until next year. the situation like following:

vps erro

lucky,the biggest strenth of the bangwagong is that it has the snapshot,it can help you to recover it when it is necessary,so i am gonna to restore it ,but i was forbbien to that,and gimme the hint:the host has been suspended. i cant wait to repair my blog ,so i just abandon the preview blog built by worldpress and VPS and turn my head to the Jekyll and github-page method. but how about i want use the picture,the post i written before,i’ve ever try to download the backup and unzip it ,and it turns out the file with the suffix of .disk.like the folowing:
vps_disk

the above file with the suffix of .dsk can not be opened in windows,it really bother me ,finnlly ,i find the tutorial: get reletive file from banwagong.let us kick off.

NOTE: the .disk file can only be opened in linux system

  • STEP 1
  • download the .tar.gz snapshot file from vps. and use the scp command to copy the .tar.gz from the pc to linux[it depends what OS you use,u can ignore this process if you download derectly in linux].and use tar command to uncompress the file,and get the vm-1234xxx.disk file

  • STEP 2
  • check out which dev is unoccupied by the comand
    losetup -f.
    you will find some unoccupied dev like : /dev/loop18.

  • STEP 3
  • Create device maps from partition tables by

    losetup /dev/loop18 vm-1234xxx.disk
    Kpartx -av /dev/loop18

    you will get the output:
    add map loop18p1
    add map loop18p2

  • STEP 4
  • checkout where your data locate by the commanf mount,for example ,mount the loop18p2 to the /mnt folder by the
    mount /dev/mapper/loop18p2 /mnt.

    all set,you will finally find the file you want to get in /mnt folder.

  • STEP 5
  • unmount the mirror file with follow command:
    unmount /mnt
    kpartx -dv /dev/loop18
    losetup -d /dev/loop18