Here is a small tip.
People used to ask me, how can we increase a file size in linux ? Mostly it is in conjuction with ‘virtual image file’ .. It is possible to increase/decrease the size of the file using 2 ways (those are atleast known to me)
One method is using ‘dd‘ command. I am sure it is pretty much common to you . If not, let me know, so that I can expand it.
Other being ‘truncate’ command. I will give small demo on how to use ‘truncate’ command.
truncate – shrink or extend the size of a file to the specified size
[terminal]
SYNOPSIS
truncate OPTION FILE…
A FILE argument that does not exist is created.
[/terminal]
If a FILE is larger than the specified size, the extra data is lost. If a FILE is shorter, it is extended and the extended part (hole)
reads as zero bytes.
For more information please refer #man truncate
Here is an example from my system:
[terminal]
[root@humbles-lap ~]# rpm -qf `which truncate`
coreutils-8.12-7.fc16.x86_64
[root@humbles-lap ~]#
[/terminal]
Note the size of the file called ‘cscope.out’ , this can be a virtual image file as well:
[terminal]
[root@humbles-lap~]# ls -lh cscope.out
-rw-r–r– 1 root root 197M Feb 15 12:36 cscope.out
[/terminal]
Use ‘truncate’ to extend ‘100M’
[terminal]
[root@humbles-lap ~]# truncate –size=+100M cscope.out
[/terminal]
Note the new size of the file
[terminal]
[root@humbles-lap ~]# ls -lh cscope.out
-rw-r–r– 1 root root 297M Feb 15 12:38 cscope.out
[/terminal]