Displaying 20 results from an estimated 57 matches for "mbr_id".
Did you mean:
mb_id
2014 Feb 03
2
[PATCH] resize: properly restore GPT partition types
...ff --git a/resize/resize.ml b/resize/resize.ml
index 8683df7..a2670e5 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -48,6 +48,7 @@ type partition = {
p_part : G.partition; (* SOURCE partition data from libguestfs. *)
p_bootable : bool; (* Is it bootable? *)
p_mbr_id : int option; (* MBR ID, if it has one. *)
+ p_gpt_type : string option; (* GPT ID, if it has one. *)
p_type : partition_content; (* Content type and content size. *)
(* What we're going to do: *)
@@ -75,7 +76,14 @@ let rec debug_partition p =
p.p_part.G.part_size;...
2014 Feb 03
0
Re: [PATCH] resize: properly restore GPT partition types
...e/resize.ml
> index 8683df7..a2670e5 100644
> --- a/resize/resize.ml
> +++ b/resize/resize.ml
> @@ -48,6 +48,7 @@ type partition = {
> p_part : G.partition; (* SOURCE partition data from libguestfs. *)
> p_bootable : bool; (* Is it bootable? *)
> p_mbr_id : int option; (* MBR ID, if it has one. *)
> + p_gpt_type : string option; (* GPT ID, if it has one. *)
> p_type : partition_content; (* Content type and content size. *)
>
> (* What we're going to do: *)
> @@ -75,7 +76,14 @@ let rec debug_partition p =
>...
2015 Nov 27
1
[PATCH 1/2] resize: Work around regression in sfdisk (RHBZ#1285847).
...uot;/dev/sdb" p.p_target_partnum) p.p_label;
+ may (g#part_set_gpt_guid "/dev/sdb" p.p_target_partnum) p.p_guid;
+
+ match parttype, p.p_id with
+ | GPT, GPT_Type gpt_type ->
+ g#part_set_gpt_type "/dev/sdb" p.p_target_partnum gpt_type
+ | MBR, MBR_ID mbr_id ->
+ g#part_set_mbr_id "/dev/sdb" p.p_target_partnum mbr_id
+ | GPT, (No_ID|MBR_ID _) | MBR, (No_ID|GPT_Type _) -> ()
+ in
+ List.iter set_partition_bootable_and_id partitions;
+
(* Copy over the data. *)
let copy_partition p =
match p.p_operation w...
2014 Jan 27
0
[PATCH INCOMPLETE] Rewrite virt-make-fs in C (originally Perl).
...GUESTFS_ADD_DRIVE_OPTS_FORMAT, format,
+ -1) == -1)
+ return -1;
+
+ if (guestfs_launch (g) == -1)
+ return -1;
+
+ if (check_ntfs_available () == -1)
+ return -1;
+
+ /* Partition the disk. */
+ dev = "/dev/sda";
+ if (partition) {
+ int mbr_id = 0;
+
+ if (STREQ (partition, ""))
+ partition = "mbr";
+
+ if (guestfs_part_disk (g, dev, partition) == -1)
+ exit (EXIT_FAILURE);
+
+ dev = "/dev/sda1";
+
+ /* Set the partition type byte if it's MBR and the filesystem type
+ * is one t...
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 Jan 27
2
[PATCH INCOMPLETE] Rewrite virt-make-fs in C (originally Perl).
I thought it would be easy to rewrite virt-make-fs in C.
Two days later ...
The Perl program uses a lot of external commands, which makes
it pretty tedious to implement in C.
Rich.
2018 Jan 10
0
[PATCH 3/3] resize: copy GPT partition flags
...t;/dev/sdb" p.p_target_partnum) p.p_guid;
+ Option.may (g#part_set_gpt_attributes "/dev/sdb" p.p_target_partnum) p.p_attributes;
match parttype, p.p_id with
| GPT, GPT_Type gpt_type ->
@@ -1205,7 +1214,7 @@ read the man page virt-resize(1).
g#part_set_mbr_id "/dev/sdb" p.p_target_partnum mbr_id
| GPT, (No_ID|MBR_ID _) | MBR, (No_ID|GPT_Type _) -> ()
in
- List.iter set_partition_bootable_and_id partitions;
+ List.iter set_partition_bootable_attributes_and_id partitions;
(* Copy over the data. *)
let copy_partition p =
--...
2018 Jan 15
0
[PATCH v2 3/3] resize: copy GPT partition flags
...t;/dev/sdb" p.p_target_partnum) p.p_guid;
+ Option.may (g#part_set_gpt_attributes "/dev/sdb" p.p_target_partnum) p.p_attributes;
match parttype, p.p_id with
| GPT, GPT_Type gpt_type ->
@@ -1205,7 +1214,7 @@ read the man page virt-resize(1).
g#part_set_mbr_id "/dev/sdb" p.p_target_partnum mbr_id
| GPT, (No_ID|MBR_ID _) | MBR, (No_ID|GPT_Type _) -> ()
in
- List.iter set_partition_bootable_and_id partitions;
+ List.iter set_partition_attributes partitions;
(* Copy over the data. *)
let copy_partition p =
--
2.15.1
2014 Sep 26
0
[PATCH v4 1/7] resize: add function find_partitions
...<hutao@cn.fujitsu.com>
---
resize/resize.ml | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/resize/resize.ml b/resize/resize.ml
index 81bb270..cfd02fc 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -73,6 +73,9 @@ and partition_id =
| MBR_ID of int (* MBR ID. *)
| GPT_Type of string (* GPT UUID. *)
+type partition_type =
+ | PrimaryPartition
+
let rec debug_partition p =
eprintf "%s:\n" p.p_name;
eprintf "\tpartition data: %ld %Ld-%Ld (%Ld bytes)\n"
@@ -443,14 +446,15 @@ read th...
2018 Jan 28
9
guestfs_list_filesystems: skip block devices which cannot hold file system
Initial discussion is here: https://www.redhat.com/archives/libguestfs/2018-January/msg00188.html.
v2 was posted here: https://www.redhat.com/archives/libguestfs/2018-January/msg00246.html.
v3 comparing to v2 is just a rebase with slightly changed commits comments.
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
.../partitioning.c b/plugins/partitioning/partitioning.c
index 0b4e66b..6e426b9 100644
--- a/plugins/partitioning/partitioning.c
+++ b/plugins/partitioning/partitioning.c
@@ -68,7 +68,7 @@ int partitioning_debug_regions;
* following partitions.
*/
unsigned long alignment = DEFAULT_ALIGNMENT;
-int mbr_id = DEFAULT_MBR_ID;
+uint8_t mbr_id = DEFAULT_MBR_ID;
char type_guid[16]; /* initialized by partitioning_load function below */
/* partition-type parameter. */
@@ -211,10 +211,8 @@ partitioning_config (const char *key, const char *value)
else if (strcmp (key, "mbr-id") == 0) {
i...
2019 Sep 23
2
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
..._easy_setopt.
> > +++ b/plugins/partitioning/partitioning.c
> > @@ -211,10 +211,8 @@ partitioning_config (const char *key, const char *value)
> > else if (strcmp (key, "mbr-id") == 0) {
> > if (strcasecmp (value, "default") == 0)
> > mbr_id = DEFAULT_MBR_ID;
> > - else if (sscanf (value, "%i", &mbr_id) != 1) {
> > - nbdkit_error ("could not parse mbr-id: %s", value);
> > + else if (nbdkit_parse_int ("mbr-id", value, &mbr_id) == -1)
> > return -1;
>
>...
2018 Jan 25
2
[PATCH v2 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
....75d9d37 100644
--- a/daemon/parted.ml
+++ b/daemon/parted.ml
@@ -125,6 +125,20 @@ let part_get_parttype device =
| _ ->
failwithf "%s: cannot parse the output of parted" device
+let part_get_mbr_part_type device partnum =
+ let parttype = part_get_parttype device in
+ let mbr_id = part_get_mbr_id device partnum in
+
+ (* 0x05 - extended partition id within the first 1024 cylinders.
+ * 0x0f - extended partition id beyond the first 1024 cylinders.
+ *)
+ match parttype, partnum, mbr_id with
+ | "msdos", (1|2|3|4), (0x05|0x0f) -> "extended"
+ |...
2019 Jan 21
0
[PATCH nbdkit v2 1/4] partitioning plugin: Support MBR logical partitions.
...egions (®ions); ++j) {
- const struct region *region = get_region (®ions, j);
-
- if (region->type == region_file) {
- i = region->u.i;
- assert (i < 4);
- create_mbr_partition_table_entry (region, i == 0,
- files[i].mbr_id,
- &out[0x1be + 16*i]);
- }
- }
+ size_t i, j = 0;
/* Boot signature. */
- out[0x1fe] = 0x55;
- out[0x1ff] = 0xaa;
+ primary[0x1fe] = 0x55;
+ primary[0x1ff] = 0xaa;
+
+ if (nr_files <= 4) {
+ /* Basic MBR with no extended partition. */...
2015 Mar 30
1
[PATCH RFC] resize: add p_mbr_p_type as member of type partition
...(* TARGET partition end (sector num). *)
+ p_mbr_p_type : partition_type (* Partiton Type (master/extended/logical) *)
}
and partition_content =
| ContentUnknown (* undetermined *)
@@ -73,9 +74,11 @@ and partition_id =
| No_ID (* No identifier. *)
| MBR_ID of int (* MBR ID. *)
| GPT_Type of string (* GPT UUID. *)
-
-type partition_type =
+and partition_type =
| PrimaryPartition
+ | ExtendedPartition
+ | LogicalPartition
+ | NoTypePartition
let rec debug_partition p =
printf "%s:\n" p.p_name;
@@ -99,7...
2014 Sep 22
1
Re: [PATCH v3 3/7] resize: add function find_partitions
...+++++++++++---------
> 1 file changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/resize/resize.ml b/resize/resize.ml
> index 8f2105c..cfd02fc 100644
> --- a/resize/resize.ml
> +++ b/resize/resize.ml
> @@ -446,14 +446,15 @@ read the man page virt-resize(1).
> | MBR_ID _ | GPT_Type _ | No_ID -> false
> in
>
> - let partitions : partition list =
> + let find_partitions part_type =
> let parts = Array.to_list (g#part_list "/dev/sda") in
>
> - if List.length parts = 0 then
> - error (f_"the source disk...
2019 Jan 20
1
[PATCH nbdkit] partitioning: Support MBR logical partitions.
An evolution of the patch I posted yesterday to qemu-devel
(https://www.mail-archive.com/qemu-devel@nongnu.org/msg588920.html)
which (a) works and (b) has a test.
Rich.
2017 Jul 14
0
[PATCH 19/27] daemon: Reimplement ‘list_filesystems’ API in the daemon, in OCaml.
...ors (RHBZ#887520). Assuming that libguestfs was
+ * compiled with ldm support, we'll get the filesystems on these later.
+ *)
+and is_mbr_partition_type_42 partition =
+ try
+ let partnum = Devsparts.part_to_partnum partition in
+ let device = Devsparts.part_to_dev partition in
+ let mbr_id = Parted.part_get_mbr_id device partnum in
+ mbr_id = 0x42
+ with exn ->
+ if verbose () then
+ eprintf "is_mbr_partition_type_42: %s: %s\n"
+ partition (Printexc.to_string exn);
+ false
diff --git a/daemon/listfs.mli b/daemon/listfs.mli
new file mode 10...
2018 Jan 28
0
[PATCH v3 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
....75d9d37 100644
--- a/daemon/parted.ml
+++ b/daemon/parted.ml
@@ -125,6 +125,20 @@ let part_get_parttype device =
| _ ->
failwithf "%s: cannot parse the output of parted" device
+let part_get_mbr_part_type device partnum =
+ let parttype = part_get_parttype device in
+ let mbr_id = part_get_mbr_id device partnum in
+
+ (* 0x05 - extended partition id within the first 1024 cylinders.
+ * 0x0f - extended partition id beyond the first 1024 cylinders.
+ *)
+ match parttype, partnum, mbr_id with
+ | "msdos", (1|2|3|4), (0x05|0x0f) -> "extended"
+ |...
2018 Apr 27
4
[PATCH v5 0/3] libguestfs: guestfs_list_filesystems: skip block devices which cannot hold file system
This patch series:
1. Addresses comments from last review:
part_get_mbr_part_type doesn't break original implementation in C.
2. Rebased on top of master and little bit refactored for readability.
Mykola Ivanets (1):
tests: md: Test guestfish list-filesystems command skips partitioned
md devices.
Nikolay Ivanets (2):
daemon: Reimplement 'part_get_mbr_part_type' API in