# gpart and geom classes



## bbzz (Nov 4, 2010)

Greetings, everyone.

I have a 4GB flash drive which decided to partition into 4 partitions, in a following manner using gpart:


```
gpart show da0
=>     63  7843752  da0  MBR  (3.7G)
       63  3481569    1  !11  (1.7G)
  3481632  1535940    2  freebsd  [active]  (750M)
  5017572  1535940    3  freebsd  (750M)
  6553512  1286208    4  freebsd  (628M)
  7839720     4095       - free -  (2.0M)
```

Last 3 partition have bootstrap code, and there is boot manager loaded into mbr.

Partition 1 is fat, since I need access to windows. Partitions 2 and 3 hold installations for FreeBSD i386/amd64. Last partition holds the actual installation of FreeBSD. This is convenient for me since I often need an access to random computer and could choose to install FreeBSD as well. 

While the boot manager (boot0) is readable by most of these computers I go to, sometimes upon choosing an option the system restarts. This happens every time on my Toshiba Tecra laptop, which is just a normal one year old system working fine with uptodate BIOS. 

I can't provide more information since there is nothing in BIOS looking strange to me, and no messages are printed on screen after I make my choice.

I was wondering what could the explanation be. What could possible be confusing the laptop to restart itself.

Another thing - When installing FreeBSD on a system, sometimes I need to load following modules beforehand or fdisk in sysinstall won't work:


```
load geom_label
load geom_bsd
load geom_bsd
```

Now I have some vague idea why this is required but I don't understand why is it only needed in specific cases, mostly when there is already some filesystem preinstalled on a disk (FAT, NTFS).

Finally, I would really like to know where can I find a COMPLETE list of fdisk and gpart commands for FreeBSD 8.1 ; the man pages are not complete.

Thanks.


----------



## bbzz (Nov 4, 2010)

```
gpart show da0
=>     63  7843752  da0  MBR  (3.7G)
       63  3481569    1  !11  (1.7G)
  3481632  1535940    2  freebsd  [active]  (750M)
  5017572  1535940    3  freebsd  (750M)
  6553512  1286208    4  freebsd  (628M)
  7839720     4095       - free -  (2.0M)
```

And a correction -

```
load geom_label
load geom_bsd
load geom_mbr
```


----------



## aragon (Nov 4, 2010)

bbzz said:
			
		

> I was wondering what could the explanation be. What could possible be confusion the laptop to restart itself.


Probably a rubbish BIOS.  Unfortunately there are many cases of manufacturers doing Strange Things when they write their BIOSes.



			
				bbzz said:
			
		

> Finally, i would really like to know where can i find a COMPLETE list of fdisk and gpart commands for freebsd 8.1 ; the man pages are not complete.


The source?


----------



## bbzz (Nov 4, 2010)

Hello,
There are more commands for all the schemes/partition types in gpart (-t -s), as well as fdisk (for example, that !11 which translates to fat partition and many others).

I can't remember the source(s), but i I can look it up again. Those same sources pointed to more complete description of commands, but I wouldn't be asking here if i I could remember what they were 

Thanks.


----------



## Beastie (Nov 4, 2010)

bbzz said:
			
		

> There are more commands for all the schemes/partition types in gpart (-t -s), as well as fdisk (for example, that !11 which translates to fat partition and many others).


They are parameters, not commands. If gpart understands them, you can use their names, e.g. *-t freebsd*. Otherwise you have to specify the partition's ID, e.g. *-t \!7* for an NTFS slice.
It is documented in the man page.



			
				bbzz said:
			
		

> I can't remember the source(s), but i I can look it up again. Those same sources pointed to more complete description of commands, but I wouldn't be asking here if i I could remember what they were


Create symlinks in your home directory.
`% cd ~/source_favorites ; ln -s /usr/src/path/to/some/file .`.


----------



## bbzz (Nov 4, 2010)

Correct, and that was bad point on my side.
Still there are commands missing, especially from fdisk. I really wish I could find that source I'm talking about.
Still, many thanks for response.


----------



## Beastie (Nov 4, 2010)

bbzz said:
			
		

> Still there are commands missing, especially from fdisk.


Like what? It would be good to report them.

If you want to use fdisk to create more than one slice, the best and easiest method is to use a "disk layout" file using the *-f* option, which is well documented:
`% man fdisk | less +/"Set slice values"`
and
`% man fdisk | less +/"When the -f option"`

Anything else can later be set/modified using the *-u* interactive switch.


----------

