[PATCH 0/4] Allow shrinking of ext2, PVs and NTFS
by Richard W.M. Jones
This patch series allows you to shrink various objects, as
requested in the following bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=585221 # resize2fs
https://bugzilla.redhat.com/show_bug.cgi?id=585222 # pvresize
https://bugzilla.redhat.com/show_bug.cgi?id=585223 # ntfsresize
The first patch provides a consistent way to specify numbers
with suffixes to guestfish, eg:
truncate-size /foo 1G
It also unifies the number parsing code used by 'alloc' and
'sparse' commands to use the same Gnulib function.
Patches 2-4 implement the resizing.
With all four patches applied you can shrink filesystems even where
the container is larger, and you can use suffixes to specify the new
filesystem size.
Example using resize2fs-size:
$ guestfish -N fs:ext3:1G
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.
Type: 'help' for a list of commands
'man' to read the manual
'quit' to quit the shell
><fs> vfs-type /dev/vda1
ext3
><fs> blockdev-getsize64 /dev/vda1
1073741312
><fs> resize2fs-size /dev/vda1 100M
><fs> blockdev-getsize64 /dev/vda1 # container size same
1073741312
><fs> mount-ro /dev/vda1 / # but filesystem is smaller
><fs> df-h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 98M 17M 77M 18% /sysroot
Example using pvresize-size:
$ guestfish -N part:1G
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.
Type: 'help' for a list of commands
'man' to read the manual
'quit' to quit the shell
><fs> pvcreate /dev/vda1
><fs> pvresize-size /dev/vda1 512M
><fs> pvs-full
[0] = {
[...]
pv_size: 536870912
dev_size: 1073741312
[...]
}
Example using ntfsresize-size:
$ guestfish -N fs:ntfs:1G
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.
Type: 'help' for a list of commands
'man' to read the manual
'quit' to quit the shell
><fs> ntfsresize-size /dev/vda1 512M
><fs> mount-ro /dev/vda1 /
><fs> df-h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 512M 5.6M 507M 2% /sysroot
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
14 years, 6 months
Re: [Libguestfs] Migrating file based Xen RHEL5.4 to KVM
by Richard W.M. Jones
On Mon, May 17, 2010 at 02:13:02AM +0200, Martin Jeppesen wrote:
> I was wondering, if you can help me out with a answer or two about
> migrating file based RHEL5.4 Xen guests to RHEL5.5 KVM?
>
> Reading the source code to virt-v2v, it seams to me that migrating
> RHEL 5.4 file based guests would be:
>
> * Log in to the guest
> # yum install kernel
> # vi /etc/rc.local
> modprobe cirrus
> modprobe virtio_blk
> modprobe virtio_net
>
> # halt -p
>
> Is it really that simple for RHEL 5.4 guests?
>
> Should I make any changes to the guest config, when using network
> bridge br0 on KVM for the guests?
CC'd to the mailing list, in case someone knows the answer
to this.
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
14 years, 6 months
RHN support and capabilities
by Matthew Booth
This patch series includes a repost of Milan's unmodified RHN support patch
because I haven't pushed it yet. On top of that patch, it includes the
capabilities patch in as many bits as I could make it into. The big one is 7/8.
I've tested all of the following guests both with and without RHN registration:
Xen RHEL 54 PV
Xen RHEL 51 PV
Xen RHEL 48 PV
ESX RHEL 54 FV
14 years, 6 months