[parted-devel] Resizing a windows partition.
K T Ligesh
ligesh at lxlabs.com
Sat Jun 23 21:39:23 UTC 2007
On Sun, Jun 24, 2007 at 01:31:46AM +0530, Debarshi 'Rishi' Ray wrote:
> > I have been trying to use parted to resize a windows partition but
> > without any success.
> Again, which version of Parted and what do you mean by a Windows
OK. I didn't know parted was under such heavy development. Anyway, I finally got the 1.8.7 compiled by disabling readline, and now both the open file descriptor and script mode bugs are gone. So that's a really pleasant surprise. And now you also seem to have an intelligent -1 to specify the last sector. Thanks.
> Parted can not resize Vista NTFS partitions yet.
I am using Win2k3, and ntfsresize. I am not using parted to resize the file system, merely the partition, and I am doing it by first removing it and adding it again, since resize doesn't ntfs at all.
Now my problem. I have a working windows hard disk image on a file called as windows.img. This is a harddisk image, and it contains a partition with windows. Running parted on windows.img gives.
$ parted /home//xen/template/windows.img unit s print
Disk /home/xen/template/windows.img: 3407872s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 63s 3403007s 3402945s primary ntfs boot
The above boots perfectly on xen.
I need to clone this into an LVM. Here's the steps I used.
$ lvcreate -L1.9G -n windows_rootimg VolGroup00
$ parted /dev/VolGroup00/windows_rootimg -- unit s rm 1 mkpart primary ntfs 63 -1 set 1 boot on
$ parted -s /dev/VolGroup00/windows_rootimg set 1 boot on (This is because the set 1 boot on in the previous seems to be ignored).
$ losetup -o 32256 /dev/loop1 windows.img
$ losetup -o 32256 /dev/loop2 /dev/VolGroup00/windows_rootimg
$ ntfsclone -O /dev/loop2 /dev/loop1 (Here we have ntfsclone copying the file system from windows.img to windows_rootimg).
$ xm create windows2.cfg
That is, I am trying to boot the LV, which is supposed to be the clone of the first image. But the boot gets stuck at the very begginning at "Booting from harddisk", and it doesn't proceed at all. Any help is appreciated.
More information about the parted-devel