Re: Wiping a disk partition
- Reply: David Christensen : "Re: Wiping a disk partition"
- In reply to: David Christensen : "Re: Wiping a disk partition"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 09 Jul 2025 19:29:59 UTC
On 3 July 2025 22:20:31 BST, David Christensen <dpchrist@holgerdanske.com> wrote: >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. Or just copy the partition in question rather than the whole drive. On multitasking system you can always put an & on the end of the rm command and let it run in the background. Probably the safest way to delete all the files if you're sure.