# fdisk, sade and GEOM



## Twister (Nov 28, 2011)

Hello!

How to make kernel reread partition information from disk without reboot?

I want to make new slice on second HDD. Disk has two slices - ad7s1 (/tmp and second swap) and ad7s2 (/opt - UFS). I want to delete old /opt and make new /opt with ZFS.

I unmounted /opt and deleted slice:

```
#umount /opt
#gpart delete -i 2 ad7
```
but when I try to make new slice, gpart can't do this:

```
#gpart add -t freebsd-zfs ad7
gpart: Invalid argument
```

I tried also with '-b' and '-s' options with same result.

When I use sade or fdisk - it creates second slice (after *sysctl kern.geom.debugflags=16*). But geom can't see second slice on disk - *gpart show* shows only one slice on the disk when fdisk shows two!

Moreover - disk ad7 has two slices but there is no ad7s2 in /dev! So I can't use bsdlabel! As I read in Google fdisk and sade use direct access to the disk when gpart and bsdlabel uses kernel GEOM subsystem so I need to renew GEOM information in kernel so gpart and bsdlabel can use it.

So - how can I make kernel to renew information about slices, partitions and so on without restarting system?


----------



## Twister (Nov 28, 2011)

Sorry, I forgot...

FreeBSD 8.2


----------



## wblock@ (Nov 28, 2011)

Looks like freebsd-zfs is not a valid MBR partition type.  This shows using just freebsd instead.

Using GPT partitions is simpler than MBR and disklabels.


----------



## Twister (Nov 28, 2011)

wblock@ said:
			
		

> Looks like freebsd-zfs is not a valid MBR partition type.  This shows using just freebsd instead.
> 
> Using GPT partitons is simpler than MBR and disklabels.



Thanks!
I think it works.

I'm already deleted all partitions and MBR from disk, created GPT partitions and restored all informations.

```
# gpart show ad7
=>        34  1465149101  ad7  GPT  (699G)
          34    10485760    1  freebsd-ufs  (5.0G)
    10485794    10485760    2  freebsd-swap  (5.0G)
    20971554  1444177581    3  freebsd-zfs  (689G)
```


----------

