[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]

Wiping empty space within a disk image

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: win81onfloppies.jpg (94KB, 1024x768px) Image search: [Google]
win81onfloppies.jpg
94KB, 1024x768px
I created some USB stick images in IMZ format with USB Image Tool. They are larger than they optimally should be because the tool apparently is filesystem-agnostic (images the drive block-by-block as, say, dd would) and there was old data left on it not part of the filesystem anmore. Is there a way to wipe the space within such an image that is empty from the point of view of the filesystem, and thus reduce the image size?

(pic unrelated)
>>
Bump. Any ideas how to compact an IMZ image (or even an uncompressed IMG image which can then be compressed manually much better after the deleted data is wiped)?

>inb4 "wipe empty space before imagining, or restore image to USB stick, wipe empty space, and reimage"

That's both time-consuming and putting unnecessary strain on the USB stick, wasting write its write cycles. There should be a way to wipe empty space on volumes within IMG/IMZ images?
>>
Why do you want an image, not a .RAR of the files?
>>
>>52437358
Good question, the reason is quite simple though - they're images of bootable USB sticks, which are more or less complicated and/or time-consuming to create, such as multiboot USB sticks with various troubleshooting tools, or Linux installers created with Unetbootin (which usually take some time to create, and put strain on the USB stick as the filesystem is built). I want to archive bootable images which may be useful in the future, while optimally keeping them as compact as possible (hence the IMZ format, but old data within the raw image makes it less compressible).
>>
>>52437358
Btw even if they weren't bootable images, it's easier and faster (potentially MUCH faster if there's a lot of small files) to reimage a USB stick block-wise that recreate a file system by copying loose files onto it file-by-file.
>>
>>52438319
>block-wise that recreate
>*thaN
>>
So people respond with a ton of "ideas" in bullshit threads like >>52433804, but nobody has any ideas when it comes to useful stuff like disk image handling?
>>
>>52436665
dd if=/dev/zero of=/media/myshittydrive/zero.bin

then create an image with dd and compress it with xz

NEXT.
>>
>>52438972
This is suggesting what >>52436999 already referred to as doable, but rather clunky and convoluted. There surely must be a way to do it with an image (rather than going through the ordeal of imaging a USB stick, wiping the free space on there and then dumping another image)?
>>
>>52439265
then mount the image on /media/myshittydrive/ faglord
or just set it up as loop device and use resize2fs to resize the partition to a smaller value.
>>
>>52439265
there is no other way. i usually mount the image, create the zero.bin, remove zero.bin, umount image, then cp --sparse=always bloated.img sparse.img. then remove the bloated one.
unused blocks can be removed only in a filesystem-specific way. like trimming in an ssd. there is no trimming for images.
>>
Is there a way to mount an IMZ (compressed) image directly under Windows? Imdisk/OSFmount don't seem to be able to.
>>
Wiping empty space on a physical USB stick itself is both slow as well as unnecessarily wearing out the USB stick memory. For these reasons it seems much better to do the compacting on an already dumped image.
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.