# Does "growfs" actually work properly?



## Niatross (Feb 26, 2014)

Does growfs(8) actually work properly or are there bugs in it?

This is the situation:

I have the following two FreeBSD partitions:

da0s1a
da0s2a

My goal:

Remove the da0s2 MBR partition (AKA: slice) and expand the FreeBSD partition (da0s1a) across the whole device.

Here are the steps I take:

1) Remove the da0s2 MBR partition (AKA: slice)
2) Extend the da0s1 MBR partition (AKA: slice) across the whole device using `fdisk -u da0`.
3) Edit `bsdlabel` (ex: `bsdlabel -e -A da0s1`) and expand the  a FreeBSD partition across the whole da0s1 MBR partition (AKA: slice)
4) `growfs da0s1a`
5) `fsck -y /dev/da0s1a`

The problem:

After I run step 5 (above), a ton of files get placed in my "lost+found" directory.

One time,  I had to run step 5 (above) four times to get a clean system and once I rebooted it, the system couldn't load the kernel, because some of those files were placed in the lost+found directory.

What am I doing wrong?

PS: I know I can backup the live FreeBSD system with dump(8) and then repartition the device and restore FreeBSD, but I wanted to try the growfs(8) method.


----------



## wblock@ (Feb 27, 2014)

What version of FreeBSD?  Are you trying to do this on a mounted filesystem?


----------



## trasz@ (Apr 5, 2014)

Using growfs() should work just fine, assuming you're running 10.0-RELEASE.


----------

