search for: part_num

Displaying 20 results from an estimated 132 matches for "part_num".

2014 Oct 15
0
Re: Virt-v2v conversion issue
Rich, The results of the guestfish command : ><fs> part-list /dev/sda [0] = { part_num: 1 part_start: 1048576 part_end: 85906685951 part_size: 85905637376 } ><fs> part-list /dev/sdb [0] = { part_num: 1 part_start: 32256 part_end: 322126640639 part_size: 322126608384 } ><fs> part-list /dev/sdc [0] = { part_num: 1 part_start: 32256 part_end: 322101...
2015 Sep 17
1
Wrong deficit calculation in virt-resize.
Hello guys! I tried to shrink a partition when resizing an image using virt-resize. The numbers and result are weird. ================BEFORE================ ><fs> blockdev-getsize64 /dev/sdc 4294967296 ><fs> part-list /dev/sdc [0] = { part_num: 1 part_start: 65536 part_end: 2193555455 part_size: 2193489920 } [1] = { part_num: 2 part_start: 2193555456 part_end: 4294967295 part_size: 2101411840 } ><fs> list-filesystems /dev/sdc1: ext3 /dev/sdc2: ntfs So I have two parititons up to image end, and 64k block a...
2014 Feb 03
2
[PATCH] resize: properly restore GPT partition types
...This should not happen. *) + assert false + ); eprintf "\tcontent: %s\n" (string_of_partition_content p.p_type) and string_of_partition_content = function | ContentUnknown -> "unknown data" @@ -440,15 +448,21 @@ read the man page virt-resize(1). let part_num = Int32.to_int part_num in let name = sprintf "/dev/sda%d" part_num in let bootable = g#part_get_bootable "/dev/sda" part_num in - let mbr_id = - try Some (g#part_get_mbr_id "/dev/sda" part_num) - with G.Error _ -&gt...
2015 Mar 30
1
[PATCH RFC] resize: add p_mbr_p_type as member of type partition
Add p_mbr_p_type as member of type partition to describe mbr partition type. Currently we use: List.filter (fun p -> parttype <> MBR || p.G.part_num <= 4_l) to filter out logical partitions. Commit 0c396a4bce578486dfc4a38e1f8c47fd5c2836ea introduce API part_get_mbr_part_type, we could use this to know the part_type. Furthermore, we could also use p_mbr_p_type for resizing logical partitions. Signed-off-by: Chen Hanxiao <chenhanxiao@cn.f...
2014 Sep 22
13
[PATCH v3 0/7] add support to resize MBR logical partitions
Hi Rich, This is v3 series to add support for resizing MBR logical partitions. changes to v2: 1. remove p_part_num 2. remove filter_parts 3. name the function calculate_target_partitions 4. remove the code to restart guest introduced in v2 changes to v1: 1. spit the patches so it's easier to review 2. fix the parted error caused by unaligned logical partitions 3. extend the content of logical...
2014 Sep 19
22
[PATCH v2 00/13] virt-resize: add support for resizing MBR logical partitions
Hi Rich, This is v2 series to add support for resizing MBR logical partitions. I found the reason of problem in v1 that parted reports error when adding logical partitions, is that logical partitions are not aligned to 2 sectors. This problem doesn't appear in v2. This is for early review, because of: 1. I'm not sure the splitting of patches is appropriate or not, but it's much
2014 Oct 14
4
Re: Virt-v2v conversion issue
On Tue, Oct 14, 2014 at 03:40:22PM +0000, VONDRA Alain wrote: > Rich, > I've followed your instructions to trace, but I am not very skilful with gdb, maybe I made a mistake : > > (1) As root do: > > echo core.%p > /proc/sys/kernel/core_pattern -> OK > > (2) Before running virt-v2v, do: > > ulimited -c unlimited -> I think it's
2014 Jul 16
2
Re: virt-resize: support to MBR logical partitions and some question
On Tue, Jul 15, 2014 at 09:01:47AM +0100, Richard W.M. Jones wrote: > The answer is I don't know. But there are a few things you can try: > > (1) Most importantly, enable tracing (export LIBGUESTFS_TRACE=1) and > get a list of operations that are performed in the order they are > performed. This is vital for debugging this. > > (2) When the error happens, run
2014 Sep 22
0
[PATCH v3 2/7] resize: simplify the code to filter parts
...644 --- a/resize/resize.ml +++ b/resize/resize.ml @@ -454,13 +454,8 @@ read the man page virt-resize(1). (* Filter out logical partitions. See note above. *) let parts = - match parttype with - | GPT -> parts - | MBR -> - List.filter (function - | { G.part_num = part_num } when part_num >= 5_l -> false - | _ -> true - ) parts in + List.filter (fun p -> parttype <> MBR || p.G.part_num <= 4_l) + parts in let partitions = List.map ( -- 1.9.3
2014 Oct 15
1
Re: Virt-v2v conversion issue
On Wed, Oct 15, 2014 at 12:03:26PM +0000, VONDRA Alain wrote: > Rich, > The results of the guestfish command : > > ><fs> part-list /dev/sda > [0] = { > part_num: 1 > part_start: 1048576 > part_end: 85906685951 > part_size: 85905637376 > } > ><fs> part-list /dev/sdb > [0] = { > part_num: 1 > part_start: 32256 > part_end: 322126640639 > part_size: 322126608384 > } [etc] Ah .. this does explain why the...
2015 Mar 17
4
[PATCH] New API: part_get_part_type for showing partition type
...NULL; ++row) + if (STREQ (lines[row], "")) { + end = row; + break; + } + + if (end == 0) { + reply_with_error ("parted output has no blank after end of table"); + return NULL; + } + + /* Now parse the lines. */ + size_t i; + int64_t temp_int64; + int part_num; + char temp_type[16]; + for (i = 0, row = start; row < end; ++i, ++row) { + if (sscanf (lines[row], "%d%" SCNi64 "B%" SCNi64 "B%" SCNi64 "B" "%s", + &part_num, + &temp_int64, + &temp...
2014 Sep 22
1
Re: [PATCH v3 5/7] resize: add function mbr_part_type
...man page virt-resize(1). > > calculate_target_partitions 1 start ~create_surplus:true partitions in > > + (* For GPT, the part type simply becomes partition name, so we don't > + * handle the case specifically. *) > + let mbr_part_type x = > + if x.p_part.G.part_num <= 4l && x.p_type <> ContentExtendedPartition then "primary" > + else if x.p_part.G.part_num <= 4l && x.p_type = ContentExtendedPartition then "extended" > + else "logical" in > + > (* Now partition the target disk. *) &...
2014 Sep 19
1
Re: [PATCH v2 08/13] resize: add function mbr_part_type
.../resize/resize.ml > +++ b/resize/resize.ml > @@ -50,6 +50,7 @@ type partition = { > p_id : partition_id; (* Partition (MBR/GPT) ID. *) > p_type : partition_content; (* Content type and content size. *) > p_label : string option; (* Label/name. *) > + p_part_num: int; (* partition number *) I don't think it's necessary to store p_part_num in the main partitions struct. Instead you can get to the partition number using: p.p_part.G.part_num For example, mbr_part_type could be written: let mbr_part_type x = if x.p_part.G.par...
2015 Mar 24
1
[PATCH 2/2] New API: part_get_part_type for showing partition type
...NULL; ++row) + if (STREQ (lines[row], "")) { + end = row; + break; + } + + if (end == 0) { + reply_with_error ("parted output has no blank after end of table"); + return NULL; + } + + /* Now parse the lines. */ + size_t i; + int64_t temp_int64; + int part_num; + char temp_type[16] = {'\0'}; + for (i = 0, row = start; row < end; ++i, ++row) { + if (STREQ (parttype, "gpt")) { + memcpy (temp_type, "primary", strlen("primary")); + if (sscanf (lines[row], "%d%" SCNi64 "B%" SCNi64 &q...
2018 Jan 28
0
[PATCH v3 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
...NULL; ++row) - if (STREQ (lines[row], "")) { - end = row; - break; - } - - if (end == 0) { - reply_with_error ("parted output has no blank after end of table"); - return NULL; - } - - /* Now parse the lines. */ - size_t i; - int64_t temp_int64; - int part_num; - char temp_type[16] = {'\0'}; - for (i = 0, row = start; row < end; ++i, ++row) { - if (STREQ (parttype, "gpt")) { - memcpy (temp_type, "primary", strlen ("primary")); - if (sscanf (lines[row], "%d%" SCNi64 "B%" SCNi64 &...
2015 Mar 13
2
[PATCH] part-list: add support for show partition type
...ical and extended */ + char type_temp[16]; + for (i = 0, row = start; row < end; ++i, ++row) { + if (sscanf (lines[row], " %d %" SCNi64 "B %" SCNi64 "B %" SCNi64 "B" "%s", &r->guestfs_int_partition_list_val[i].part_num, &r->guestfs_int_partition_list_val[i].part_start, &r->guestfs_int_partition_list_val[i].part_end, - &r->guestfs_int_partition_list_val[i].part_size) != 4) { + &r->guestfs_int_partition_list_val[i].p...
2018 Apr 09
0
[PATCH 2/3] daemon: use the structs from the Structs module
...t device in let partition = - List.find (fun { Parted.part_start = s } -> s = offset) partitions in + List.find (fun { Structs.part_start = s } -> s = offset) partitions in (* Construct the full device name. *) - Some (sprintf "%s%ld" device partition.Parted.part_num) + Some (sprintf "%s%ld" device partition.Structs.part_num) with | Not_found -> None diff --git a/daemon/listfs.ml b/daemon/listfs.ml index f6e3dcd6e..56ebadeda 100644 --- a/daemon/listfs.ml +++ b/daemon/listfs.ml @@ -125,13 +125,13 @@ and check_with_vfs_type device = l...
2018 Apr 10
0
[PATCH v2 2/5] daemon: use the structs from the Structs module
...t device in let partition = - List.find (fun { Parted.part_start = s } -> s = offset) partitions in + List.find (fun { Structs.part_start = s } -> s = offset) partitions in (* Construct the full device name. *) - Some (sprintf "%s%ld" device partition.Parted.part_num) + Some (sprintf "%s%ld" device partition.Structs.part_num) with | Not_found -> None diff --git a/daemon/listfs.ml b/daemon/listfs.ml index f6e3dcd6e..56ebadeda 100644 --- a/daemon/listfs.ml +++ b/daemon/listfs.ml @@ -125,13 +125,13 @@ and check_with_vfs_type device = l...
2017 Jul 14
0
[PATCH 20/27] daemon: Reimplement ‘part_list’ API in OCaml.
...goto error2; - } - - /* Now parse the lines. */ - size_t i; - for (i = 0, row = 2; lines[row] != NULL; ++i, ++row) { - if (sscanf (lines[row], "%d:%" SCNi64 "B:%" SCNi64 "B:%" SCNi64 "B", - &r->guestfs_int_partition_list_val[i].part_num, - &r->guestfs_int_partition_list_val[i].part_start, - &r->guestfs_int_partition_list_val[i].part_end, - &r->guestfs_int_partition_list_val[i].part_size) != 4) { - reply_with_error ("could not parse row from output of parte...
2015 Mar 23
0
Re: [PATCH] New API: part_get_part_type for showing partition type
...end = row; > + break; > + } > + > + if (end == 0) { > + reply_with_error ("parted output has no blank after end of table"); > + return NULL; > + } > + > + /* Now parse the lines. */ > + size_t i; > + int64_t temp_int64; > + int part_num; > + char temp_type[16]; > + for (i = 0, row = start; row < end; ++i, ++row) { > + if (sscanf (lines[row], "%d%" SCNi64 "B%" SCNi64 "B%" SCNi64 "B" "%s", > + &part_num, > + &temp_int64, &...