Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Let it run until the disk runs out of space, and then delete $HOME/zerofile.bin.
This sounds fiendishly clever and too good to be true. There must be a catch somewhere but I can't see it. Possibly a brilliant solution. I'll bet someone now comes along with a snag that makes the idea totally unworkable. You wait and see.
There must be a catch somewhere but I can't see it.
Well, if you don't do it as "root" the reserved space on the filesystem won't get cleared, and of course if this is some exotic filesystem or device that compresses its data, it might take a long time to run out of space for all those compressed zeros. Also, for SSDs and Flash drives, you will zero the visible free space, but you won't know what happens on the free space that the controller manages. (That space will get cleared when the controller gets the proverbial "round tuit," but you can't control when that happens.)
i was just going to suggest the same.
yes, it's the magic of unix.
Wow. I'm resigned to using dd for backups and this will save a huge amount of otherwise wasted disk space when compressed. Unwiped disk space is too much like random data and IIRC, random data doesn't compress. A huge bunch of zeroes, OTOH, will compress wonderously.
Well, if you don't do it as "root" the reserved space on the filesystem won't get cleared, and of course if this is some exotic filesystem or device that compresses its data, it might take a long time to run out of space for all those compressed zeros. Also, for SSDs and Flash drives, you will zero the visible free space, but you won't know what happens on the free space that the controller manages. (That space will get cleared when the controller gets the proverbial "round tuit," but you can't control when that happens.)
Well fortunately I'm not doing this for security purposes, so if that's all I have to worry about, I'm not worried.
Well fortunately I'm not doing this for security purposes, so if that's all I have to worry about, I'm not worried.
In that case, if this is a filesystem that has reserved space (like ext2/3/4 and others -- not FAT), you'll need to do it as the UID or GID that has rights to the reserved space. Otherwise, any UID or GID with write permission in some directory will do.
Wow. I'm resigned to using dd for backups and this will save a huge amount of otherwise wasted disk space when compressed. Unwiped disk space is too much like random data and IIRC, random data doesn't compress. A huge bunch of zeroes, OTOH, will compress wonderously.
???
i don't think that dd compresses anything.
it will faithfully copy every single zero.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.