Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] backing up a partition
Date: Fri, 24 Aug 2018 09:20:33
Message-Id: 20180824102018.77f219e4@digimed.co.uk
In Reply to: [gentoo-user] backing up a partition by Philip Webb
1 On Fri, 24 Aug 2018 04:32:23 -0400, Philip Webb wrote:
2
3 > I want to make a copy of a partition which I can use to replace it,
4 > if some catastrophe damages the partition or wipes it out ;
5 > it needs to be byte-byte identical, incl all permissions.
6 >
7 > Can I use 'dd' ? -- eg 'dd if=/mnt/xxx of=/mnt/yyy',
8 > where the partition has been mounted at /mnt/xxx
9 > & a USB stick has been mounted at /mnt/yyy . Will that do the job ?
10
11 It will, provided the USB stick is large enough.
12
13 > There seems also to be an issue re 'bs=<some number of bytes>' :
14 > what size is best ? i plan to use USB 3.0 for quicker copying.
15
16 I usually use 4M but anything over 1M gives similar results. These days
17 I use dcfldd rather than dd and it gives a nice progress display and
18 also works out the block size for itself.
19
20 > Does it matter how the USB stick is formatted ?
21 > Can I use a raw stick with the usual default VFAT formatting ?
22 > Might it be better to replace that with a Linux FS, eg Ext2 ?
23
24 It doesn't matter how the stick *was* formatted because you are
25 overwriting it when you dd. The resulting stick won't even have a
26 partition table. Alternatively, format the stick and dd to a file on the
27 stick.
28
29 Bear in mind that dd copies the whole partition, including the bits (and
30 bytes) not currently in use by the filesystem, so it is inefficient in
31 space terms. If you just want a backup of the contents of the partition,
32 would tar not suffice?
33
34
35 --
36 Neil Bothwick
37
38 If Yoda so strong in force is, why words in right order he cannot put?