# Warnings during/after growfs



## semafoor (Oct 6, 2013)

Hey everybody,

Sorry to bother, but I'm having trouble on FreeBSD 8.4 with the holy grail that is growing partitions and filesystems.

I gathered some instructions from Google. They *seem* to have worked, and as the space requirements were pretty urgent, I did not roll back to my backup. However, there were some disconcerting warnings. 

* The growfs command gave the following warning:

```
new file systemsize is: 23621158 frags
Warning: 44376 sector(s) cannot be allocated.
growfs: 46113.4MB (94440256 sectors) block size 16384, fragment size 2048
        using 251 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
        with soft updates
```
* At next boot, GEOM produced a warning:

```
GEOM: da0s1: media size does not match label.
```

Could I be doing something wrong?

What I did was the following:

* Shutdown virtual machine and increase its storage from 30GB to 50GB.
* Boot from 8.4 live ISO.
* In sysinstall, choose "Fixit" from menu.
* Resize the slice and partition. By default, the resize command will use all available space. Rescan after changing the MBR.

```
gpart show
 gpart resize -i 1 da0
 true > /dev/da0
 gpart show
 gpart resize -i 6 da0s1
 gpart show
```
* Grow the filesystem:
`growfs /dev/da0s1f`

The current output of `gpart show` (I don't have a 'before' copy):

```
=>       63  104857537  da0  MBR  (50G)
         63  104857515    1  freebsd  [active]  (50G)
  104857578         22       - free -  (11k)

=>        0  104857515  da0s1  BSD  (50G)
          0    1048576      1  freebsd-ufs  (512M)
    1048576    4120336      2  freebsd-swap  (2G)
    5168912    4155392      4  freebsd-ufs  (2G)
    9324304    1048576      5  freebsd-ufs  (512M)
   10372880   94484635      6  freebsd-ufs  (45G)
```

As said, da0s1f looks like it works normally (I tried `dd`ing to a test file until it was full), but it doesn't quite feel right!

Any input -> appreciated


----------



## semafoor (Nov 7, 2013)

A little bump  TLDR version of my original post: growfs and GEOM give me warnings during/after growing a disk, and I'm scared! 

Some more data points:


 The machine seems to be doing fine after a month.

 I'm thinking the growfs "sector(s) cannot be allocated." warning isn't that bad, after perusing  ftp://ftp.tw.freebsd.org/pub/branches/-current/src/sbin/growfs/growfs.c - I don't know EXACTLY what goes on, but it seems to be a special case that's at least recognized and handled.

 The dmesg message 
	
	



```
GEOM: da0s1: media size does not match label.
```
 is still scary, but I can't see anything wrong in output of `g*` commands, and I don't know how to update the label.
Still, I'm scared to grow more filesystems because of these errors though, so if anyone has any idea about debugging the GEOM warning, I'd love to hear it!


----------



## wblock@ (Nov 7, 2013)

Probably not dangerous unless you store data at or near the end of the partition.  But why risk it?  Create a new disk, set it up as shown in Disk Setup On FreeBSD, then copy data over as shown in Backup Options For FreeBSD.


----------



## semafoor (Nov 7, 2013)

wblock@ said:
			
		

> Probably not dangerous unless you store data at or near the end of the partition.  But why risk it?  Create a new disk, set it up as shown in Disk Setup On FreeBSD, then copy data over as shown in Backup Options For FreeBSD.


Hey, thanks for replying 

Well, the reason I'd hate do a dump/restore, is that it takes so much downtime. Generally, the boxes most likely to need a 'growfs' are those that are used heavily...

It's too bad that `gpart resize` seems still somewhat in the realm of cowboys though. I seem to have the incantation right, and also tried it using `fdisk`, but consistently paniced the kernel with that...


----------



## wblock@ (Nov 7, 2013)

It really should not need much downtime.  Add another disk (image), dump/restore to it (using snapshots while the system is running), shut down, swap drives and resync if needed, and reboot.


----------

