[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
Wiping empty space within a disk image
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

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

Thread replies: 13
Thread images: 1
File: win81onfloppies.jpg (94 KB, 1024x768) Image search: [iqdb] [SauceNao] [Google]
win81onfloppies.jpg
94 KB, 1024x768
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 replies: 13
Thread images: 1
Thread DB ID: 424977



[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | 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.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.