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

dd Command Help

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 13
Thread images: 1

File: dd.gif (2KB, 300x300px) Image search: [Google]
dd.gif
2KB, 300x300px
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 posts: 13
Thread images: 1


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.