I'm trying to use resize_ffs with NetBSD to increase the size of my partition. I have NetBSD running in a virtual machine, and have expanded the size of the disk, and now wish to grow the partition to match.

Here is the man page for the tool.

I am trying to grow a 300 MB partition to 1 GB.

The tool's man page says that specifying a size is not mandatory, and that if it is not specified it will grow to use available space (ideal behaviour). However this results in an error saying newsize not known.

I have used various online tools to try and calculate the disk geometry, but no matter what I try when I pass a number to -s, I get the error "bad magic number".

I have been unable to find example of using this tool online.

What is the correct way to use resize_ffs to grow a partition to use available disk space?

  • I'm not very familiar with NetBSD, but it seems to me that resize_ffs is the tool for resizing the filesystem within the partition. You'll probably first have to use some disk partitioning tool to increase the size of the partition, and then resize_ffs to make the filesystem use the new capacity within the partition. – telcoM Aug 11 '19 at 8:07
  • Ah, that of course makes sense! However, after expanding the partition with fdisk, I get exactly the same errors when trying to use the tool – Jake Rankin Aug 11 '19 at 8:42
  • bad magic number means it cannot find a superblock. Can you still fsck the filesystem? Are you sure you didn't move the start of the partition? – Greg A. Woods Aug 23 '19 at 7:06
  • I can still fsck fine, and as far I know I didn't move the start of the partition – Jake Rankin Aug 31 '19 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.