# SWAP resizing help



## DarkFreeBSD (Jan 27, 2020)

Hi,

I don't know if I'm in the right place.

I need your advice and your know-how.

I would like to reduce my partition from 924G to 916G and increase the swap from 8G to 16G.

```
root @ Firewall: / # gpart show
=> 63 1953525105 ada0 MBR (932G)
           63 1953525105 1 freebsd [active] (932G)

=> 0 1953525105 ada0s1 BSD (932G)
            0 16 - free - (8.0K)
           16 1936747873 1 freebsd-ufs (924G)
   1936747889 16777216 2 freebsd-swap (8.0G)
```
Can anyone tell me if this is possible in my configuration?

And give me the command lines in console mode.

Regards, (French mother tongue)


----------



## George (Jan 28, 2020)

You can resize the partition with "gpart resize -i 1 -s 916G ada0s1".
But it might harm the file system on the partition. In any case, the UFS file system can only grow. It can't get smaller. You would need to create a new file system on that partition (with `newfs` ).

The handbook entry is here: Resizing and Growing Disks


----------



## SirDice (Jan 28, 2020)

You can't make it smaller, only make it bigger. So, backup, repartition, restore. 

But if you just want to increase your swap think about simply adding a swapfile instead. 

11.12.2. Creating a Swap File


----------



## DarkFreeBSD (Jan 29, 2020)

Hi,

Thank you for your clear answers, I would have learned that on linux it is not necessary to entirely cut the disc (error of beginner). A system strategy is required to be able to evolve on units of a storage medium. I will continue my assessments.

Regards,  (French mother tongue)


----------

