[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
dd Command Help
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 13
Thread images: 1
File: dd.gif (2 KB, 300x300) Image search: [Google]
dd.gif
2 KB, 300x300
Hey /g/uys,

Not sure if at this time of the day some of the more knowledgeable folks are on, but I had a question about the dd command.

I have a spare disk, and I successfully dd'ed an image of my system's drive to it. And then I actually tested it, and it works just like it should. So that's great.

But what I now want to do is tweak my dd command so that I can output it, in a compressed format, to an archive (it's my understanding that an .img file is best for this). So I would have something like "backup.img.gz" or something?

How would I do that? I'm pretty sure I'm supposed to fill the unused space of the drive I'm backing up with zeros, and then spit to an output drive in compressed form?

So far I use:

dd if=/dev/sda of=/dev/sdb bs=4096 conv=noerror,sync


Any help is appreciated.
>>
So the Arch Wiki is saying something like (edited a bit) --

dd if=/dev/sda conv=sync,noerror bs=4096 | gzip -c > /sdb/Backup/backup.img.gz


What command should I use before this so that I can fill up the free space with zeros? (So that it actually compresses more efficiently?)
>>
So judging by the threads on here right now it looks like this might be a bad time. But I'm going to bump three times because I'm a little but of a faggot but that's ok.
>>
>>55619898
You can use if=/dev/zero for writing zeroes
>>
>>55619898
Not just compress efficiently, but to be able to compress at all. dd used like that reads the raw bits from the disk which may point to actual files or may just be pointing to old already delted data on the disk.

How to actually zero the empty space? There really aren't any smart ways to do it because it's kinda stupid thing to do in the first place as there are way better ways to do backups, for example making a sparse image and rsyncing your stuff onto it
>>
>>55620072
thank you.

>>55620095
thank you for responding. i'm sorry i didn't explain myself correctly, as i shouldn't call this a backup, rather, it's more of an image of a base install (that's been fully patched to current).

my actual backup will come next. and I've written down what you've said. i want to start using rsync. problem is I'm a bit squeezed for space and money to have a nice server sitting somewhere in my already cramped apartment.

also, i found a tool for zero'ing the free space on NTFS filesystems, and it's called sdelete (by Mark Russinovich).

Also, can you guys help me a little with the compression command to use in combination with dd? Is this ok? (assuming I've written zeros to the free space)

dd if=/dev/sda bs=4096 conv=sync,noerror | gzip -c > /sdb/base-install/base-install.img.gz
>>
mount the partition read-only and tar. make sure you don't include virtual filesystems (/proc/, etc.)
>>
>>55620307
you fucking ninja, thank you.
this is an NTFS filesystem, btw.
>>
ok last bump.

Would it make sense to do use tarball?

So snapshot.img.tar.gz ?

Assuming i dd'ed an image of the NTFS filesystem after i wrote zeros to the free space?
>>
>>55620307
No, he should definitely include the etc.

>>55620212
tar, rsync, cp, whatever. You don't need anything else than the files with permissions intact on that image/tar file as the underlying filesystem stuff that copying with dd gives you can be re-created with just two commands
>>
>>55620464
"etc." means et cetera, not the /etc/ folder.
>>
On a related note:

How can I use dd or a similar program to take old Playstation games adn output them to .iso format? I keep getting an I/O error.
>>
>>55620596
try mkisofs -o /tmp/cd.iso /mnt/something/something
Thread replies: 13
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.