[wellylug] Where's my disk space gone revisited...

Chris Harris chris.harris at actrix.gen.nz
Thu Aug 14 23:41:53 NZST 2003


> Can
> I swap them over/move the space from /usr to /var by changing the
> partition?

Hi

I once found myself in this situation.
What I did was create a large file on the partition with space to spare by
piping yes through dd
eg say you want 10M
# su -
# yes|dd bs=1k count=10k > 10MegFile

Then make it a file system answering y when prompted

# mke2fs  10MegFile
mke2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09
10MegFile is not a block special device.
Proceed anyway? (y,n) y
:

create a mount point and mount it

# mkdir /home/file
# mount 10MegFile /home/file -o loop
# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hdb1              4884396   3092916   1539356  67% /
/dev/hda1                57318       413     53581   1% /boot
/dev/hdc1              3103472   2608160    337664  89% /home
/root/10MegFile           9911        13      9386   1% /home/file

thus I have stolen 10M from /dev/hdb1 and given it to /dev/hdc1

you might want to substitute /usr and /var/log/apache/ or where your http
logs are for my examples
eg
# su
# yes|dd bs=1k count=1024k > /usr/1GigFile
# mke2fs  /usr/1GigFile
:
Proceed anyway? (y,n) y
:
skip the mkdir, you already have one # mkdir /home/file
# mount /usr/1GigFile /var/log/apache/ -o loop

and edit /etc/fstab

alternately, you could create a cron job to (possibly) copy and trim the
logs

C




More information about the wellylug mailing list