Hi, I use guestfs.part_disk to partition one disk with 'mbr' and formated it to ntfs, then attach this disk to one windows xp virtual machine. But this windows xp can't recognise that partition, it says 'uknown partition' Why it is so, and how to solve it? May someone help me with this problem? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20120531/1a20c95e/attachment.htm>
I found that the system disk of that windows xp virtual machine uses 'msdos' parttype. So i partition another disk with 'msdos' and formated it to ntfs, and attach it again. But no luck. the windows xp still can't recognise this parttion and i have to delete this so called 'unknow partition' and recreate it from inside windows. On Thu, May 31, 2012 at 2:41 PM, me,apporc <appleorchard2000 at gmail.com>wrote:> Hi, > I use guestfs.part_disk to partition one disk with 'mbr' and formated it > to ntfs, then attach this disk to one windows xp virtual machine. > But this windows xp can't recognise that partition, it says 'uknown > partition' > > Why it is so, and how to solve it? May someone help me with this problem? > > Thanks. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20120531/829f6399/attachment.htm>
On Thu, May 31, 2012 at 02:41:22PM +0800, me,apporc wrote:> Hi, > I use guestfs.part_disk to partition one disk with 'mbr' and formated it > to ntfs, then attach this disk to one windows xp virtual machine. > But this windows xp can't recognise that partition, it says 'uknown > partition' > > Why it is so, and how to solve it? May someone help me with this problem?Windows won't recognize a partition unless you have the partition type byte (Linux ignores this byte and just looks at the partition content). In guestfish you would have to do: part-set-mbr-id /dev/sda 1 0x7 That is for NTFS; use 0xb for VFAT. For more information see: https://github.com/libguestfs/libguestfs/blob/3893dc0b9436ebb4dd620c6ca9b1d038eacf83a6/tools/virt-make-fs#L438 Unfortunately at the moment there is no method of setting the UUID of a GPT partitioned disk. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top