migrate os from computer to another

Hello
FreeBSD 9.1 stable.
Code:
gpart show
=>        34  2147483581  da0  GPT  (1.0T)
          34         128    1  freebsd-boot  (64k)
         162     2957184    2  freebsd-ufs  (1.4G)
     2957346     2097152    3  freebsd-ufs  (1.0G)
     5054498  2116026368    4  freebsd-ufs  (1T)
  2121080866     9822208    5  freebsd-ufs  (4.7G)
  2130903074    16580540    6  freebsd-swap  (7.9G)
  2147483614           1       - free -  (512B)

df -h
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/da0p2    1.4G    371M    915M    29%    /
devfs         1.0k    1.0k      0B   100%    /dev
/dev/da0p3    991M     51M    861M     6%    /tmp
/dev/da0p4    977G    160G    739G    18%    /usr
/dev/da0p5    4.5G    947M    3.2G    22%    /var

I would like the migrate the OS to another hardware. I am aware that version of OS is no longer support

Because /usr partition is too big, is there any way to migrate to computer without /usr partition (the data will be synced manually)

One way to try is to turn off the machine and try with CloneZila or another backup software to make backup and restore partition to partition.
Never try this before and I am not sure it will boot.

I saw that there is integrate tool "dump/restore".
Could that be used to backup-restore realtime without poweroff the machine?
What procedure should I use to the new computer, boot from livecd or?

Thanks in advance !
Regards,
netaccs
 
If you have another 1TB empty drive. I would use dd to copy the whole existing disk device to the new disk. You can do this while the source system is running, as long as adding the disk in hot to the hardware is supported.

I have done this in the past to duplicate my environment to two or three other computers, after the copy, installing the new disk in the new machine.

At this point, you could then format or manage your partitions as necessary.

Just be aware of the dangers of using dd incorrectly, as it's easy to destroy your existing environment with no chance of recovery.
 
I need to transfer everything 1:1
OS with current versions and configs (cause developers issues need to use old unsupported versions) only /usr partition of 200G new size instead of current 1TB.

My ideas was to clone the machine somehow and transfer only /boot and / partitions.
Other data will be sync manually.

I can mount nfs partition with free 1T size where I can try dd commands.
Can I make backup restore with dd and system boot, how can I test it?
 
OS with current versions and configs
You know COMPAT_FREEBSD9 and misc/compat9x exist? Besides that, there's not much in 9 that can't be configured exactly the same on 13 or 14. And versions of ports/packages have nothing to do with the version of the OS.

(cause developers issues need to use old unsupported versions)
Do you know you can run a 9.x jail on a 13.x system?
 
I need to transfer everything 1:1
OS with current versions and configs (cause developers issues need to use old unsupported versions) only /usr partition of 200G new size instead of current 1TB.

My ideas was to clone the machine somehow and transfer only /boot and / partitions.
Other data will be sync manually.

I can mount nfs partition with free 1T size where I can try dd commands.
Can I make backup restore with dd and system boot, how can I test it?

Where did NFS come in all of the sudden?

Do you really need to shrink /usr? Is the target system smaller?

Can't you just move the drive to the new machine?
 
Where did NFS come in all of the sudden?

Do you really need to shrink /usr? Is the target system smaller?

Can't you just move the drive to the new machine?

Move the current to another hardware (pve) so I cannot attach hdd directly.

Shrink size (/usr partition)
Is the second task.

About nfs or ftp
I have temporary free storage, which can attach on both (old and new pc) to use for making and restore backups .

change developers
Daa ama
Untill than.... :)
 
Yes, theoretically it should work. Create a new smaller disk, partitioned to have all the partitions you want to transfer, all except the usr one. Then copy all the partitions except, using dd (or any other bit-for-bit copy tool), for example "dd if=/dev/da0p2 of=/dev/da1p2 bs=...". Also make sure the partition table on the new disk is set up correctly for the bootable partition to be the same. At this point, the new disk should boot in single-user mode. Then do whatever you want for the /usr partition, whether it be copying just the files (with rsync or a similar tool), or using NFS or something like it to serve the data.

Personally, I would use dd to identical-sized partitions, rather than dump/restore. Much simpler and more reliable.

But: Just because it's possible doesn't mean it is a good idea. This will take hours of work, and it error-prone. The resulting system will be strange, and liable to have strange problems. That's all ignoring that you are running a very obsolete version.
 
Maybe you're over thinking it. Have you tried to simply tar(1) the whole system from / downwards? Might want to do this on a non-running system because you don't want/need to archive directories like /dev and /tmp. Then unpack the whole thing on a new system, with a newly created partitioning/filesystem. Not the fastest way, probably not the safest either, but it will do the trick.
 
The tar idea has another advantage: It allows unpacking the whole thing into a single partition (or single file system), which uses space more efficiently. For example, the OP has a root partition that is less than half full, and the empty space in it is more than enough to cover the size of the /usr partition they wanted to shrink.
 
Ok, so what to run just to copy these two
Code:
          34         128    1  freebsd-boot  (64k)
         162     2957184    2  freebsd-ufs  (1.4G)
 
The tar idea has another advantage: It allows unpacking the whole thing into a single partition (or single file system), which uses space more efficiently. For example, the OP has a root partition that is less than half full, and the empty space in it is more than enough to cover the size of the /usr partition they wanted to shrink.

In that case it might be the right approach to move /usr into the root filesystem first, then migrate.
 
so what to run just to copy these two
Nothing to copy from the freebsd-boot partition, you just write a good bootcode to it using gpart(8).

If one of the other partitions contains your /usr/ then you MUST copy that too. That partition contains everything from /usr/ downward, that includes /usr/local, /usr/bin, /usr/sbin, /usr/home, etc.
 
#1. Don't run EOL software. You put yourself at, arguably extreme, risk.

#2:

For UFS, boot the target machine using a USB or ISO. Configure the disk with partitions & UFS. Remain booted under the USB or ISO O/S. Mount your target rootfs as /a.

dump 0af - | ssh target-machine 'cd /a && restore xf -'

Do this for each UFS filesystem. Of course don't restore to the same fs.

Install boot blocks.

I've used this approach for Solaris, Tru64, and FreeBSD.
 
Using the tar method did the work. I boot to the new pc, create partitions, then restore from tar archive.

Big thanks to everyone for helping !

Now I have another issue which is not relevant to this topic so probably will post another topic.
Somehow FreeBSD 9x(image, install cd, bootonly ) can't boot on pve7 environment, stuck at kbd1 at kbdmux0.

Just asking, is there any method to install Freebsd 13 and build old packages/ports on it (for example php5, firebird2) or no chance at all ?
 
Back
Top