Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: windows xp partition totally destroyed by xen/virtualization

  1. #1

    Thumbs down windows xp partition totally destroyed by xen/virtualization

    I had a dual-boot pc with the following installed OSes:
    1. linux (opensuse 11.0) installed on drive /dev/sda (external USB 2.0 drive)
    2. winxp installed on drive /dev/sdb (internal SATA drive).

    I had installed linux from the opensuse-11.0 KDE live-CD. On linux, my winxp NTFS partition is mounted on /mnt/windows.

    I followed the tutorial in
    How to install & configure Xen Virtualization in openSUSE 11.0 | SUSE & openSUSE
    to configure a guest OS using the xen-based virtualization feature available in YAST2. Basically, my intention was to boot the winxp installation (mounted on /mnt/windows) as a guest OS from within the linux/xen host OS.

    I booted my pc from the xen kernel and launched yast2. Then, in yast2 virtualization section, I went about configuring a guest OS. I selected the option I have a disk or disk image with an installed OS and selected the appropriate OS in subsequent steps. Next, in the Virtual Disk option, I specified “file:/dev/sdb” and clicked ok. After this, whatever configuration steps YAST2 ran totally destroyed the winxp partition. YAST2 reported some error about failure to configure xen and at the same time I noticed that the /mnt/windows mount had become invalid (/dev/sdb was now totally unmountable).

    Now my pc just does not boot from winxp. On top of that the winxp drive cannot even be mounted as a data drive because the filesystem itself is damaged. On linux,
    Code:
    fdisk -l
    still reports /dev/sdb as a "NTFS/HPFS" drive but the command
    Code:
    mount /dev/sdb
    reports errors about failing to find ntfs signature and so on. The filesystem on the winxp drive is now invisible from any OS (linux or windows).

    I have tried all means to recover the data from the winxp drive by using all of these methods:
    1. Ran
      Code:
      fdisk /mbr
      after booting from freedos 1.0 cd
    2. Tried to reconstruct the boot sector by copying boot sector from working winxp drives, based on instructions in Understanding and Working with the MBR

    but all have failed.

    It appears that YAST2 virtualization tool has severe bug(s) that can destroy the user’s windows OS. I have not yet filed a formal bug report in https://bugzilla.novell.com/enter_bu...=openSUSE+11.0 since I wanted some useful information/feedback first. What I would like to know is what YAST2 did (and how) to damage the winxp partition.

  2. #2

    Default Re: windows xp partition totally destroyed by xen/virtualiza

    By comparing the damaged winxp drive's boot sector (first 512 bytes) with that of a good winxp drive, I verified that the partition table was still intact on the damaged winxp drive.

  3. #3

    Default Re: windows xp partition totally destroyed by xen/virtualiza

    In /var/log/xen/xend.log these messages can be found
    Code:
    VmError: Disk image does not exist: /dev/sdb1
    [2008-08-06 12:03:43 3293] ERROR (XendDomainInfo:440) VM start failed

  4. #4
    Join Date
    Jun 2008
    Location
    Atlanta, Georgia, USA
    Posts
    2,422

    Default Re: windows xp partition totally destroyed by xen/virtualiza

    I'm sure you are extremely frustrated with this situation. My sympathies to you. However . . .

    Your post seems (at least to me) to confuse somewhat the MBR with the partition table with the file system. The tests you ran are not conclusive. It is more likely that the problem is with the partition table (the ntfs signature error is an error from the table, not the file system). Everything may be recoverable. I strongly suggest you take a look at the tool TestDisk (google it; there are several supplementary howto's on the web, and it's included in the openSUSE photorec package) or possibly gpart (also in the repository). These tools are designed to recover lost partitions and to rebuild the partition table.

    Unfortunately, you used very old ref material (2001) and DOS fdisk to try to repair the IPL (the MBR bootstrap code). That reference describes the IPL as being 446 bytes, which it was then. And, DOS fdisk will indeed write 446 bytes. However, since FAT32 the IPL code has been 440 bytes, the remaining 6 bytes are the disk signature which is used for example by XP to store drive letters. Under some circumstances, the old fdisk will zero out the entire partition table; this is guaranteed to happen if the last 2 bytes of the MBR (the boot record signature, which validates the volume as bootable) has been somehow disturbed. So while DOS fdisk may not cause a problem recreating the IPL, there are definitely instances where it can, and the results can be disastrous.

    The (maybe) good news is that everything else is probably on the disk exactly where it was. I assume your Windows was set up with the system and boot volumes being the same partition; it is not terribly difficult to determine the starting and ending sectors of that partition. And, unless something physically altered the disk, the filesystem table should be sitting where it was before. Even if it is damaged, once the system can boot into Windows, it may be recoverable.

    Give those tools a try. No doubt others will have additional suggestions. All may not be lost.

  5. #5
    Join Date
    Jun 2008
    Location
    Atlanta, Georgia, USA
    Posts
    2,422

    Default Re: windows xp partition totally destroyed by xen/virtualiza

    Quote Originally Posted by topak View Post
    In /var/log/xen/xend.log these messages can be found
    Code:
    VmError: Disk image does not exist: /dev/sdb1
    [2008-08-06 12:03:43 3293] ERROR (XendDomainInfo:440) VM start failed
    When Xen (or anything else) consults the table to locate the partition and there is no record of it, indeed it "officially" does not exist. And it may not exist physically. On the other hand, it may. Xen cannot know more than what the table says. But, again, that doesn't mean that it is not physically exactly where it was before. The key is to reconstruct the table.

  6. #6

    Default Re: windows xp partition totally destroyed by xen/virtualiza

    Quote Originally Posted by mingus725 View Post
    I'm sure you are extremely frustrated with this situation. My sympathies to you. However . . .
    Thanks ....

    Your post seems (at least to me) to confuse somewhat the MBR with the partition table with the file system.
    Sorry if I gave that impression but I do know that the partition table and the MBR are distinct entities. Thanks for the clarification anyway.

    The tests you ran are not conclusive. It is more likely that the problem is with the partition table (the ntfs signature error is an error from the table, not the file system). Everything may be recoverable. I strongly suggest you take a look at the tool TestDisk (google it; there are several supplementary howto's on the web, and it's included in the openSUSE photorec package) or possibly gpart (also in the repository). These tools are designed to recover lost partitions and to rebuild the partition table.
    I will try those tools if possible.

    Unfortunately, you used very old ref material (2001) and DOS fdisk to try to repair the IPL (the MBR bootstrap code).
    Actually I used freedos 1.0 (which is quite recent) and I even tried copying over the 512 bytes of the boot sector from a working identical drive but that did not help either.


    Under some circumstances, the old fdisk will zero out the entire partition table;
    Thats not applicable in my case since I verified that the partition table of the damaged drive has exactly the same bytes as there are on a working identical winxp drive.

    this is guaranteed to happen if the last 2 bytes of the MBR (the boot record signature, which validates the volume as bootable) has been somehow disturbed.
    These two bytes are also intact and have the value 55aa which is why this whole scenario is so bizarre!

    So while DOS fdisk may not cause a problem recreating the IPL, there are definitely instances where it can, and the results can be disastrous.
    As I have mentioned I also overwrote the boot sector bytes directly (using the dd command) by copying the boot sector of working identical winxp drive but that did not help.

    The (maybe) good news is that everything else is probably on the disk exactly where it was.
    Which is the assumption I made as well. Otherwise, if the data itself has changed then its too late.

    I assume your Windows was set up with the system and boot volumes being the same partition;
    Right, 1 single partition (simplest scenario).

    not terribly difficult to determine the starting and ending sectors of that partition. And, unless something physically altered the disk, the filesystem table should be sitting where it was before.
    Yes, it still seems to be sitting where it is.

    Even if it is damaged, once the system can boot into Windows, it may be recoverable.
    I won't even worry about booting now. I would be happy if it can simply be mounted as a data drive.

    Give those tools a try. No doubt others will have additional suggestions. All may not be lost.
    Thanks, I will try.

  7. #7
    Join Date
    Jun 2008
    Location
    Atlanta, Georgia, USA
    Posts
    2,422

    Default Re: windows xp partition totally destroyed by xen/virtualiza

    Quote Originally Posted by topak View Post
    . . . I also overwrote the boot sector bytes directly (using the dd command) by copying the boot sector of working identical winxp drive but that did not help.
    Identical geometries and table? And disk signature? - isn't that unique to a disk?

  8. #8

    Default Re: windows xp partition totally destroyed by xen/virtualiza

    Quote Originally Posted by mingus725 View Post
    Identical geometries and table? And disk signature? - isn't that unique to a disk?
    Yes, identical size (80GB) and the partition tables were identical as well. As for disk signature, should that prevent simple mounting of the disk?

  9. #9

    Default Re: windows xp partition totally destroyed by xen/virtualiza

    Quote Originally Posted by mingus725 View Post
    I strongly suggest you take a look at the tool TestDisk (google it; there are several supplementary howto's on the web, and it's included in the openSUSE photorec package) or possibly gpart (also in the repository). These tools are designed to recover lost partitions and to rebuild the partition table.
    I used testdisk and was able to rebuild the boot sector. There was some progress since now when trying to mount the NTFS partition, the error message is
    Code:
    Record 0 has no FILE magic (0x0)
    Failed to load $MFT: Input/output error
    Failed to mount '/dev/sda1': Input/output error
    NTFS is either inconsistent, or you have hardware faults, or you have a
    SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
    then reboot into Windows TWICE. The usage of the /f parameter is very
    important! If you have SoftRAID/FakeRAID then first you must activate
    it and mount a different device under the /dev/mapper/ directory, (e.g.
    /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
    for the details.

  10. #10
    Join Date
    Jun 2008
    Location
    Oklahoma, US
    Posts
    828

    Default Re: windows xp partition totally destroyed by xen/virtualization

    topak wrote:

    > Then, in yast2 virtualization section, I went about configuring a guest
    > OS. I selected the option *I have a disk or disk image with an installed
    > OS* and selected the appropriate OS in subsequent steps. Next, in the
    > *Virtual Disk* option, I specified "file:/dev/sdb" and clicked ok.


    Based on the above, this isn't a bug... it did EXACTLY what you told it to
    do.

    /dev/sdb is a DRIVE
    /dev/sdb1 is a PARTITION, containing an operating system.

    You quite nicely told the Virtual Disk creation application that you wanted
    to create a virtual disk named '/dev/sdb'.

    Which it did.

    Which ate your XP partition contents.

    *EVERYTHING* in linux is a file. /dev/sdb is a file, /dev/sdb1 is a file
    (it just starts further in on the sdb drive), hello.c is a file. And if
    you have root permissions, you may WRITE to ANY file which has appropriate
    permissions.

    gpart *may* be able to recover your partition enough to get your data out.
    It really depends on how much of the beginning of /dev/sdb1 was
    overwritten.

    --
    L R Nix
    lornix@lornix.com

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •