I made a file on Linux using dd from /dev/zero and it ended up with holes in it, is that supposed to happen?
-
-
Replying to @johnregehr
Holes as in fragmentation? Use `fallocate -l 40G foobar` to minimize fragmentation while still reserving the space up-front.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS
I'm trying to make a swapfile and can't tolerate holes
1 reply 0 retweets 0 likes -
Replying to @johnregehr
You definitely want to use fallocate then. It's a good idea in general but particularly for a case like that where you need it.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS
I'm getting "swapon: swapfile has holes" regardless of how I allocate the file, argh
1 reply 0 retweets 0 likes -
Replying to @johnregehr @CopperheadOS
ah, partition is btrfs, that's the reason for the error. sucks since I don't want to repartition but need swap
3 replies 1 retweet 0 likes -
Replying to @johnregehr @CopperheadOS
Can you dd from /dev/urandom instead? ;-)
1 reply 0 retweets 0 likes -
Replying to @RichFelker @CopperheadOS
I actually tried that but it turned out swapon was lying to me and the problem was btrfs, not holes in swapfile!
1 reply 0 retweets 0 likes
Ah, I thought maybe btrfs was recreating holes as soon as it saw duplicate pages.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.