summaryrefslogtreecommitdiffstats
path: root/resize/resize.ml
Commit message (Collapse)AuthorAgeFilesLines
* New API: guestfs_canonical_device_name.Richard W.M. Jones2012-06-131-2/+2
| | | | This API makes device names canonical, eg. /dev/vda1 -> /dev/sda1.
* doc: Add notes on how GPT works on 4k sector disks.Richard W.M. Jones2012-05-141-2/+13
| | | | | | | | | I used scsi_debug to create a 4k sector virtual disk: modprobe scsi_debug dev_size_mb=128 sector_size=4096 I then used 'gdisk' to create lots of partitions, and used 'hexdump' to examine what was written to disk.
* Add gettext support for OCaml tools (virt-resize, virt-sparsify, virt-sysprep).Richard W.M. Jones2012-05-011-86/+88
| | | | | | | | Note that this support is optional: To enable it, install the ocaml-gettext library from http://forge.ocamlcore.org/projects/ocaml-gettext . If this library is not installed, then configure detects this and inserts dummy gettext functions that do nothing.
* resize, sparsify: Add a simple-minded check to stop indisk = outdisk.Richard W.M. Jones2012-04-171-0/+6
|
* resize2fs: Run 'e2fsck -f' automatically if filesystem is not mounted.Richard W.M. Jones2012-03-091-3/+1
|
* resize: Fix --output-format flag (RHBZ#798196).Richard W.M. Jones2012-02-281-1/+1
| | | | Update the test to use the --format and --output-format flags.
* Tempus fugit.Richard W.M. Jones2012-01-181-1/+1
| | | | Update all copyright dates to 2012.
* extra tests: Test virt-resize.Richard W.M. Jones2011-11-291-2/+10
| | | | | | | | This adds the virt-resize --debug-gc option which causes virt-resize to call Gc.compact before exiting, allowing GC and memory problems to be tested. Add an extratest which runs virt-resize under valgrind.
* virt-resize: Be much more conservative about moving first partition.Richard W.M. Jones2011-10-261-5/+26
| | | | | | | | | | | | Commit 2910413850c7d9e8df753afad179e415f0638d6d caused Windows 7 resizes to break with the 0xc0000225 boot error. Change the --align-first auto (default) option so that it is more conservative about when it moves the first partition. In particular it doesn't move it if it's already aligned (as it is for Win7), nor if there is more than one partition (also Win7). Tested with: Windows XP, 2003, 7, Ubuntu 10.10 and RHEL 5.
* virt-resize: Handle extended and logical partitions (RHBZ#642821).Richard W.M. Jones2011-10-261-17/+69
|
* resize: Get the partition table type of the source disk earlier.Richard W.M. Jones2011-10-261-7/+17
| | | | | | Also we only permit MBR (DOS) and GPT partition tables. In theory previously we allowed other partition table types, but it is unlikely that it would have worked in reality.
* resize: Add --align-first auto|never|always option.Richard W.M. Jones2011-10-201-9/+79
| | | | | The first partition can now be aligned. We fix the bootloader correctly for Windows by adjusting the "Hidden Sectors" field.
* resize: Add --alignment flag to allow partition alignment to be picked.Richard W.M. Jones2011-10-201-5/+16
|
* resize: Refactor the code for creating target partitions.Richard W.M. Jones2011-10-201-92/+97
| | | | | | | | | | | | | The old code mixed the business of planning the layout of the target partitions with the creation of the target partitions. The replacement code separates these into two tasks: firstly we create a new 'partitions' list with the target layout, secondly this directly drives the creation of the partitions. As part of this change I have *removed* the old code that was supposed to handle extended/logical MBR partitions. It simply didn't work, and didn't have any hope of working, and there is a separate bug open to fix it.
* resize: Remove p_size field from partitions structure.Richard W.M. Jones2011-10-201-12/+13
| | | | | | This field simply contained a duplicate copy of p_part.part_size. There is no functional change in this commit.
* virt-resize: Align partitions to multiple of 128 sectors (instead of 64).Richard W.M. Jones2011-10-061-4/+5
| | | | | This gives us effectively 64 KByte alignment, optimal for all current types of storage.
* resize: Add --machine-readable option for machine friendly output.Richard W.M. Jones2011-08-261-4/+26
|
* resize: Add btrfs support to virt-resize (RHBZ#721275).Richard W.M. Jones2011-07-141-2/+16
|
* virt-resize: Add --ntfsresize-force option.Richard W.M. Jones2011-07-131-3/+6
| | | | | Use the non-deprecated g#ntfsresize_opts API call, and also add the --ntfsresize-force option for forcing resize.
* resize: Consistent use of 'part' in help output.Richard W.M. Jones2011-04-101-4/+4
|
* resize: Missing \n after version.Richard W.M. Jones2011-04-101-1/+1
|
* Rewrite virt-resize in OCaml.Richard W.M. Jones2011-04-091-0/+972
This is a fairly straightforward translation of Perl virt-resize into OCaml. It is bug-for-bug and feature-for-feature identical to the Perl version, except as noted below. The motivation is to have a more solid, high-level, statically safe compiled language to go forwards with fixing some of the harder bugs in virt-resize. In particular contracts between different parts of the program are now handled by statically typed structures checked at compile time, instead of the very ad-hoc unchecked hash tables used by the Perl version. OCaml and the ocaml-pcre library (Perl-Compatible Regular Expressions bindings for OCaml) are required. Extra features in this version: - 32 bit hosts are now supported. - We try hard to handle the case where the target disk is not "clean" (ie. all zeroes). It usually works for this case, whereas the previous version would usually fail. However it is still recommended that the system administrator creates a fresh blank disk for the target before running the program. - User messages are a bit more verbose and helpful. You can turn these off with the -q (--quiet) option. There is one lost feature: - Ability to specify >= T (terabytes) sizes in command line size expressions has been removed. This probably didn't work in the Perl version. Other differences: - The first partition on the target is no longer aligned; instead we place it at the same sector as on the source. I suspect that aligning it was causing the bootloader failures. - Because it's easier, we do more sanity checking on the source disk. This might lead to more failures, but they'd be failures you'd want to know about. - The order in which operations are performed has been changed to make it more logical. The user should not notice any functional difference, but debug messages will be quite a bit different. - virt-resize is a compiled binary, not a script.