# Growfs and gmirror



## none (Jun 1, 2019)

Hi,

I had to change one disk on a gmirror array. I had two 1TB disks, one died and I got one 2TB disk there. So far, so good, I created the same partition layout, freebsd-boot/freebsd-swap/freebsd-root, using GPT here.

Now I changed the other disk, so now I have two 2TB disks. And now I would like to grow the freebsd-root partition. I replaced the 1TB disk and let the 2TB alone on the array. Used gmirror forget and then I got where the array was complete with just one disk. Now I tried to growfs on the old 2TB disk before adding the new disk. I got some "operation not permitted" and got nowhere. I tried using /, /dev/mirror/root and the device. The latter got that error, other just said fs was already on top size.

So I decided to add the device to the mirror. I thought it may easy the things afterwards. It did not.

And there I got the issue. I tried to growfs the fs and the device. I get nowhere again:

# growfs /dev/mirror/root
growfs: requested size 930GB is not larger than the current filesystem size 930GB


```
Geom name: root
State: COMPLETE
Components: 2
Balance: load
Slice: 4096
Flags: NONE
GenID: 1
SyncID: 4
ID: 838844102
Type: AUTOMATIC
Providers:
1. Name: mirror/root
   Mediasize: 998057295360 (930G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
Consumers:
1. Name: ada1p3
   Mediasize: 1998233534464 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: NONE
   GenID: 1
   SyncID: 4
   ID: 3941328331
2. Name: ada0p3
   Mediasize: 1998251343872 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: NONE
   GenID: 1
   SyncID: 4
   ID: 3401957346
```

Is there a way to do this?
This is a remote box, and send someone there to boot from usb is not that easy.

thanks,

none


----------



## Spartrekus (Jun 1, 2019)

remotebox is cool, it allows to use CLI 

it might be more reliable to copy the data with cp from one disk to another one.
(although cp is not that much reliable at all).  rsync either. Well, there is no ideal way to accurately copy *+ check* disk copying until today. note that rsync check is bottleneck.

growfs is a good point, it might work but sometimes it just does not. Ideally would be to growfs and then afterwards to check if it did good job, by checksum.

Other way, cp or backup on a newfs fresh partition is actually more likely to work, keep data integrity like they should, by default.

Maybe a guess: https://sourceforge.net/projects/crcsum/


----------



## none (Jun 1, 2019)

Just an update.

No need to use tool different from gmirror and growfs. For the record, solved by running gmirror resize and growfs /.

Thanks to Eugene on freebsd-stable@.

none


----------

