# gpart extend/create huge partition help



## michalss (May 7, 2011)

Hello all,

I have a problem to with gpart as I'm trying to extend or create a new partition from huge array. What I have is this:


```
=>          0  39069634735  mirror/gm0  BSD  (18T)
            0      4194304           2  freebsd-swap  (2.0G)
      4194304      1048576           1  freebsd-ufs  (512M)
      5242880     62914560           4  freebsd-ufs  (30G)
     68157440      2097152           5  freebsd-ufs  (1.0G)
     70254592     62914560           6  freebsd-ufs  (30G)
    133169152    281759920           7  freebsd-ufs  (134G)
    414929072  38654705663              - free -  (18T)
```

What I need is to create a new partition and assign that 18 TB free space to it, but I have no idea where to start, because I don't want to break anything as there is system running on it. It is huge disk array raid 5.

This is partitioning so far:


```
/dev/mirror/gm0a    496M    266M    190M    58%    /
devfs               1.0K    1.0K      0B   100%    /dev
/dev/mirror/gm0g    130G    4.0K    120G     0%    /home
/dev/mirror/gm0e    989M     12K    910M     0%    /tmp
/dev/mirror/gm0f     29G    148M     27G     1%    /usr
/dev/mirror/gm0d     29G    602K     27G     0%    /var
```

Please anyone help me with command and things here?

Thank you in advance.


----------



## hedwards (May 7, 2011)

The command depends somewhat on what type of filesystem you want to use. But if you try something along the lines of the following it should work out. The -l will tell gpart to make the partition fill the rest of the disk, and obviously the -t freebsd-zfs will tell gpart to make it of that type rather than the other options.


```
# gpart add -t freebsd-zfs -l disk0 mirror/gm0
```

I would give plenty of thought to what filesystem you're going to want to use, as fscking a 18TB partition is going to take a really long time.

I haven't personally done such a thing, but that should get you on the right track.


----------



## michalss (May 8, 2011)

Thank you, I will do it from there. Really grat solution. I hope it's going to work well. But I have a question: do you think it is possible to make a new partition/disk from that free space? It would be much betteer for me than extending the existing one.

Regards.


----------



## hedwards (May 9, 2011)

michalss said:
			
		

> Thank you, I will do it from there. Really grat solution. I hope it's going to work well. But I have a question: do you think it is possible to make a new partition/disk from that free space? It would be much betteer for me than extending the existing one.
> 
> Regards.


I wasn't really thinking clearly when I posted that. The -l will give it a label, but by default it should fill the rest of the disk up with a new partition. At any rate, my error isn't going to cause any harm as you'd be able to remove the label without any risk of damage or lost data.


----------

