Creating a large file without zeroing it

Dear readers,

I’d like to use a large file (> 10 GB) as swap space.
The required steps are:

  1. Create a file
  2. mkswap $file
  3. swapon $file

Now, how can I create the file? The obvious and fast solution is to create a file with holes:
dd if=/dev/zero of=foo bs=1M count=1 seek=10239
mkswap works, but swapon complains:
# swapon /tmp/foo
swapon: Skipping file /tmp/foo - it appears to have holes.

Of course, I count just dd if=/dev/zero of=foo bs=1M count=10240, but that takes too long for me.

So, question: is there a way to tell the system: create a file that is 10GB big, don’t but fill it with zeros?

Re: GIT sucks

Scott has several posts about git (1, 2, 3), and the “I worked on this locally, now I want to push this to a remote place where others will be able to fetch it”.

I’ve been using the following snippet for that. YMMV.

REPO=reponame
ROOT=/wheremygitreposare/
SERV=remoteserver
git clone --bare . /tmp/${REPO}.git && \
rsync -avzP /tmp/${REPO}.git ${SERV}:$ROOT && \
git remote add origin ${SERV}:${ROOT}${REPO}.git && \
git config branch.master.remote origin && \
git config branch.master.merge refs/heads/master

(Please post comments if you can improve it!)
But I totally agree that this common use case is not well addressed in git.

Ultimate Debian Database talk at FOSDEM

Of course, I was in Brussels this week-end, for FOSDEM. I gave a talk about Ultimate Debian Database (slides here) in the Debian devroom. The conclusion was “UDD is ready, go play with it!” so you know what you should do now! FOSDEM in general was great and huge (see the video from Quim Gil if you still doubt that) as usual.

On a more sad note, the worst talk of the week-end was without any possible doubt Frans Pop’s release team bashing. Nobody is claiming that the release management of the lenny release cycle was perfect: there’s always room for improvement. But given the context and the constraints, I think that they did a very good job. Frans’ talk boiled down to: “The release team doesn’t know what they are doing, I would have done much better because I’m so qualified.” Giving such talks at FOSDEM, in front of an audience with many people not involved in Debian development, is really insulting. To make things worse, he finished the talk late, not leaving any time for questions/discussion, so the audience might be left with the impression that his opinions are representative of the opinions of DDs.