hi. sorry if this is a faq, but i didn''t find anything with google. i have this line: disk = [ ''file:/home/winxp.img,hda,w'', ''phy:/dev/cdrom,hdc:cdrom,r'' ] in a hvm windows xp image. /home/winxp.img is 4 GB, i have to expand it to 8 GB. i have tried both dd with in append mode and dd another 4 GB file and then cat tempfile >> winxp.img. when i boot xp, i can see the correct disk size, but it stop at "Booting from Hard Disk...". now on, i have tried to dd to zero the first 446 byte with a live cd, start with xp install cd in repair mode and i made both fixmbr and fixboot but i still get the error. do you have some hint? thanks Daniele Palumbo _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Jan-23 11:21 UTC
Re: [Xen-users] resize file disk iommu xp won''t boot
On Fri, Jan 23, 2009 at 5:47 PM, Daniele Palumbo <daniele@retaggio.net> wrote:> /home/winxp.img is 4 GB, i have to expand it to 8 GB. > > i have tried both dd with in append mode and dd another 4 GB file and then cat > tempfile >> winxp.img.I hope you have you original winxp.img handy. I have a (hopefuly wrong) hunch that you''ve messed up your data.> > when i boot xp, i can see the correct disk size, but it stop at "Booting from > Hard Disk...". > > now on, i have tried to dd to zero the first 446 byte with a live cd446? I thought MBR is 404 bytes?> still get the error.Try these, and post the output. ls -lsh /home/winxp.img losetup -f /home/winxp.img losetup -a fdisk -l /dev/loop0 (or whatever loop holds winxp.img) losetup -d /dev/loop0 My guess is : - fdisk still says 4G disk, OR - you get a big number of cylinders Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Daniele Palumbo
2009-Jan-23 12:34 UTC
Re: [Xen-users] resize file disk iommu xp won''t boot
Il venerdì 23 gennaio 2009 12:21:30 Fajar A. Nugraha ha scritto:> I hope you have you original winxp.img handy. I have a (hopefuly > wrong) hunch that you''ve messed up your data.of course :D> > when i boot xp, i can see the correct disk size, but it stop at "Booting > > from Hard Disk...". > > > > now on, i have tried to dd to zero the first 446 byte with a live cd > > 446? I thought MBR is 404 bytes?http://en.wikipedia.org/wiki/Master_boot_record 512 bytes, but from 447 start the partition table... and i don''t want to delete it, of course.> Try these, and post the output. > ls -lsh /home/winxp.img > losetup -f /home/winxp.img > losetup -a > fdisk -l /dev/loop0 (or whatever loop holds winxp.img) > losetup -d /dev/loop0new image: pc18:/home# fdisk -l /dev/loop1 Disk /dev/loop1: 8388 MB, 8388608000 bytes 128 heads, 63 sectors/track, 2031 cylinders Units = cylinders of 8064 * 512 = 4128768 bytes Disk identifier: 0x92759275 Device Boot Start End Blocks Id System /dev/loop1p1 * 1 1014 4088416+ 7 HPFS/NTFS pc18:/home# backup image: pc18:/home# fdisk -l /dev/loop1 Disk /dev/loop1: 4194 MB, 4194304000 bytes 128 heads, 63 sectors/track, 1015 cylinders Units = cylinders of 8064 * 512 = 4128768 bytes Disk identifier: 0x9e099e09 Device Boot Start End Blocks Id System /dev/loop1p1 * 1 1014 4088416+ 7 HPFS/NTFS pc18:/home#> My guess is : > - fdisk still says 4G disk, OR > - you get a big number of cylindersbut of course, cause qemu see 8GB in virtual bios, this is not a surprise to me. any other hint? thanks daniele _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Jan-23 13:13 UTC
Re: [Xen-users] resize file disk iommu xp won''t boot
On Fri, Jan 23, 2009 at 7:34 PM, Daniele Palumbo <daniele@retaggio.net> wrote:> http://en.wikipedia.org/wiki/Master_boot_record > 512 bytes, but from 447 start the partition table... > and i don''t want to delete it, of course.Ah, thanks for the info.> new image: > pc18:/home# fdisk -l /dev/loop1 > > Disk /dev/loop1: 8388 MB, 8388608000 bytes > 128 heads, 63 sectors/track, 2031 cylinders > Units = cylinders of 8064 * 512 = 4128768 bytes > Disk identifier: 0x92759275 > > Device Boot Start End Blocks Id System > /dev/loop1p1 * 1 1014 4088416+ 7 HPFS/NTFSSo you haven''t gone through resizing the ntfs and partition yet, but Windows simply refuses to boot, right?> pc18:/home# > > backup image: > pc18:/home# fdisk -l /dev/loop1 > > Disk /dev/loop1: 4194 MB, 4194304000 bytes > 128 heads, 63 sectors/track, 1015 cylinders > Units = cylinders of 8064 * 512 = 4128768 bytes > Disk identifier: 0x9e099e09 > > Device Boot Start End Blocks Id System > /dev/loop1p1 * 1 1014 4088416+ 7 HPFS/NTFS > pc18:/home#>> - you get a big number of cylinders > > but of course, cause qemu see 8GB in virtual bios, this is not a surprise to > me. >Here''s what happened to me earlier : - I use 10G LVM as domUs disk -> windows boots - created another 10G LVM, clone the first disk''s contents using ntfsclone -> windows boots - created 10G zfs-volume on another host, import it with iscsi, clone the first disk here using ntfsclone again -> windows refused to boot Weird huh? Upon investigating, I found that LVM-backed disk show these geometries 255 heads, 63 sectors/track, 1305 cylinders while the iscsi-imported zfs-volume had these 64 heads, 32 sectors/track, 10240 cylinders So I use fdisk''s extra functionality to change iscsi-imported disk''s geometry to be the same as the LVM one, repeat the cloning process, and voilla, windows boots. Perhaps windows (or at least Windows that was installed to a 1305-cylinder disk) can''t boot from a 2031-cylinder (or in my case, a 10240-cylinder) disk. I know it''s not a very scientific explanation (especially since my notebook has a 14593 cylinder SATA disk, and windows boots just fine from it), but as shown from my experiment above simply changing the disk geometry fixed the issue. I suggest you try these : - create a new 8GB image (copy the backup image then extend it with dd or whatever) - use fdisk to change disk geometry to 255 heads, 63 sectors/track, 1019 cylinder - delete the old partition 1 - create a new partition 1, have it occupy cylinder 1-1018. Don''t forget to set active flag and type correctly - try booting windows If it works, then your next step is to resize ntfs on partition 1 using ntfsresize. If it doesn''t, I''m out of ideas. Good luck :) PS: If anyone can give a detailed explanation as to why I need to change disk geometries to make windows boots, I''d like to hear it. Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Daniele Palumbo
2009-Jan-26 09:07 UTC
Re: [Xen-users] resize file disk iommu xp won''t boot
Il venerdì 23 gennaio 2009 14:13:38 hai scritto:> So you haven''t gone through resizing the ntfs and partition yet, but > Windows simply refuses to boot, right?yes.> Weird huh? > Upon investigating, I found that LVM-backed disk show these geometries > 255 heads, 63 sectors/track, 1305 cylinders > > while the iscsi-imported zfs-volume had these > 64 heads, 32 sectors/track, 10240 cylindersbut you have had a change in heads and sectors per track... i did not.> I suggest you try these : > - create a new 8GB image (copy the backup image then extend it with dd > or whatever) > - use fdisk to change disk geometry to 255 heads, 63 sectors/track, > 1019 cylinderwhy 1019?> - delete the old partition 1 > - create a new partition 1, have it occupy cylinder 1-1018. Don''t > forget to set active flag and type correctly > - try booting windowsi did it, anyway no luck. BUT! you gave me some useful information, and i started a new search on google. http://www.linux-ntfs.org/doku.php?id=ntfsclone what the program do is described and linked in that page, for who want to go deep. this tool is included also in systemrescuecd http://www.sysresccd.org/ from 1.1.1betasomething, but the name of the file to exec is ntfsreloc not relocntfs. i have burned the cd (maybe fastest, otherwise i have to double losetup: the first to see the partition table, se second to see the partition) and runned: ntfsreloc -w /dev/sda1 started windows, all ok. whithin windows i do not know how to resize the partition, i didn''t found anything on disk gestures... so, to resize the partitions i have restarted system rescue cd, and runned gparted (i am REALLY lazy today...) with mouse and all... resized the partitions, restarted and voilà! 8GB C: xp. thanks you, and my 2 cents bye d. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Jan-26 12:41 UTC
Re: [Xen-users] resize file disk iommu xp won''t boot
On Mon, Jan 26, 2009 at 4:07 PM, Daniele Palumbo <daniele@retaggio.net> wrote:>> - create a new 8GB image (copy the backup image then extend it with dd >> or whatever) >> - use fdisk to change disk geometry to 255 heads, 63 sectors/track, >> 1019 cylinder > > why 1019?( 8388 MB, 8388608000 bytes) / ( Units = cylinders of 16065 * 512 8225280 bytes )> i have burned the cd (maybe fastest, otherwise i have to double losetup: the > first to see the partition table, se second to see the partition) and > runned: > ntfsreloc -w /dev/sda1Wow. I didn''t know there was a program called ntfsreloc. Too bad it''s not available on Ubunu repositories.> > started windows, all ok.Thanks for sharing your experience. Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users