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?
 
Any ideas? And thanks in advance!
While jwillia3 way is SAT I am a dd guy. Since new drive is bigger I would just dd the whole thing to new drive.
Then with extra space you could add your Haiku partitions or delete anything unneeded.

Once you dd your new drive and resolved partitions you have to expand the FreeBSD filesystem.
For UFS First Grow the FreeBSD partition
example:
gpart resize -i2 ada1 << Notice it uses INDEX number for partition as found in gpart show
then:
Grow the new filesystem to fill its partition, ex: growfs /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
Note that you can restore in an existing filesystem. So I would create a bigger partition on the bigger disk, newfs it and then dump/restore.
 
If ZFS a way is to use a bigger drive and then mirror. After resilver done, you could break the mirror and have bigger space
 
TBH, I wouldn't personally bother trying to move disk partitions over, even when it does work it can get messy. If you've got the option, it's probably the most straightforward to just do a completely new install on the new disk and then transfer things like /home over to the new disk. Any directory that's not part of the core install is probably not a problem to just copy directly over, just mind the permissions if you've done anything non-standard and ensure that if you're trying to bring users over that you've accounted for any possible UID and GID changes.

I personally keep a bunch of notes about stuff related to rc.conf pf.conf, loader.conf and any configurations related to software I've installed. If you aren't using pkgbase yet, freebsd-update IDS will give you a fairly good sense of what files in /etc have been modified. Or, you can also just use diff to do that as well.

As a side benefit, it's also a great practice for the next time there's a major update as it's generally better to just reinstall when going between major releases, even if not technically required.
 
Hi, reading the comments:

I am using UFS, as I am limited on RAM and I understand the logic of it much better.
I am on 15.0-Release 9
And I am using BIOS, not UEFI

For what I read, It would be better to reinstall, I might want to find another solution, just to learn and familiarize myself better with BSD. I do know Gparted well, just trying to learn something new. For now, my main "nuissance" is that I am using WindowMaker, and because the official repo is not that well stocked with applets, I did manually compile a bunch. Not the end of the world, because I am keeping all repos on my /home and I can just recompile. That said, I might end just reinstalling.

The main issue I see now, is that I have a good portion of my hard drive dedicated to OpenBSD. As I want to install two much smaller systems, I might also want to change the partitions to give more space to FreeBSD, and less to other OS in percentage. As I said: 2GB should be enough to reserve, plus a bit on unused space for the SSD for longevity reasons: I didn't do that, thinking to use the SWAP space instead, as I do with Linux, but I also notice that it is very common to end using SWAP with FreeBSD if you don't shut it down regularly.
 
BTW, I never heard of Pkgbase. Is there any specific benefit over freebsd-update? I am not completely new to FreeBSD, but I had a long pause, and when I left I wasn't exactly an expert.
 
BTW, I never heard of Pkgbase. Is there any specific benefit over freebsd-update? I am not completely new to FreeBSD, but I had a long pause, and when I left I wasn't exactly an expert.
It's still optional. It just uses the same tools for updating the system as we use for packages. Right now, you can stick with freebsd-update if that's what you're comfortable with, but on the whole the pkgbase seems to be fine.

You don't have to reinstall, it's just straightforward and limits the stuff that can go wrong between starting and having a functioning system from which to finish copying the non-system files you're looking to transfer.
 
Reinstalling is defeatist.

Never reinstall.
I'm not personally sure that it's worth wasting hours on that and the resulting headaches in some cases. Or the possibility of data loss from screwing things up when trying to transfer to a different disk and typing something wrong and the resulting backups that may very well include a bunch of stuff that I'm not really interested in, but won't know until later.

But, to each his own I suppose.
 
I've been using FreeBSD for about 25 years and I hardly ever reinstall. I've transferred the OS to a new drive numerous times and I've never had a single problem.

IMO there is much more scope for problems with reinstalling and then having to put the system back to how you want it.
 
Every time you reinstall you learn to install - which you already know.

Every time you move an existing install you learn something new.
 
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!

Can you post your partition table? That would allow us to give more concrete recommendations for a move.
 
Thing I like about DD is you put the old drive aside and you can wang away at the cruft. Ditch or move your OpenBSD. Make new partitions for whatever.
You old drive is still on the shelf so you have nothing to lose.
It is a learning experience.
 
I like to use a Thumbdrive with FreeBSD installed. Sort of a rescue disk. Perfect for these sort of disk operations.
My reasoning why is you stick two hard disk in computer and disk names can change or become confusing.
 
On my rescue stick I have all the label stuff turned off so I can see actual drives. Not shortcuts. Too often I would see two identical disk labels on two different drives. Confusing me and the system.
/boot/loader.conf
Code:
kern.geom.label.ufs.enable=0
kern.geom.label.ufsid.enable=0
kern.geom.label.gptid.enable=0
kern.geom.label.gpt.enable=0
kern.geom.label.disk_ident.enable="0"

These are my UFS cheats. ZFS is a different world.
 
With UFS, and non-uefi bios, I would have done: IMG clonzilla of all partitions Redo the partitions Deliver IMGs from all systems Edit boot files, fstab, etc And try the startup (Save the MBR before any operation)
Why not ?
 
Back
Top