# Resize UFS partition?



## mbzadegan (Nov 6, 2016)

Hi everybody,
Here is the `gpart show` command reports that run on NAS4Free Live Image.
How can I resize the first FreeBSD UFS partition from 596M to 2GB?
Regards.


```
=>        63  1593835457  ada0  MBR  (760G)
          63     1220877     1  freebsd  [active]  (596M)
     1220940  1569550500     2  freebsd  (748G)
  1570771440     2088450     3  freebsd  (1.0G)
  1572859890    20975630        - free -  (10G)
```


----------



## teisho (Nov 6, 2016)

Try this: https://www.freebsd.org/doc/handbook/disks-growing.html
I'm not an expert, but unfortunately you have to delete partition 2 and 3 first.


----------



## T-Daemon (Nov 6, 2016)

Hear is a detailed tutorial:

http://www.unibia.com/unibianet/fre...t-partitionslice-safely-without-re-installing

(It wasn’t hard to find the tutorial with the help of a search machine.)

Important: From the tutorial: First, create a backup of every important item stored on this system. Don't skip this step!


----------



## mbzadegan (Nov 6, 2016)

T-Daemon said:


> Hear is a detailed tutorial:
> 
> http://www.unibia.com/unibianet/fre...t-partitionslice-safely-without-re-installing
> 
> ...


I searched with google more times (before posting) but all of tutorials that I found and This tutorial assume that I must delete the partitions after my point BUT I never want to delete any partitions!
In other OS (Such as linux) I could move next partitions and then resize my partition to my new size.
Is any other ways to avoid deleting any partitions?


----------



## T-Daemon (Nov 6, 2016)

mbzadegan said:


> I searched with google more times (before posting) but all of tutorials that I found and This tutorial assume that I must delete the partitions after my point BUT I never want to delete any partitions!
> In other OS (Such as linux) I could move next partitions and then resize my partition to my new size.
> Is any other ways to avoid deleting any partitions?



I’am afraid not. With Linux, assuming the filesystem is well supported, maybe you can do that, but not with the ufs file system.  For ufs you need free space in order to grow them. From the Handbook: “Partitions can only be resized into contiguous free space.”. In your case, to resize the first ufs partition, the order of the tasks are backup first the content of the partitions, delete, create, repopulate from backup.

Or the easy way: Install from the Live image to another drive as recommend (preferred method) by NAS4Free, creating the partition size as desired.


----------



## mbzadegan (Nov 6, 2016)

Yes,
gparted only detect ufs but do not able to move it!!
gparted could move ext file systam well.
Does UFS could not moveable or still this feature not developed?


----------



## ANOKNUSA (Nov 6, 2016)

Yes, on Linux you can use Gparted to copy, move, and resize partitions formatted with certain filesystems. But I'm telling you from lots of experience: it takes longer than just backing up and restoring the filesystems, and carries a greater risk. Just back up the data,recreate the partitions, and restore.


----------



## Oko (Nov 7, 2016)

ANOKNUSA said:


> Yes, on Linux you can use Gparted to copy, move, and resize partitions formatted with certain filesystems.


He can use Logical Volume Manager on Linux but that is not something done on the regular basis. In four years working with Red Hat I think I used  two times and both time I had my data backed up because I was not feeling confident with LVM. It worked fine in both cases.

mbzadegan

Read man pages  growfs(8) That might give you an idea what is possible with UFS.


----------



## mbzadegan (Nov 7, 2016)

The Consequence of this Thread is that UFS can not movable filesystem as ext(2,3,4) or fat. Thanks to all.


----------

