What is the console equivalent of the following Python code:
target = file("disk", "w") # create a file
target.seek(2*1024*1024*1024) # skip to 2 GB
target.write("\0")
target.close()
Maybe some dd incantation? The idea is making a file with the apparent size of 2 GB for use e.g. in virtualization.
kvm disk -cd whatever.iso #Only allocate space as necessary
dd
is the only traditional tool that exposes theseek
system call (see dd vs cat -- is dd still relevant these days? but there are other ways to skin this cat on typical current unices. – Gilles 'SO- stop being evil' Dec 21 '12 at 01:45