[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] migrate from physical disk problems in xen



Hi Adam,

On 18/01/13 18:31, Adam Goryachev wrote:
I've been trying to migrate a win nt 4 machine to a xen domu for the past few 
months with no success. However, on my current attempt, the original hardware 
no longer boots, so I'm trying to resolve the issues with xen properly, or else 
take a long holiday...

On one of our Windows XP installs in a far off place, we found that the HAL that shipped on our Windows disc wasn't virtualisation-friendly. This was on VMWare (not Xen) so it may not apply but we had to get a special version of XP with a different HAL.

Anyway, the physical machine had a 9G drive (OS drive), a 147 G drive (not in 
use) and a 300G drive (all SCSI Ultra320 on the same SCSI controller)

From here on it, I will call the 9GB drive "sda", the 147GB "sdb" and the 300GB "sdc" - Please adjust anything I say if your system is different.

Everytime, I've booted linux, used dd to image the original 2 drives (ignored 
the 147G drive), and written each image with dd to an LV

Are you dd-ing the Windows partition or the whole drive into the container file? I think you will get better results with the whole drive.

This is exported by iscsi to xen

The c: works fine, and I can boot properly in VGA mode (safe mode) but the 300G 
drive always shows as corrupt. I've now upgraded to win2000 in the VM, and 
win2000 reports the drive as healthy (hardware) but blank with no filesystem on 
it.

What are you passing to the VM in the "disk=[]" line please?

Whatever you pass will be interpreted by Windows as a raw drive, so it can't just be a partition, it has to have a partition table and MBR too. If you just pass a partition, you are likely to see some strange partitioning arrangement in Windows Disk management (random size partitions/free space chunks) and, in the file manager, you will see no files.

The disk line should probably pass sdc, rather than sdc1, or you need to make a partition table and a partition in it using parted.

However, on the xen machine, I can use fdisk to see the partition table, kpartx 
-a to add the partition device in /dev/mapper, and I can even mount the drive 
in Linux and see all of it's contents.

I would recommend you don't use fdisk in Linux on this kind of task. Fdisk has a nasty habit of imposing its own default CHS geometry on disks. Like, the other day, it told me the appropriate start sector for the first partition on my virtual disc was 2048 when it really should have been 63). This can lead to things not matching and may be stopping your VM from mounting the machine.

I suspect the problem is the way windows translates the CHS values of the 
drive, and so can't see things the same way that NT could on the physical 
hardware.

May well be due to what Linux fdisk did... I would recommend you try parted instead.

I'm at a complete loss on how to resolve this issue, or what to try/look at. If 
all else fails I figured to try and create a new 300G drive, format it from 
win2k, and then somehow transfer the files from Linux into win2k, without 
losing any of the permissions / etc which I guess will be somewhat challenging.


Some useful commands...

#Create a new partition table in sdc. (change msdos to gpt if needed)
parted -- /dev/sdc mklabel msdos

#Make a single, primary NTFS partition filling the whole drive but don't format it (change the sector numbers to match your real disc's partitions)
parted -- /dev/sdc mkpart primary NTFS 63s -1s

Use kpartx -a to load the new pt...

#build an NTFS filesystem in the new partition
mkfs.ntfs -Q -L VOLUME_LABEL /dev/sdc1

Good luck,
Paul.

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.