2004/03/21
sparse copies
# cp --sparse=always file1 file2
Will not use up extra space by copying blocks that have no data. Good for swap files, ISO's, filesystem images, etc.
You could use dd to make a VERY large FS this way:
# dd if=/dev/zero of=wherever.ext3 bs=1024 count=0 seek=2048
# mkfs.ext3 wherever.ext3
...would set up a 2G filesystem that only takes up about 5 meg on disk and would grow as you used files. You can see the difference by using ls -ls:
# ls -ls wherever.ext3
Will not use up extra space by copying blocks that have no data. Good for swap files, ISO's, filesystem images, etc.
You could use dd to make a VERY large FS this way:
# dd if=/dev/zero of=wherever.ext3 bs=1024 count=0 seek=2048
# mkfs.ext3 wherever.ext3
...would set up a 2G filesystem that only takes up about 5 meg on disk and would grow as you used files. You can see the difference by using ls -ls:
# ls -ls wherever.ext3