9/24/2023 0 Comments Clean disk space linuxOne of the following techniques can be used to make the file sparse (so runs of zero stop taking up space): You will need to use an appropriate disk image tool (such as qemu-img convert src_image dst_image) to enable the zeroed space to be reclaimed and to allow the file representing the image to become smaller. Making the image file smaller Image is in a dedicated VM format Discarding tends to be the fastest method when a lot of previously used space needs to be zeroed but using zerofree after the discard process can sometimes zero a little bit extra (depending on how discard is implemented on the "disk"). Having the filesystem unmounted will give better results than having it mounted. This method is inefficient, not recommended by Ted Ts'o (author of ext4), may not zero certain things and can slow down future fscks. Using cat /dev/zero > /mnt/fs/zeros sync rm /mnt/fs/zeros ( sfill from secure-delete uses this technique).a modern SSD supporting TRIM, a VM file whose format supports sparseness etc.), your kernel says the block device understands it and finally the ext filesystem driver supports it you can use fstrim /mnt/fs/ to ask the filesystem to discard unused space. If the "disk" your filesystem is on is thin provisioned (e.g.Using e2image -rap src_fs dest_fs to only copy blocks in use (new filesystem should be on an otherwise zeroed "disk", requires e2fsprogs 1.42.9 or higher).zerofree src_fs) to explicitly write zeros over unused blocks. a modern SSD supporting TRIM, a VM file whose format supports sparseness etc.) and your kernel says the block device understands it, you can use e2fsck -E discard src_fs to discard unused space (requires e2fsprogs 1.42.2 or higher). Summary of the methods (as mentioned in this question and elsewhere) to clear unused space on ext2/ext3/ext4: Zeroing unused space File system is not mounted Once empty spaces have been zeroed, backup images can be compressed more efficiently. A typical example of this is the dump of the SD card in a BeagleBone or a Raspberry Pi. Other usesĪnother application this utility is to compress disk images that are a backup of a real disk. Zerofree finds the unallocated blocks with non-zero value content inĪn ext2, ext3 or ext4 file-system and fills them with zeroes. deb package contains the following paragraph now which would imply this will work fine with ext4 too.ĭescription: zero free blocks from ext2, ext3 and ext4 file-systems If this is not your case, youĪlmost certainly don't need this package. Zerofree has been written to be run from GNU/Linux systems installedĪs guest OSes inside a virtual machine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |