Moving my system to a bigger drive

Hi there! Sorry if this is the wrong place to post this, but I am not 100% sure where to do it:

The issue is about what the title says: I got a Thinkpad T420 last year, and wanted to test some different OS on it. FreeBSD was one of them: The thing is that it came with a 250GB SSD, and after this year I decided I want to keep FreeBSD as my daily driver, but I am struggling for space. Currently I have a partition for FreeBSD, and another one for OpenBSD. I got a drive twice the space, but I am thinking that I want FreeBSD as the main partition, and two smaller ones for Haiku OS, and FreeDOS. I don't think I need to give any of those over 1GB each, so it is moving to a bigger drive, and change the geometry.

Now, my idea when I got this drive, was just to reinstall everything, but after all this time, I got a system I am currently really happy with. I have been a Linux user for 20 years, so I am aware of tools there to clone and resize partitions, but on BSD, hard disk management tools are quite different. Again, I could just reinstall, but I would like to know if I could have a more elegant solution than copy config files from an external drive. I also managed to get a very sweetly configured machine, so I would love if I could just migrate it, resize partitions, and set up the new secondary two OS.

Any ideas? And thanks in advance!
 
If I understand you correctly, you are just trying to move your FreeBSD installation from one drive to another empty drive. You are not trying to move partitions around and resize on a single drive.

If that is so, you can just use dump(8) or just cp(1) to copy the filesystem from one disk to another then use growfs(8).

Use gpart(8) create and then add to create the new disk's partition table and partition. Once you do that, the new device partition will show up, ex: /dev/ada1p1

Copy the filesystem to that device, ex: dump -fL /dev/ada1p1 /dev/ada0p1

Grow the new filesystem to fill its partition, ex: growfs /dev/ada1p1

Make sure you mount that new disk and fix the fstab entries.

If you do not remove your current FreeBSD partition, you may have problems booting. If you do not remove it, explicitly set the root in /boot/loader.conf on the boot drive with, ex: vfs.root.mountfrom="ufs:/dev/ada1p1"
See loader.conf(5) for how it determines how to boot.
 
  • What file system is the original installation using, UFS2 or ZFS?
  • Which FreeBSD version is installed?
  • Tell us about the system firmware boot method. Is it legacy BIOS or UEFI?
 
Back
Top