Reputation: 19
I'm trying to resize a UFS file system on an old FreeBSD server (FreeBSD 7.1). I'm using gpart to do this,following this documentation: https://www.freebsd.org/doc/handbook/disks-growing.html
I may be running an old/deprecated version of it or something, but my gpart does not even display the "resize" command as an option. It always shows up as "Unknown":
Pretty confused as I've scoured the net (first two pages of lots of Googling) to no avail.
Alternatively, is there a way to resize the disk using the commands listed? Any help would be super appreciated! Thank you.
Upvotes: 1
Views: 362
Reputation: 13
Without looking things up, I would say that the resize command wasn't included in gpart in FreeBSD until after your version. Sadly you also lack the gpart backup and restore commands which will backup and restore your guid partition layout without affecting your filesystems. At this point I would say that you can grow the partition but if you aren't careful you will lose data. Finally, these steps assume familiarity with the gpart command on FreeBSD. Warren Block's document is my goto resource for gpart. Having said that, with no resize command, you'll have to resize the partition manually by taking the following steps:
umount
gpart delete -i ...
gpart create -i
using the appropriate start, size, and or end pointsIf you are growing the partition by appending empty space onto it, take the following steps:
If both of these checks pass: fsck reports no problems and df reports the correct, the old, amount of space, then:
growfs
to grow the filesystem into the newly created space man growfs
for more information.mount
After the mount works, check your data if everything looks good, you are done. Keep the backup around just in case.
If you are shrinking the partition; If you are moving the data from one place to another; or if the grow in place procedure failed as tested by fsck, df, and mount:
newfs
mount
Honestly, you haven't said much about your situation. For example, is this a virtual machine or a physical server? If it's virtual you can shutdown the machine and snapshot the disks. If things go badly, you can restore your previous state from the snapshot. If it's physical, could you plug in a USB drive to store the partition's data temporarily while you grow the partition.
This is the way that I've done it on virtual machines on ESXi and it works great but I'd really be concerned if I didn't have a good backup and a snapshot to fall back on.
Upvotes: 0