Re: Moving to a larger disk

From: Ralf Mardorf <ralf-mardorf_at_riseup.net>
Date: Sat, 20 May 2023 18:06:04 UTC
On Sat, 2023-05-20 at 18:43 +0200, Tomek CEDRO wrote:
> dd if=/dev/olddisk of=/dev/newdisk bs=100m status=progress (DO NOT
> MESS UP OLD DISK AND NEW DISK :-) )

Hi,

that's why I would use gparted first or what ever supports the wanted
file system and then boot a live media to run cp.

cp -ai /mnt/source/* /mnt/source/.hidden_item_1 /mnt/source/.hidden_item_n/ /mnt/target/; echo $?

https://man.freebsd.org/cgi/man.cgi?cp
Seemingly cp on FreeBSD doesn't support the Linux -T option. I'm not a
FreeBSD expert and might be missing something. It at least might be
possible to work around the globbing issue by an option of the used
shell. Maybe it makes a difference, if at the end of a directory is or
isn't a /.

If the file system should be supported by Linux I would run a Linux live media and run

cp -Tai /mnt/source/ /mnt/target/; echo $?

https://manpages.ubuntu.com/manpages/focal/man1/cp.1.html

After that I would shut down the machine and boot the live media again, to clear the caches, before running

diff -r /mnt/source /mnt/target > diff.log

https://man.freebsd.org/cgi/man.cgi?query=diff&apropos=0&sektion=0&manpath=FreeBSD+13.2-RELEASE+and+Ports&arch=default&format=html
I don't know how FreeBSD diff treats symbolic links.

From a Linux live media I would run

diff -r --no-dereference /mnt/source/ /mnt/target/ > diff.log

The differences might be "special character files", "sockets" etc.
nothing that matters, so you can grep through the log file to see if
really something is broken, or all differences are quasi false
positives.

Regards,
Ralf