Lists all of the journal entries for the day.

Sat, 28 Jan 2012

3:01 PM - Quick and Dirty GEOM print program

While debugging a GEOM related problem with a program, I ended up needing a way to print out data from what libgeom gets from the kernel.  Below is a quick and dirty dump program for just such a situation.  Compile it with 

gcc -std=c99 -lgeom prog.c -o prog 


#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <libgeom.h>

#include <stdint.h>


void read_geom_mesh(struct gmesh *mesh);



read_geom_mesh(struct gmesh *mesh)


        struct gclass *classp;

        struct ggeom *gp;

struct gprovider *provider;



         * Build the device table. First add all disks (and CDs).



        LIST_FOREACH(classp, &mesh->lg_class, lg_class) {



LIST_FOREACH(gp, &classp->lg_geom, lg_geom) {

printf(" %ud %s ", gp->lg_id, gp->lg_name);

LIST_FOREACH(provider, &gp->lg_provider, lg_provider) {

printf(" provider: %u %s %s ", provider->lg_id, provider->lg_name, provider->lg_mode);







int main(int argc, char *argv[]) {

int error;

        struct gmesh mesh;

error = geom_gettree(&mesh);


if (error == 0)



return 0;

tags: geom debug


3:04 PM - Output from the previous program

Here's some sample output from the previous program:


3333812352d ad2

provider: 3333787264 ad2s1 r0w0e0

3330560128d ad8

provider: 3334536832 ad8s1 r0w0e0

3334457344d ad10

provider: 3334457088 ad10s1 r0w0e0

provider: 3334456832 ad10s2 r0w0e0

3334600960d ad14

provider: 3334600704 ad14s1 r5w5e5

provider: 3334600448 ad14s2 r0w0e0

provider: 3334600192 ad14s3 r0w0e0

3334599680d ar0

provider: 3334536064 ar0s1 r2w2e3


3335112064d ffs.ad14s1a

3337421568d ffs.ad14s1e

3334689408d ffs.ad14s1f

3334689024d ffs.ar0s1d

3337421184d ffs.ad14s1d

3334688128d ffs.ar0s1e


3334596480d ad10s1

provider: 3334596352 ntfs/System Reserved r0w0e0

3334636288d ad14s3

provider: 3334636160 ntfs/BackupSegat r0w0e0

3334820992d ad8s1d

provider: 3334820864 ufsid/4b96b6328b08d595 r0w0e0

3334817280d ad14s2a

provider: 3334817152 ufsid/498431b32a15c897 r0w0e0

3334816000d ad14s2d

provider: 3334815872 ufsid/498431b7f20edba4 r0w0e0

3334691200d ad14s2e

provider: 3334691072 ufsid/498431b339c56ba6 r0w0e0

3334462208d ad14s2f

provider: 3334462080 ufsid/498431b3649da79d r0w0e0


3334599168d ad8s1

provider: 3334599040 ad8s1c r0w0e0

provider: 3334598784 ad8s1d r0w0e0

provider: 3334598272 ad8s1e r0w0e0

3334595328d ad14s1

provider: 3334595200 ad14s1a r1w1e1

provider: 3334594944 ad14s1b r1w1e0

provider: 3334594688 ad14s1c r0w0e0

provider: 3334456704 ad14s1d r1w1e1

provider: 3334456960 ad14s1e r1w1e1

provider: 3334596992 ad14s1f r1w1e1

3334691584d ad14s2

provider: 3334637696 ad14s2a r0w0e0

provider: 3334637440 ad14s2c r0w0e0

provider: 3334637184 ad14s2d r0w0e0

provider: 3334636928 ad14s2e r0w0e0

provider: 3334636672 ad14s2f r0w0e0

3334534912d ar0s1

provider: 3334635776 ar0s1c r0w0e0

provider: 3334822656 ar0s1d r1w1e1

provider: 3334822400 ar0s1e r1w1e1


3334536192d ad10

provider: 3334601856 ad10p1 r0w0e0

provider: 3334601600 ad10p2 r0w0e0

3358966272d da0

provider: 3440290816 da0p1 r0w0e0

provider: 3350360320 da0p2 r0w0e0

provider: 3359112064 da0p3 r0w0e0


3333812992d ad2

3333786368d ad2s1

3331329152d acd0

3334457600d ad8

3334536576d ad9

3334536320d ad10

3334456576d ad14

3334599936d ar0

3334599424d ad8s1

3334597888d ad10p1

3334597376d ad10p2

3334638208d ad10s1

3334637952d ad10s2

3334535168d ad14s1

3334598016d ad14s2

3334638592d ad14s3

3334600576d ar0s1

3334822016d ad8s1c

3334821376d ad8s1d

3334820352d ad8s1e

3334819328d ntfs/System Reserved

3334818560d ad14s1a

3334534144d ad14s1b

3334533632d ad14s1c

3334937088d ad14s1d

3334817920d ad14s1e

3334634112d ad14s1f

3334633600d ad14s2a

3334816640d ad14s2c

3334462848d ad14s2d

3334692224d ad14s2e

3334637056d ad14s2f

3334633344d ntfs/BackupSegat

3334595712d ar0s1c

3334598144d ar0s1d

3334534656d ar0s1e

3334822784d ufsid/4b96b6328b08d595

3334822272d ufsid/498431b32a15c897

3334462464d ufsid/498431b7f20edba4

3334936192d ufsid/498431b339c56ba6

3335072256d ufsid/498431b3649da79d

3440312704d da0

3440383360d da0p1

3372503936d da0p2

3440380288d da0p3


3333813376d ad2

provider: 3333813248 ad2 r0w0e0

3334459776d ad8

provider: 3334459648 ad8 r0w0e0

3334459392d ad9

provider: 3334459008 ad9 r0w0e0

3334458752d ad10

provider: 3334458624 ad10 r0w0e0

3334458368d ad14

provider: 3334458240 ad14 r5w5e6

3334457984d ar0

provider: 3334457856 ar0 r2w2e4

3440305536d da0

provider: 3372510464 da0 r0w0e0



3334536448d swap



3333787008d acd0

provider: 3333786880 acd0 r0w0e0