Displaying 20 results from an estimated 85 matches for "part_get_mbr_id".
2014 Sep 09
2
CoreOS support
Hello,
is CoreOS supported by libguestfs?
I was trying to run several commands some were successful others ended up with an error:
for example virt-df was OK but when I tried to do virt-resize I got the following error message:
root@ny2proxd03:/var/lib/vz/images/100# virt-resize --expand /dev/sda3 vm-100-disk-1.qcow2 vm-100-disk-1.qcow2.resized
Examining vm-100-disk-1.qcow2 ...
100%
2017 Jul 14
0
[PATCH 10/27] daemon: Reimplement ‘part_get_mbr_id’ API in OCaml.
...ting and setting the ID byte. In
- * future, extend parted to provide this functionality. As a result
- * of using sfdisk, this won't work for non-MBR-style partitions, but
- * that limitation is noted in the documentation and we can extend it
- * later without breaking the ABI.
- */
-int
-do_part_get_mbr_id (const char *device, int partnum)
-{
- if (partnum <= 0) {
- reply_with_error ("partition number must be >= 1");
- return -1;
- }
-
- const char *param = test_sfdisk_has_part_type () ? "--part-type" : "--print-id";
-
- char partnum_str[16];
- snprintf...
2014 Sep 09
2
Re: CoreOS support
...fs: trace: pvs_full = <struct guestfs_lvm_pv_list *>
libguestfs: trace: part_list "/dev/sda"
libguestfs: trace: part_list = <struct guestfs_partition_list *>
libguestfs: trace: part_get_bootable "/dev/sda" 1
libguestfs: trace: part_get_bootable = 1
libguestfs: trace: part_get_mbr_id "/dev/sda" 1
libguestfs: trace: part_get_mbr_id = -1 (error)
libguestfs: trace: vfs_type "/dev/sda1"
libguestfs: trace: vfs_type = "vfat"
libguestfs: trace: mount_ro "/dev/sda1" "/"
libguestfs: trace: mount_ro = 0
libguestfs: trace: statvfs "/&...
2012 Dec 15
1
virt-resize Fatal error: exception Guestfs.Error("e2fsck_f
...race: pvs_full = <struct guestfs_lvm_pv_list *>
libguestfs: trace: part_list "/dev/sda"
libguestfs: trace: part_list = <struct guestfs_partition_list *>
libguestfs: trace: part_get_bootable "/dev/sda" 1
libguestfs: trace: part_get_bootable = 1
libguestfs: trace: part_get_mbr_id "/dev/sda" 1
libguestfs: trace: part_get_mbr_id = 131
libguestfs: trace: vfs_type "/dev/sda1"
libguestfs: trace: vfs_type = "ext4"
libguestfs: trace: mount_ro "/dev/sda1" "/"
libguestfs: trace: mount_ro = 0
libguestfs: trace: statvfs "/&q...
2020 Feb 20
0
buffer overflow detected in collectd using libguestfs
...ve50 collectd[4689]: libguestfs: trace: part_to_partnum = 1
Feb 20 15:58:11 tve50 collectd[4689]: libguestfs: trace: part_to_dev
"/dev/sda1"
Feb 20 15:58:11 tve50 collectd[4689]: libguestfs: trace: part_to_dev =
"/dev/sda"
Feb 20 15:58:11 tve50 collectd[4689]: libguestfs: trace: part_get_mbr_id
"/dev/sda" 1
Feb 20 15:58:11 tve50 collectd[4689]: libguestfs: trace: part_get_mbr_id =
264650159
Feb 20 15:58:11 tve50 collectd[4689]: libguestfs: trace: vfs_type
"/dev/sda1"
Feb 20 15:58:11 tve50 collectd[4689]: libguestfs: trace: vfs_type = "ext3"
Feb 20 15:58:11 tv...
2014 Sep 09
2
Re: CoreOS support
...in_loop: proc 213 (part_list) took 0.03 seconds
guestfsd: main_loop: new request, len 0x38
parted -m -- /dev/sda unit b print
libguestfs: recv_from_daemon: 44 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 ea | 00 00 00 01 | 00 12 34 09 | ...
libguestfs: trace: part_get_bootable = 1
libguestfs: trace: part_get_mbr_id "/dev/sda" 1
libguestfs: send_to_daemon: 60 bytes: 00 00 00 38 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 eb | 00 00 00 00 | ...
guestfsd: main_loop: proc 234 (part_get_bootable) took 0.05 seconds
guestfsd: main_loop: new request, len 0x38
udevadm settle
sfdisk --print-id /dev/sda 1
WARNING:...
2017 Jul 14
0
[PATCH 20/27] daemon: Reimplement ‘part_list’ API in OCaml.
...d.ml
index 6be41cf66..37e1b42be 100644
--- a/daemon/parted.ml
+++ b/daemon/parted.ml
@@ -22,6 +22,8 @@ open Std_utils
open Utils
+include Structs
+
(* Test if [sfdisk] is recent enough to have [--part-type], to be used
* instead of [--print-id] and [--change-id].
*)
@@ -53,3 +55,52 @@ let part_get_mbr_id device partnum =
(* It's printed in hex, possibly with a leading space. *)
sscanf out " %x" identity
+
+let print_partition_table ~add_m_option device =
+ udev_settle ();
+
+ let args = ref [] in
+ if add_m_option then push_back args "-m";
+ push_back args "...
2014 Feb 03
2
[PATCH] resize: properly restore GPT partition types
...@@ -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 _ -> None in
+ let mbr_id, gpt_type =
+ match parttype with
+ | GPT ->
+ None, (try Some (g#part_get_gpt_type "/dev/sda" part_num)
+ with G.Error _ -> None)
+...
2014 Sep 26
9
[PATCH v4 0/7] virt-resize: add support for resizing logical partitions
Hi Rich,
This is v3 series to add support for resizing MBR logical partitions.
changes to v3:
1. merge patch 1 and patch 3 in v3
2. let mbr_part_type return 'primary' for GPT partitions
3. add test for resizing logical partitions
4. fix extending the extended partition (yet). see patch 7.
changes to v2:
1. remove p_part_num
2. remove filter_parts
3. name the function
2018 Apr 09
0
[PATCH 2/3] daemon: use the structs from the Structs module
...parted.mli
index d547f2f2a..0b7eb87f4 100644
--- a/daemon/parted.mli
+++ b/daemon/parted.mli
@@ -16,15 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*)
-type partition = {
- part_num : int32;
- part_start : int64;
- part_end : int64;
- part_size : int64;
-}
-
val part_get_mbr_id : string -> int -> int
-val part_list : string -> partition list
+val part_list : string -> Structs.partition list
val part_get_parttype : string -> string
diff --git a/daemon/statvfs.mli b/daemon/statvfs.mli
index d241f995b..13b22f88d 100644
--- a/daemon/statvfs.mli
+++ b/daemo...
2018 Apr 10
0
[PATCH v2 2/5] daemon: use the structs from the Structs module
...parted.mli
index d547f2f2a..0b7eb87f4 100644
--- a/daemon/parted.mli
+++ b/daemon/parted.mli
@@ -16,15 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*)
-type partition = {
- part_num : int32;
- part_start : int64;
- part_end : int64;
- part_size : int64;
-}
-
val part_get_mbr_id : string -> int -> int
-val part_list : string -> partition list
+val part_list : string -> Structs.partition list
val part_get_parttype : string -> string
diff --git a/daemon/statvfs.mli b/daemon/statvfs.mli
index d241f995b..13b22f88d 100644
--- a/daemon/statvfs.mli
+++ b/daemo...
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.
2018 Jan 25
2
[PATCH v2 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
...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"
+ | "msdos"...
2018 Jan 28
0
[PATCH v3 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
...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"
+ | "msdos"...
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
2018 Apr 27
0
[PATCH v5 2/3] daemon: list-filesystems: Don't list partitions which cannot hold file system.
...). 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
--
2.17.0
2018 Jan 25
0
[PATCH v2 2/3] daemon: list-filesystems: Don't list partitions which cannot hold file system.
...). 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
--
2.9.5
2018 Sep 19
2
virt-customize is very slow in ubuntu 18.04/centos 7.5
...ev/sda1"
guestfsd: main_loop: proc 293 (part_to_partnum) took 0.01 seconds
guestfsd: main_loop: new request, len 0x38
commandrvf: stdout=n stderr=y flags=0x0
commandrvf: udevadm --debug settle -E /dev/sda1
calling: settle
libguestfs: trace: part_to_dev = "/dev/sda"
libguestfs: trace: part_get_mbr_id "/dev/sda" 1
guestfsd: main_loop: proc 272 (part_to_dev) took 0.01 seconds
guestfsd: main_loop: new request, len 0x38
commandrvf: stdout=n stderr=y flags=0x0
commandrvf: udevadm --debug settle -E /dev/sda
calling: settle
commandrvf: stdout=y stderr=y flags=0x0
commandrvf: sfdisk --help
co...
2018 May 01
9
[PATCH v6 0/7] daemon: list_filesystems: filter out block devices which cannot hold filesystem
This patch series:
1. Addresses comments from v5 series review
2. Large commit is splitted to more granular commits for better code review.
Mykola Ivanets (6):
daemon: Changing the way that we detect if a device contains
partitions.
daemon: list-filesystems: Ignore partitioned MD devices.
tests: list-filesystems command ignores partitioned MD devices.
daemon: list-filesystems: Change
2018 Apr 09
5
[PATCH 0/3] daemon: generate almost all the API OCaml interfaces
Hi,
as a followup for the signature fix for mount_vfs [1], here it is a
patch series to generate automatically most of the OCaml interfaces of
daemon actions. Only the Lvm and Mount modules are left with
hand-written interfaces.
[1] https://www.redhat.com/archives/libguestfs/2018-April/msg00059.html
Thanks,
Pino Toscano (3):
daemon: directly use Optgroups
daemon: use the structs from the