Dear Philip,
On Fri 24 Aug 2018 at 04:32:23 -0400, Philip Webb wrote:
> I want to make a copy of a partition which I can use to replace it,
> if some catastrophe damages the partition or wipes it out ;
> it needs to be byte-byte identical, incl all permissions.
>
> Can I use 'dd' ? -- eg 'dd if=/mnt/xxx of=/mnt/yyy',
> where the partition has been mounted at /mnt/xxx
> & a USB stick has been mounted at /mnt/yyy . Will that do the job ?
If you want to make a byte-by-byte copy of a partition, the easiest
way in my opinion is to dd the (unmounted) partition, e.g.
if=/dev/sda1. You could also do that with the entire drive, e.g.
if=/dev/sda.
> There seems also to be an issue re 'bs=<some number of bytes>' :
> what size is best ? i plan to use USB 3.0 for quicker copying.
For optimal performance the block size should be a multiple of the
device’s physical block size. Old hard drives had 512-B blocks, more
recent ones have larger 4-KiB physical blocks that are sometimes
software-emulated to appear as 512-B blocks. In my experience it is
faster to use even larger block sizes; I usually use bs=1M.
> Does it matter how the USB stick is formatted ?
> Can I use a raw stick with the usual default VFAT formatting ?
> Might it be better to replace that with a Linux FS, eg Ext2 ?
The lowest overhead is when you write the back-up to a raw partition
of the same size, e.g. of=/dev/sdb1. You can also write it to a
filesystem, which might make it easier to manage multiple back-ups.
Since all permissions etc. are stored in the back-up file, the choice
of file system does not really matter, though the back-up file might be
too large for VFAT (max ~4 GiB).
Sincerely,
Bas
--
Sebastiaan L. Zoutendijk | [email protected]