* [gentoo-user] How can I rewrite all empty sectors with zeros?
@ 2012-07-22 17:18 Jarry
2012-07-22 17:36 ` Jesús J. Guerrero Botella
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Jarry @ 2012-07-22 17:18 UTC (permalink / raw
To: gentoo-user
Hi,
I want to backup my whole hard-drive (8 partitions) with:
# dd if=/dev/sda | gzip > /path/image.gz
In order to achieve good compression level I'd like to wipe
out all empty space with zeros. How can I do that?
Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] How can I rewrite all empty sectors with zeros?
2012-07-22 17:18 [gentoo-user] How can I rewrite all empty sectors with zeros? Jarry
@ 2012-07-22 17:36 ` Jesús J. Guerrero Botella
2012-07-22 17:45 ` Alex Schuster
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Jesús J. Guerrero Botella @ 2012-07-22 17:36 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 635 bytes --]
You can just fill a file with zeros and let it grow until de device is
full.
dd if=/dev/zero of=/foo.0
El 22/07/2012 19:26, "Jarry" <mr.jarry@gmail.com> escribió:
> Hi,
> I want to backup my whole hard-drive (8 partitions) with:
> # dd if=/dev/sda | gzip > /path/image.gz
>
> In order to achieve good compression level I'd like to wipe
> out all empty space with zeros. How can I do that?
>
> Jarry
> --
> ______________________________**______________________________**___
> This mailbox accepts e-mails only from selected mailing-lists!
> Everything else is considered to be spam and therefore deleted.
>
>
>
[-- Attachment #2: Type: text/html, Size: 919 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] How can I rewrite all empty sectors with zeros?
2012-07-22 17:18 [gentoo-user] How can I rewrite all empty sectors with zeros? Jarry
2012-07-22 17:36 ` Jesús J. Guerrero Botella
@ 2012-07-22 17:45 ` Alex Schuster
2012-07-22 18:09 ` Mick
2012-07-23 9:28 ` Neil Bothwick
2012-07-23 14:29 ` [gentoo-user] " Nikos Chantziaras
3 siblings, 1 reply; 9+ messages in thread
From: Alex Schuster @ 2012-07-22 17:45 UTC (permalink / raw
To: gentoo-user
Jarry writes:
> I want to backup my whole hard-drive (8 partitions) with:
> # dd if=/dev/sda | gzip > /path/image.gz
>
> In order to achieve good compression level I'd like to wipe
> out all empty space with zeros. How can I do that?
You can create files containing only zeros on all partitions until
they are full. Like this:
for i in 5 6 7 8 9 10 11 12
do
mount /dev/sda$i /mnt
dd if=/dev/zero of=/mnt/zero
rm /mnt/zero
umount /mnt
done
Wonko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] How can I rewrite all empty sectors with zeros?
2012-07-22 17:45 ` Alex Schuster
@ 2012-07-22 18:09 ` Mick
0 siblings, 0 replies; 9+ messages in thread
From: Mick @ 2012-07-22 18:09 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 701 bytes --]
On Sunday 22 Jul 2012 18:45:50 Alex Schuster wrote:
> Jarry writes:
> > I want to backup my whole hard-drive (8 partitions) with:
> > # dd if=/dev/sda | gzip > /path/image.gz
> >
> > In order to achieve good compression level I'd like to wipe
> > out all empty space with zeros. How can I do that?
>
> You can create files containing only zeros on all partitions until
> they are full. Like this:
>
> for i in 5 6 7 8 9 10 11 12
> do
> mount /dev/sda$i /mnt
> dd if=/dev/zero of=/mnt/zero
> rm /mnt/zero
> umount /mnt
> done
>
> Wonko
Only to add that using bs=4096 or bs=2048 would help this take less than a
week waiting for it to finish. :-)
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] How can I rewrite all empty sectors with zeros?
2012-07-22 17:18 [gentoo-user] How can I rewrite all empty sectors with zeros? Jarry
2012-07-22 17:36 ` Jesús J. Guerrero Botella
2012-07-22 17:45 ` Alex Schuster
@ 2012-07-23 9:28 ` Neil Bothwick
2012-07-23 14:29 ` [gentoo-user] " Nikos Chantziaras
3 siblings, 0 replies; 9+ messages in thread
From: Neil Bothwick @ 2012-07-23 9:28 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 640 bytes --]
On Sun, 22 Jul 2012 19:18:44 +0200, Jarry wrote:
> I want to backup my whole hard-drive (8 partitions) with:
> # dd if=/dev/sda | gzip > /path/image.gz
>
> In order to achieve good compression level I'd like to wipe
> out all empty space with zeros. How can I do that?
It may be worth your while looking at partimage (which can also image
whole drives). It only copies used sectors so avoids the problem of
storing obsolete data. I believe Clonezilla uses partimage, and you'd
have to use a live CD to image a system drive like this anyway.
--
Neil Bothwick
War does not determine who is right -- only who is left.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [gentoo-user] Re: How can I rewrite all empty sectors with zeros?
2012-07-22 17:18 [gentoo-user] How can I rewrite all empty sectors with zeros? Jarry
` (2 preceding siblings ...)
2012-07-23 9:28 ` Neil Bothwick
@ 2012-07-23 14:29 ` Nikos Chantziaras
2012-07-23 15:31 ` Simon
2012-07-23 16:24 ` Jarry
3 siblings, 2 replies; 9+ messages in thread
From: Nikos Chantziaras @ 2012-07-23 14:29 UTC (permalink / raw
To: gentoo-user
On 22/07/12 20:18, Jarry wrote:
> Hi,
> I want to backup my whole hard-drive (8 partitions) with:
> # dd if=/dev/sda | gzip > /path/image.gz
>
> In order to achieve good compression level I'd like to wipe
> out all empty space with zeros. How can I do that?
That's the wrong way to do it. You should use a tool that only copies
the data, and then also backup the partition table.
Or use partimage/clonezilla like Neil mentioned which does all that
automatically.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Re: How can I rewrite all empty sectors with zeros?
2012-07-23 14:29 ` [gentoo-user] " Nikos Chantziaras
@ 2012-07-23 15:31 ` Simon
2012-07-23 16:24 ` Jarry
1 sibling, 0 replies; 9+ messages in thread
From: Simon @ 2012-07-23 15:31 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]
On Mon, Jul 23, 2012 at 10:29 AM, Nikos Chantziaras <realnc@gmail.com>wrote:
> On 22/07/12 20:18, Jarry wrote:
>
>> Hi,
>> I want to backup my whole hard-drive (8 partitions) with:
>> # dd if=/dev/sda | gzip > /path/image.gz
>>
>> In order to achieve good compression level I'd like to wipe
>> out all empty space with zeros. How can I do that?
>>
>
> That's the wrong way to do it. You should use a tool that only copies the
> data, and then also backup the partition table.
>
> Or use partimage/clonezilla like Neil mentioned which does all that
> automatically.
>
For my part, I found compressing all files using squashfs to be most
useful, specially for backups as restoring single files vs all files is
just as simple.
Also, using the squashfs archive as read-only base of a unioned mount
(aufs, unionfs) is also a very useful trick.
As my systems are all setup the same, I never backup the partition table
and recreate it each time (easy, and I often change the partition layout
anyway).
Simon
[-- Attachment #2: Type: text/html, Size: 1446 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Re: How can I rewrite all empty sectors with zeros?
2012-07-23 14:29 ` [gentoo-user] " Nikos Chantziaras
2012-07-23 15:31 ` Simon
@ 2012-07-23 16:24 ` Jarry
2012-07-23 20:01 ` Nikos Chantziaras
1 sibling, 1 reply; 9+ messages in thread
From: Jarry @ 2012-07-23 16:24 UTC (permalink / raw
To: gentoo-user
On 23-Jul-12 16:29, Nikos Chantziaras wrote:
> On 22/07/12 20:18, Jarry wrote:
>> Hi,
>> I want to backup my whole hard-drive (8 partitions) with:
>> # dd if=/dev/sda | gzip > /path/image.gz
>>
>> In order to achieve good compression level I'd like to wipe
>> out all empty space with zeros. How can I do that?
>
> That's the wrong way to do it. You should use a tool that only copies
> the data, and then also backup the partition table.
>
> Or use partimage/clonezilla like Neil mentioned which does all that
> automatically.
I know those tools. Unfortunatelly, they do not support
"smart copying" (only used sectors) if software raid is used.
So I'm back on the beginning: I can clone only the whole
drive (all sectors). No matter if I use dd, clonezila or
partimage...
Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [gentoo-user] Re: How can I rewrite all empty sectors with zeros?
2012-07-23 16:24 ` Jarry
@ 2012-07-23 20:01 ` Nikos Chantziaras
0 siblings, 0 replies; 9+ messages in thread
From: Nikos Chantziaras @ 2012-07-23 20:01 UTC (permalink / raw
To: gentoo-user
On 23/07/12 19:24, Jarry wrote:
> On 23-Jul-12 16:29, Nikos Chantziaras wrote:
>> On 22/07/12 20:18, Jarry wrote:
>>> Hi,
>>> I want to backup my whole hard-drive (8 partitions) with:
>>> # dd if=/dev/sda | gzip > /path/image.gz
>>>
>>> In order to achieve good compression level I'd like to wipe
>>> out all empty space with zeros. How can I do that?
>>
>> That's the wrong way to do it. You should use a tool that only copies
>> the data, and then also backup the partition table.
>>
>> Or use partimage/clonezilla like Neil mentioned which does all that
>> automatically.
>
> I know those tools. Unfortunatelly, they do not support
> "smart copying" (only used sectors) if software raid is used.
>
> So I'm back on the beginning: I can clone only the whole
> drive (all sectors). No matter if I use dd, clonezila or
> partimage...
There's good ol' tar too :-) I usually use that one, or rsync if I need
to clone rather than back-up and compress. Those two have never let me
down yet.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-07-23 20:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-22 17:18 [gentoo-user] How can I rewrite all empty sectors with zeros? Jarry
2012-07-22 17:36 ` Jesús J. Guerrero Botella
2012-07-22 17:45 ` Alex Schuster
2012-07-22 18:09 ` Mick
2012-07-23 9:28 ` Neil Bothwick
2012-07-23 14:29 ` [gentoo-user] " Nikos Chantziaras
2012-07-23 15:31 ` Simon
2012-07-23 16:24 ` Jarry
2012-07-23 20:01 ` Nikos Chantziaras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox