Re: Wiping a disk partition

From: David Christensen <dpchrist_at_holgerdanske.com>
Date: Thu, 03 Jul 2025 21:20:31 UTC
On 6/25/25 03:16, Odhiambo Washington wrote:
 > root@gw:/home/wash # df -h
 > Filesystem     Size    Used   Avail Capacity  Mounted on
 > /dev/ada0p2    1.8T    552G    1.1T    33%    /
 > devfs          1.0K      0B    1.0K     0%    /dev
 > fdescfs        1.0K      0B    1.0K     0%    /dev/fd
 > procfs         8.0K      0B    8.0K     0%    /proc
 > linprocfs      8.0K      0B    8.0K     0%    /compat/linux/proc
 > linsysfs       8.0K      0B    8.0K     0%    /compat/linux/sys
 > /dev/ada1p2    1.8T    856G    802G    52%    /disk2


On 7/3/25 02:24, Odhiambo Washington wrote:
> What I did was:
> 
> umount /disk2
> dd if=/dev/ada0 of=/dev/ada1 bs=1g status=progress


If the computer was running in multi-user mode when you cloned ada0 to 
ada1, the root file system on ada0p2 will have been mounted read-write, 
any ada0 swap partition will have been active, and it is likely that 
foreground and/or background processes wrote to ada0 while cloning.  The 
last means the source and the clone are not the same, and the backup is 
incorrect.


If you want to clone ada0 to ada1, then you must boot into single-user 
mode or boot live media; so that ada0 does not change while cloning. 
After making the clone, verify by using cmp(1) to do a byte-for-byte 
comparison of the source and the clone.


David